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{
42 /**--------------------------------------------------------------------------------------------------
43 \brief Displays the progress, either horizontally as a bar or as a roand spin dial. Contains various
44 options for display and can be added as a LogStream to a Log.
45 **/
47 {
48 public:
49 explicit ProgressWidget(QWidget* parent = nullptr);
50 virtual ~ProgressWidget() override;
51 void setIconID(const String& image_id, bool foreground = true);
52 void clearIcon();
53 void resizeEvent(QResizeEvent* event) override;
54 void setHorizontal(bool is_horizontal);
55 void setTickCount(uint04 tick_count);
56 void paintEvent(QPaintEvent* event) override;
57 void setSizeMultiplier(fltp04 size_multiplier);
58 virtual void setIndeterminateAnimationTimespan(const TimeSpan& span) override;
60 [[nodiscard]] QSize sizeHint() const override;
61 [[nodiscard]] QSize minimumSizeHint() const override;
62 virtual bool event(QEvent* event) override;
63 bool isHorizontal() const { return m_is_horizontal; }
64 int heightForWidth(int w) const override { return w; }
65 virtual void addMessage(const LogMessage&) override;
68 protected:
70 void setProgress(fltp04 percent) override;
71 protected:
77 QString m_last_text;
81 fltp04 m_size_multiplier = 1.0f;
82 uint04 m_tick_count = 10;
83 fltp04 m_thickness = 0.1f;
87 bool m_icon_foreground = false;
88 };
89
90}
#define NDEVR_WIDGETS_API
Definition DLLInfo.h:59
A class that allows for specific log information to be conveyed to a ProgressInfo object including in...
Definition LogMessage.h:44
A class that listens to a log object and processes the updates in a specified way....
Definition LogStream.h:46
Displays the progress, either horizontally as a bar or as a roand spin dial. Contains various options...
Definition ProgressWidget.h:47
QSize minimumSizeHint() const override
fltp04 progressEpsilon() const
fltp04 m_last_percent
Definition ProgressWidget.h:80
QPixmap * m_tick_mark_cache_image
Definition ProgressWidget.h:74
String m_icon_id
Definition ProgressWidget.h:72
bool isHorizontal() const
Definition ProgressWidget.h:63
QFont m_last_font_a
Definition ProgressWidget.h:78
QRectF m_last_text_rect_a
Definition ProgressWidget.h:75
bool m_is_horizontal
Definition ProgressWidget.h:84
QSize sizeHint() const override
void setTickCount(uint04 tick_count)
QRectF m_last_text_rect_b
Definition ProgressWidget.h:76
virtual bool event(QEvent *event) override
QString m_last_text
Definition ProgressWidget.h:77
virtual void addMessage(const LogMessage &) override
int heightForWidth(int w) const override
Definition ProgressWidget.h:64
void setIconID(const String &image_id, bool foreground=true)
void setHorizontal(bool is_horizontal)
virtual void setIndeterminateAnimationTimespan(const TimeSpan &span) override
void setProgress(fltp04 percent) override
QIcon m_background_icon
Definition ProgressWidget.h:73
void setSizeMultiplier(fltp04 size_multiplier)
void resizeEvent(QResizeEvent *event) override
virtual ~ProgressWidget() override
void paintEvent(QPaintEvent *event) override
bool m_is_updating_percent
Definition ProgressWidget.h:86
void setProgressThickness(fltp04 thickness)
QFont m_last_font_b
Definition ProgressWidget.h:79
ProgressWidget(QWidget *parent=nullptr)
bool m_is_analog
Definition ProgressWidget.h:85
Allows for showing of progress bar in horizontal format. Defaults to look and feel of system progress...
Definition QCustomProgressbar.h:55
The core String class for the NDEVR API.
Definition String.h:69
Stores a time span, or difference between two times, with an optional start time.
Definition TimeSpan.h:46
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96