JKQtExtras
a library of useful Qt widgets and tools
|
18 #ifndef JKQTEMODERNPROGRESS_H
19 #define JKQTEMODERNPROGRESS_H
21 #include "jkqtextras_imexport.h"
26 #include <QPushButton>
61 Q_PROPERTY(QColor innerCircleProgressColor READ innerCircleProgressColor WRITE setInnerCircleProgressColor USER
true)
62 Q_PROPERTY(
InnerProgressIndicatorMode innerProgressIndicatorMode READ innerProgressIndicatorMode WRITE setInnerProgressIndicatorMode USER
true)
63 Q_PROPERTY(
TextDisplayMode textDisplayMode READ textDisplayMode WRITE setTextDisplayMode USER
true)
64 Q_PROPERTY(
Mode mode READ mode WRITE setMode USER
true)
65 Q_PROPERTY(
int items READ items WRITE setItems USER
true)
66 Q_PROPERTY(
int spinInterval READ spinInterval WRITE setSpinInterval USER
true)
67 Q_PROPERTY(
bool spin READ spin WRITE setSpin USER
true)
68 Q_PROPERTY(QColor indicatorColor READ indicatorColor WRITE setIndicatorColor USER
true)
69 Q_PROPERTY(QColor stopColor READ stopColor WRITE setStopColor USER
true)
70 Q_PROPERTY(QColor startColor READ startColor WRITE setStartColor USER
true)
71 Q_PROPERTY(QColor innerCircleBackgroundColor READ innerCircleBackgroundColor WRITE setInnerCircleBackgroundColor USER
true)
72 Q_PROPERTY(QColor indicatorBackgroundColor READ indicatorBackgroundColor WRITE setIndicatorBackgroundColor USER
true)
73 Q_PROPERTY(
double nonBackgroundRange READ nonBackgroundRange WRITE setNonBackgroundRange USER
true)
74 Q_PROPERTY(
double innerRadius READ innerRadius WRITE setInnerRadius USER
true)
75 Q_PROPERTY(
double outerRadius READ outerRadius WRITE setOuterRadius USER
true)
76 Q_PROPERTY(
double value READ value WRITE setValue USER
true)
77 Q_PROPERTY(
double maximum READ maximum WRITE setMaximum USER
true)
78 Q_PROPERTY(
double minimum READ minimum WRITE setMinimum USER
true)
79 Q_PROPERTY(
int precision READ precision WRITE setPrecision USER
true)
80 Q_PROPERTY(QString suffix READ suffix WRITE setSuffix USER
true)
99 Q_ENUM(TextDisplayMode)
108 Q_ENUM(InnerProgressIndicatorMode)
114 QString suffix() const;
116 int precision() const;
118 double minimum() const;
120 double maximum() const;
122 double value() const;
124 double outerRadius() const;
126 double innerRadius() const;
129 QColor indicatorBackgroundColor() const;
131 QColor innerCircleBackgroundColor() const;
134 QColor startColor() const;
137 QColor stopColor() const;
139 QColor indicatorColor() const;
142 double nonBackgroundRange() const;
146 int spinInterval() const;
152 QColor textColor() const;
158 QColor innerCircleProgressColor() const;
163 void setMinimum(
double val);
165 void setMaximum(
double val);
167 void setValue(
double val);
169 void setRange(
double min,
double max);
171 void setSuffix(QString s);
173 void setPrecision(
int p);
175 void setTextColor(QColor col);
177 void setOuterRadius(
int val);
179 void setInnerRadius(
int val);
182 void setNonBackgroundRange(
double val);
185 void setStartColor(QColor col);
188 void setStopColor(QColor col);
190 void setIndicatorColor(QColor col);
192 void setIndicatorBackgroundColor(QColor col);
195 void setBackgroundColor(QColor col);
197 void setInnerCircleBackgroundColor(QColor col);
199 void setInnerCircleProgressColor(QColor col);
201 void setSpin(
bool enabled);
203 void setSpinInterval(
int msec);
205 void setItems(
int i);
213 virtual
void paintEvent(QPaintEvent *event);
214 virtual
void resizeEvent(QResizeEvent *event);
220 static
int getSmoothItems(
int items);
227 double m_outerRadius;
228 double m_innerRadius;
232 int m_smoothSpinItem;
236 QColor m_indicatorBackgroundColor;
237 QColor m_indicatorColor;
240 QColor m_innerCircleBackgroundColor;
241 QColor m_innerCircleProgressColor;
242 double m_nonBackgroundRange;
247 bool m_darkCircleBorder;
278 const QString &cancelButtonText,
279 QWidget *parent = NULL,
280 Qt::WindowFlags f = Qt::Window |
281 Qt::WindowTitleHint);
369 #endif // JKQTEMODERNPROGRESS_H
const QTextEdit * longTextWidth() const
returns the long text lines widget
QPushButton * cancelButton()
returns the cancel button widget
void setRange(double min, double max)
set the progress range
const QPushButton * cancelButton() const
returns the cancel button widget
QTimer timerDelay
Definition: jkqtemodernprogress.h:359
void setCancelButtonText(const QString &t)
text on the "Cancel" button of the dialog
const QLabel * textLabel() const
returns the text label widget
void openDelayed(int minimumDuration=2500)
display the progress dialog after a delay of minimumDuration milliseconds
void setMinimum(double min)
set the progress range
void setValue(double value)
set the value in progress mode (activate calling setRange() or setProgress() )
QString labelText() const
text in the label of the dialog
int m_minimumDuration
Definition: jkqtemodernprogress.h:356
QTextEdit * longTextWidth()
returns the long text lines widget
const JKQTEModernProgressWidget * progressWidget() const
returns the progress widget
JKQTEModernProgressWidget * progress
Definition: jkqtemodernprogress.h:354
void addLongTextLine(const QString &t)
add a line of text to the dialog
dialog, using JKQTEModernProgressWidget
Definition: jkqtemodernprogress.h:273
virtual ~JKQTEModernProgressDialog()
void setMode(bool enabledSpin, JKQTEModernProgressWidget::TextDisplayMode mode)
en-/disable spin and progress mode
double value() const
returns the current progress value
QPushButton * cancel
Definition: jkqtemodernprogress.h:355
void setLabelText(const QString &t)
text in the label of the dialog
JKQTEModernProgressDialog(QWidget *parent=NULL, Qt::WindowFlags f=0)
virtual void showEvent(QShowEvent *event)
void setHasCancel(bool has=true)
indicate whetehr the dialog has a Cancel button (default: true )
QString cancelButtonText() const
text on the "Cancel" button of the dialog
QLabel * textLabel()
returns the text label widget
bool m_wasCancel
Definition: jkqtemodernprogress.h:357
void setMaximum(double max)
set the progress range
void canceled()
emitted when the "Cancel" button is clicked
QLabel * label
Definition: jkqtemodernprogress.h:352
bool wasCanceled()
returns true if the "Cancel" button has been clicked
bool m_closedBeforeDelay
Definition: jkqtemodernprogress.h:358
JKQTEModernProgressDialog(const QString &labelText, const QString &cancelButtonText, QWidget *parent=NULL, Qt::WindowFlags f=Qt::Window|Qt::WindowTitleHint)
double maximum() const
returns the current progress range maximum
virtual void closeEvent(QCloseEvent *e)
JKQTEModernProgressWidget * progressWidget()
returns the progress widget
QTextEdit * longmessage
Definition: jkqtemodernprogress.h:353
double minimum() const
returns the current progress range minimum
bool spin() const
returns whether the indicator spins