JKQtExtras
a library of useful Qt widgets and tools
JKQTEModernProgressDialog Class Reference

dialog, using JKQTEModernProgressWidget More...

#include <jkqtemodernprogress.h>

Inheritance diagram for JKQTEModernProgressDialog:
Collaboration diagram for JKQTEModernProgressDialog:

Public Slots

void setCancelButtonText (const QString &t)
 text on the "Cancel" button of the dialog More...
 
void setHasCancel (bool has=true)
 indicate whetehr the dialog has a Cancel button (default: true ) More...
 
void setLabelText (const QString &t)
 text in the label of the dialog More...
 
void setMaximum (double max)
 set the progress range More...
 
void setMinimum (double min)
 set the progress range More...
 
void setRange (double min, double max)
 set the progress range More...
 
void setValue (double value)
 set the value in progress mode (activate calling setRange() or setProgress() ) More...
 

Signals

void canceled ()
 emitted when the "Cancel" button is clicked More...
 

Public Member Functions

 JKQTEModernProgressDialog (const QString &labelText, const QString &cancelButtonText, QWidget *parent=NULL, Qt::WindowFlags f=Qt::Window|Qt::WindowTitleHint)
 
 JKQTEModernProgressDialog (QWidget *parent=NULL, Qt::WindowFlags f=0)
 
virtual ~JKQTEModernProgressDialog ()
 
void addLongTextLine (const QString &t)
 add a line of text to the dialog More...
 
QPushButton * cancelButton ()
 returns the cancel button widget More...
 
const QPushButton * cancelButton () const
 returns the cancel button widget More...
 
QString cancelButtonText () const
 text on the "Cancel" button of the dialog More...
 
QString labelText () const
 text in the label of the dialog More...
 
QTextEdit * longTextWidth ()
 returns the long text lines widget More...
 
const QTextEdit * longTextWidth () const
 returns the long text lines widget More...
 
double maximum () const
 returns the current progress range maximum More...
 
double minimum () const
 returns the current progress range minimum More...
 
void openDelayed (int minimumDuration=2500)
 display the progress dialog after a delay of minimumDuration milliseconds More...
 
JKQTEModernProgressWidgetprogressWidget ()
 returns the progress widget More...
 
const JKQTEModernProgressWidgetprogressWidget () const
 returns the progress widget More...
 
void setMode (bool enabledSpin, JKQTEModernProgressWidget::TextDisplayMode mode)
 en-/disable spin and progress mode More...
 
bool spin () const
 returns whether the indicator spins More...
 
QLabel * textLabel ()
 returns the text label widget More...
 
const QLabel * textLabel () const
 returns the text label widget More...
 
double value () const
 returns the current progress value More...
 
bool wasCanceled ()
 returns true if the "Cancel" button has been clicked More...
 

Protected Slots

void cancelClicked ()
 

Protected Member Functions

virtual void closeEvent (QCloseEvent *e)
 
void createWidgets ()
 
virtual void showEvent (QShowEvent *event)
 

Private Attributes

QPushButton * cancel
 
QLabel * label
 
QTextEdit * longmessage
 
bool m_closedBeforeDelay
 
int m_minimumDuration
 
bool m_wasCancel
 
JKQTEModernProgressWidgetprogress
 
QTimer timerDelay
 

Detailed Description

dialog, using JKQTEModernProgressWidget

Use open() and hide() to show/hide the dialog and openDelayed() if you wsnt the dialog to appear a given time after you called the function.

The dialog is displayed at the screen center if setCentered() is set true.

Usage example:

dialog.setWindowTitle(tr("Example of JKQTEModernProgressDialog"));
// choose a mode
dialog.progressWidget()->setMode(JKQTEModernProgressWidget::Mode::Strokes);
// set the range (these may be any doubles)
dialog.setRange(0,100);
// set the display mode of the text in the center of the widget (here: OFF)
// set progress
dialog.setValue(50);
// enable spinning of the progress indicator
dialog.progressWidget()->setSpin(true);
// enable cancel button
dialog.setHasCancel(true);
// ... and connect it to the slot that closes the dialog
connect(&dialog, &JKQTEModernProgressDialog::canceled, &dialog, &JKQTEModernProgressDialog::close);
// set text on the dialog#s main label
dialog.setLabelText(tr("label text"));
// add additional text lines
dialog.addLongTextLine(tr("long text line 1"));
dialog.addLongTextLine(tr("long text line 2"));
// display the dialog
dialog.exec();

Constructor & Destructor Documentation

◆ JKQTEModernProgressDialog() [1/2]

JKQTEModernProgressDialog::JKQTEModernProgressDialog ( QWidget *  parent = NULL,
Qt::WindowFlags  f = 0 
)

◆ JKQTEModernProgressDialog() [2/2]

JKQTEModernProgressDialog::JKQTEModernProgressDialog ( const QString &  labelText,
const QString &  cancelButtonText,
QWidget *  parent = NULL,
Qt::WindowFlags  f = Qt::Window|Qt::WindowTitleHint 
)

◆ ~JKQTEModernProgressDialog()

virtual JKQTEModernProgressDialog::~JKQTEModernProgressDialog ( )
virtual

Member Function Documentation

◆ addLongTextLine()

void JKQTEModernProgressDialog::addLongTextLine ( const QString &  t)

add a line of text to the dialog

◆ cancelButton() [1/2]

QPushButton* JKQTEModernProgressDialog::cancelButton ( )

returns the cancel button widget

◆ cancelButton() [2/2]

const QPushButton* JKQTEModernProgressDialog::cancelButton ( ) const

returns the cancel button widget

◆ cancelButtonText()

QString JKQTEModernProgressDialog::cancelButtonText ( ) const

text on the "Cancel" button of the dialog

◆ cancelClicked

