API Documentation
Loading...
Searching...
No Matches
ProgressWidget.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: ProgressWidget
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/QCustomProgressbar.h>
35#include <NDEVR/LogStream.h>
36class QTimer;
37class QRectF;
38class QPixmap;
39class QRadialGradient;
40namespace NDEVR
41{
43 {
44 public:
45 explicit ProgressWidget(QWidget* parent = nullptr);
46 virtual ~ProgressWidget() override;
47 void setIconID(const String& image_id, bool foreground = true);
48 void clearIcon();
49 void resizeEvent(QResizeEvent* event) override;
50 void setHorizontal(bool is_horizontal);
51 void setTickCount(uint04 tick_count);
52 void paintEvent(QPaintEvent* event) override;
53 void setSizeMultiplier(fltp04 size_multiplier);
54 virtual void setIndeterminateAnimationTimespan(const TimeSpan& span) override;
55 void setProgressThickness(fltp04 thickness);
56 [[nodiscard]] QSize sizeHint() const override;
57 [[nodiscard]] QSize minimumSizeHint() const override;
58 virtual bool event(QEvent* event) override;
59 bool isHorizontal() const { return m_is_horizontal; }
60 int heightForWidth(int w) const override { return w; }
61 virtual void addMessage(const LogMessage&) override;
62 void clearTextRectCache();
63 fltp04 progressEpsilon() const;
64 protected:
65 void updateTimerInterval();
66 void setProgress(fltp04 percent) override;
67 protected:
73 QString m_last_text;
77 fltp04 m_size_multiplier = 1.0f;
78 uint04 m_tick_count = 10;
79 fltp04 m_thickness = 0.1f;
83 bool m_icon_foreground = false;
84 };
85
86}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:81
Definition LogMessage.h:40
Definition LogStream.h:42
Definition ProgressWidget.h:43
fltp04 m_last_percent
Definition ProgressWidget.h:76
QPixmap * m_tick_mark_cache_image
Definition ProgressWidget.h:70
String m_icon_id
Definition ProgressWidget.h:68
bool isHorizontal() const
Definition ProgressWidget.h:59
QFont m_last_font_a
Definition ProgressWidget.h:74
QRectF m_last_text_rect_a
Definition ProgressWidget.h:71
bool m_is_horizontal
Definition ProgressWidget.h:80
QRectF m_last_text_rect_b
Definition ProgressWidget.h:72
QString m_last_text
Definition ProgressWidget.h:73
int heightForWidth(int w) const override
Definition ProgressWidget.h:60
QIcon m_background_icon
Definition ProgressWidget.h:69
bool m_is_updating_percent
Definition ProgressWidget.h:82
QFont m_last_font_b
Definition ProgressWidget.h:75
bool m_is_analog
Definition ProgressWidget.h:81
Allows for showing of progress bar in horizontal format. Defaults to look and feel of system progress...
Definition QCustomProgressbar.h:48
Definition String.h:40
Definition TimeSpan.h:40
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number.
Definition BaseValues.hpp:157
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:120