void JKQTEModernProgressDialog::cancelClicked ( )
protectedslot

◆ canceled

void JKQTEModernProgressDialog::canceled ( )
signal

emitted when the "Cancel" button is clicked

◆ closeEvent()

virtual void JKQTEModernProgressDialog::closeEvent ( QCloseEvent *  e)
protectedvirtual

◆ createWidgets()

void JKQTEModernProgressDialog::createWidgets ( )
protected

◆ labelText()

QString JKQTEModernProgressDialog::labelText ( ) const

text in the label of the dialog

◆ longTextWidth() [1/2]

QTextEdit* JKQTEModernProgressDialog::longTextWidth ( )

returns the long text lines widget

◆ longTextWidth() [2/2]

const QTextEdit* JKQTEModernProgressDialog::longTextWidth ( ) const

returns the long text lines widget

◆ maximum()

double JKQTEModernProgressDialog::maximum ( ) const

returns the current progress range maximum

◆ minimum()

double JKQTEModernProgressDialog::minimum ( ) const

returns the current progress range minimum

◆ openDelayed()

void JKQTEModernProgressDialog::openDelayed ( int  minimumDuration = 2500)

display the progress dialog after a delay of minimumDuration milliseconds

If the dialog has beend closed before the delay runs out, it is never displayed.

◆ progressWidget() [1/2]

JKQTEModernProgressWidget* JKQTEModernProgressDialog::progressWidget ( )

returns the progress widget

◆ progressWidget() [2/2]

const JKQTEModernProgressWidget* JKQTEModernProgressDialog::progressWidget ( ) const

returns the progress widget

◆ setCancelButtonText

void JKQTEModernProgressDialog::setCancelButtonText ( const QString &  t)
slot

text on the "Cancel" button of the dialog

◆ setHasCancel

void JKQTEModernProgressDialog::setHasCancel ( bool  has = true)
slot

indicate whetehr the dialog has a Cancel button (default: true )

◆ setLabelText

void JKQTEModernProgressDialog::setLabelText ( const QString &  t)
slot

text in the label of the dialog

◆ setMaximum

void JKQTEModernProgressDialog::setMaximum ( double  max)
slot

set the progress range

◆ setMinimum

void JKQTEModernProgressDialog::setMinimum ( double  min)
slot

set the progress range

◆ setMode()

void JKQTEModernProgressDialog::setMode ( bool  enabledSpin,
JKQTEModernProgressWidget::TextDisplayMode  mode 
)

en-/disable spin and progress mode

set mode of the widget and en/-diable the spin

◆ setRange

void JKQTEModernProgressDialog::setRange ( double  min,
double  max 
)
slot

set the progress range

◆ setValue

void JKQTEModernProgressDialog::setValue ( double  value)
slot

set the value in progress mode (activate calling setRange() or setProgress() )

◆ showEvent()

virtual void JKQTEModernProgressDialog::showEvent ( QShowEvent *  event)
protectedvirtual

◆ spin()

bool JKQTEModernProgressDialog::spin ( ) const

returns whether the indicator spins

◆ textLabel() [1/2]

QLabel* JKQTEModernProgressDialog::textLabel ( )

returns the text label widget

◆ textLabel() [2/2]

const QLabel* JKQTEModernProgressDialog::textLabel ( ) const

returns the text label widget

◆ value()

double JKQTEModernProgressDialog::value ( ) const

returns the current progress value

◆ wasCanceled()

bool JKQTEModernProgressDialog::wasCanceled ( )

returns true if the "Cancel" button has been clicked

Member Data Documentation

◆ cancel

QPushButton* JKQTEModernProgressDialog::cancel
private

◆ label

QLabel* JKQTEModernProgressDialog::label
private

◆ longmessage

QTextEdit* JKQTEModernProgressDialog::longmessage
private

◆ m_closedBeforeDelay

bool JKQTEModernProgressDialog::m_closedBeforeDelay
private

◆ m_minimumDuration

int JKQTEModernProgressDialog::m_minimumDuration
private

◆ m_wasCancel

bool JKQTEModernProgressDialog::m_wasCancel
private

◆ progress

JKQTEModernProgressWidget* JKQTEModernProgressDialog::progress
private

◆ timerDelay

QTimer JKQTEModernProgressDialog::timerDelay
private

The documentation for this class was generated from the following file:
JKQTEModernProgressDialog::setRange
void setRange(double min, double max)
set the progress range
JKQTEModernProgressWidget::PercentText
@ PercentText
Definition: jkqtemodernprogress.h:96
JKQTEModernProgressDialog::setValue
void setValue(double value)
set the value in progress mode (activate calling setRange() or setProgress() )
JKQTEModernProgressDialog::progressWidget
const JKQTEModernProgressWidget * progressWidget() const
returns the progress widget
JKQTEModernProgressDialog::addLongTextLine
void addLongTextLine(const QString &t)
add a line of text to the dialog
JKQTEModernProgressDialog
dialog, using JKQTEModernProgressWidget
Definition: jkqtemodernprogress.h:273
JKQTEModernProgressDialog::setLabelText
void setLabelText(const QString &t)
text in the label of the dialog
JKQTEModernProgressDialog::setHasCancel
void setHasCancel(bool has=true)
indicate whetehr the dialog has a Cancel button (default: true )
JKQTEModernProgressDialog::canceled
void canceled()
emitted when the "Cancel" button is clicked
JKQTEModernProgressWidget::setSpin
void setSpin(bool enabled)
is an automatic spin going on?
JKQTEModernProgressWidget::setTextDisplayMode
void setTextDisplayMode(TextDisplayMode m)
type of text display mode
JKQTEModernProgressWidget::setMode
void setMode(Mode m)
type of widget: display a ring of strokes or circles, ...)