Qt 4.8
qprogressdialog.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qprogressdialog.h"
43 
44 #ifndef QT_NO_PROGRESSDIALOG
45 
46 #include "qshortcut.h"
47 #include "qpainter.h"
48 #include "qdrawutil.h"
49 #include "qlabel.h"
50 #include "qprogressbar.h"
51 #include "qapplication.h"
52 #include "qstyle.h"
53 #include "qpushbutton.h"
54 #include "qcursor.h"
55 #include "qtimer.h"
56 #include "qelapsedtimer.h"
57 #include <private/qdialog_p.h>
58 #include <limits.h>
59 
60 #if defined(QT_SOFTKEYS_ENABLED)
61 #include <qaction.h>
62 #endif
63 #ifdef Q_WS_S60
64 #include <QtGui/qdesktopwidget.h>
65 #endif
66 
67 
69 
70 // If the operation is expected to take this long (as predicted by
71 // progress time), show the progress dialog.
72 static const int defaultShowTime = 4000;
73 // Wait at least this long before attempting to make a prediction.
74 static const int minWaitTime = 50;
75 
77 {
79 
80 public:
82  shown_once(false),
83  cancellation_flag(false),
85 #ifndef QT_NO_SHORTCUT
86  escapeShortcut(0),
87 #endif
88 #ifdef QT_SOFTKEYS_ENABLED
89  cancelAction(0),
90 #endif
92  {
93  }
94 
95  void init(const QString &labelText, const QString &cancelText, int min, int max);
96  void layout();
97  void retranslateStrings();
98  void _q_disconnectOnClose();
99 
107 #ifndef QT_NO_CURSOR
109 #endif
110  int showTime;
111  bool autoClose;
112  bool autoReset;
113  bool forceHide;
114 #ifndef QT_NO_SHORTCUT
116 #endif
117 #ifdef QT_SOFTKEYS_ENABLED
118  QAction *cancelAction;
119 #endif
123 };
124 
125 void QProgressDialogPrivate::init(const QString &labelText, const QString &cancelText,
126  int min, int max)
127 {
129  label = new QLabel(labelText, q);
130  int align = q->style()->styleHint(QStyle::SH_ProgressDialog_TextLabelAlignment, 0, q);
131  label->setAlignment(Qt::Alignment(align));
132  bar = new QProgressBar(q);
133  bar->setRange(min, max);
134  autoClose = true;
135  autoReset = true;
136  forceHide = false;
137  QObject::connect(q, SIGNAL(canceled()), q, SLOT(cancel()));
138  forceTimer = new QTimer(q);
139  QObject::connect(forceTimer, SIGNAL(timeout()), q, SLOT(forceShow()));
140  if (useDefaultCancelText) {
142  } else {
143  q->setCancelButtonText(cancelText);
144  }
145 }
146 
148 {
150  int sp = q->style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing);
151  int mtb = q->style()->pixelMetric(QStyle::PM_DefaultTopLevelMargin);
152  int mlr = qMin(q->width() / 10, mtb);
153  const bool centered =
154  bool(q->style()->styleHint(QStyle::SH_ProgressDialog_CenterCancelButton, 0, q));
155 
156  int additionalSpacing = 0;
157 #ifdef Q_OS_SYMBIAN
158  //In Symbian, we need to have wider margins for dialog borders, as the actual border is some pixels
159  //inside the dialog area (to enable transparent borders)
160  additionalSpacing = mlr;
161 #endif
162 
163  QSize cs = cancel ? cancel->sizeHint() : QSize(0,0);
164  QSize bh = bar->sizeHint();
165  int cspc;
166  int lh = 0;
167 
168  // Find spacing and sizes that fit. It is important that a progress
169  // dialog can be made very small if the user demands it so.
170  for (int attempt=5; attempt--;) {
171  cspc = cancel ? cs.height() + sp : 0;
172  lh = qMax(0, q->height() - mtb - bh.height() - sp - cspc);
173 
174  if (lh < q->height()/4) {
175  // Getting cramped
176  sp /= 2;
177  mtb /= 2;
178  if (cancel) {
179  cs.setHeight(qMax(4,cs.height()-sp-2));
180  }
181  bh.setHeight(qMax(4,bh.height()-sp-1));
182  } else {
183  break;
184  }
185  }
186 
187  if (cancel) {
189  centered ? q->width()/2 - cs.width()/2 : q->width() - mlr - cs.width(),
190  q->height() - mtb - cs.height(),
191  cs.width(), cs.height());
192  }
193 
194  if (label)
195  label->setGeometry(mlr, additionalSpacing, q->width() - mlr * 2, lh);
196  bar->setGeometry(mlr, lh + sp + additionalSpacing, q->width() - mlr * 2, bh.height());
197 }
198 
200 {
203  q->setCancelButtonText(QProgressDialog::tr("Cancel"));
204 }
205 
207 {
213  }
215 }
216 
309  : QDialog(*(new QProgressDialogPrivate), parent, f)
310 {
312  d->useDefaultCancelText = true;
313  d->init(QString::fromLatin1(""), QString(), 0, 100);
314 }
315 
339  const QString &cancelButtonText,
340  int minimum, int maximum,
341  QWidget *parent, Qt::WindowFlags f)
342  : QDialog(*(new QProgressDialogPrivate), parent, f)
343 {
345  d->init(labelText, cancelButtonText, minimum, maximum);
346 }
347 
348 
354 {
355 }
356 
379 {
381  delete d->label;
382  d->label = label;
383  if (label) {
384  if (label->parentWidget() == this) {
385  label->hide(); // until we resize
386  } else {
387  label->setParent(this, 0);
388  }
389  }
390  int w = qMax(isVisible() ? width() : 0, sizeHint().width());
391  int h = qMax(isVisible() ? height() : 0, sizeHint().height());
392  resize(w, h);
393  if (label)
394  label->show();
395 }
396 
397 
409 {
410  Q_D(const QProgressDialog);
411  if (d->label)
412  return d->label->text();
413  return QString();
414 }
415 
417 {
419  if (d->label) {
420  d->label->setText(text);
421  int w = qMax(isVisible() ? width() : 0, sizeHint().width());
422  int h = qMax(isVisible() ? height() : 0, sizeHint().height());
423  resize(w, h);
424  }
425 }
426 
427 
439 {
441  delete d->cancel;
442  d->cancel = cancelButton;
443  if (cancelButton) {
444  if (cancelButton->parentWidget() == this) {
445  cancelButton->hide(); // until we resize
446  } else {
447  cancelButton->setParent(this, 0);
448  }
449  connect(d->cancel, SIGNAL(clicked()), this, SIGNAL(canceled()));
450 #ifndef QT_NO_SHORTCUT
451  d->escapeShortcut = new QShortcut(Qt::Key_Escape, this, SIGNAL(canceled()));
452 #endif
453  } else {
454 #ifndef QT_NO_SHORTCUT
455  delete d->escapeShortcut;
456  d->escapeShortcut = 0;
457 #endif
458  }
459  int w = qMax(isVisible() ? width() : 0, sizeHint().width());
460  int h = qMax(isVisible() ? height() : 0, sizeHint().height());
461  resize(w, h);
462  if (cancelButton)
463 #if !defined(QT_SOFTKEYS_ENABLED)
464  cancelButton->show();
465 #else
466  {
467  d->cancelAction = new QAction(cancelButton->text(), cancelButton);
468  d->cancelAction->setSoftKeyRole(QAction::NegativeSoftKey);
469  connect(d->cancelAction, SIGNAL(triggered()), this, SIGNAL(canceled()));
470  addAction(d->cancelAction);
471  }
472 #endif
473 }
474 
483 void QProgressDialog::setCancelButtonText(const QString &cancelButtonText)
484 {
486  d->useDefaultCancelText = false;
487 
488  if (!cancelButtonText.isNull()) {
489  if (d->cancel) {
490  d->cancel->setText(cancelButtonText);
491 #ifdef QT_SOFTKEYS_ENABLED
492  d->cancelAction->setText(cancelButtonText);
493 #endif
494  } else {
495  setCancelButton(new QPushButton(cancelButtonText, this));
496  }
497  } else {
498  setCancelButton(0);
499  }
500  int w = qMax(isVisible() ? width() : 0, sizeHint().width());
501  int h = qMax(isVisible() ? height() : 0, sizeHint().height());
502  resize(w, h);
503 }
504 
505 
514 {
516  if (!bar) {
517  qWarning("QProgressDialog::setBar: Cannot set a null progress bar");
518  return;
519  }
520 #ifndef QT_NO_DEBUG
521  if (value() > 0)
522  qWarning("QProgressDialog::setBar: Cannot set a new progress bar "
523  "while the old one is active");
524 #endif
525  delete d->bar;
526  d->bar = bar;
527  int w = qMax(isVisible() ? width() : 0, sizeHint().width());
528  int h = qMax(isVisible() ? height() : 0, sizeHint().height());
529  resize(w, h);
530 }
531 
532 
541 bool QProgressDialog::wasCanceled() const
542 {
543  Q_D(const QProgressDialog);
544  return d->cancellation_flag;
545 }
546 
547 
560 int QProgressDialog::maximum() const
561 {
562  Q_D(const QProgressDialog);
563  return d->bar->maximum();
564 }
565 
567 {
569  d->bar->setMaximum(maximum);
570 }
571 
584 int QProgressDialog::minimum() const
585 {
586  Q_D(const QProgressDialog);
587  return d->bar->minimum();
588 }
589 
591 {
593  d->bar->setMinimum(minimum);
594 }
595 
609 {
611  d->bar->setRange(minimum, maximum);
612 }
613 
614 
623 {
625 #ifndef QT_NO_CURSOR
626  if (value() >= 0) {
627  if (parentWidget())
628  parentWidget()->setCursor(d->parentCursor);
629  }
630 #endif
631  if (d->autoClose || d->forceHide)
632  hide();
633  d->bar->reset();
634  d->cancellation_flag = false;
635  d->shown_once = false;
636  d->forceTimer->stop();
637 
638  /*
639  I wish we could disconnect the user slot provided to open() here but
640  unfortunately reset() is usually called before the slot has been invoked.
641  (reset() is itself invoked when canceled() is emitted.)
642  */
643  if (d->receiverToDisconnectOnClose)
644  QMetaObject::invokeMethod(this, "_q_disconnectOnClose", Qt::QueuedConnection);
645 }
646 
654 {
656  d->forceHide = true;
657  reset();
658  d->forceHide = false;
659  d->cancellation_flag = true;
660 }
661 
662 
663 int QProgressDialog::value() const
664 {
665  Q_D(const QProgressDialog);
666  return d->bar->value();
667 }
668 
689 void QProgressDialog::setValue(int progress)
690 {
692  if (progress == d->bar->value()
693  || (d->bar->value() == -1 && progress == d->bar->maximum()))
694  return;
695 
696  d->bar->setValue(progress);
697 
698  if (d->shown_once) {
699  if (isModal())
701  } else {
702  if (progress == 0) {
703  d->starttime.start();
704  d->forceTimer->start(d->showTime);
705  return;
706  } else {
707  bool need_show;
708  int elapsed = d->starttime.elapsed();
709  if (elapsed >= d->showTime) {
710  need_show = true;
711  } else {
712  if (elapsed > minWaitTime) {
713  int estimate;
714  int totalSteps = maximum() - minimum();
715  int myprogress = progress - minimum();
716  if (myprogress == 0) myprogress = 1;
717  if ((totalSteps - myprogress) >= INT_MAX / elapsed)
718  estimate = (totalSteps - myprogress) / myprogress * elapsed;
719  else
720  estimate = elapsed * (totalSteps - myprogress) / myprogress;
721  need_show = estimate >= d->showTime;
722  } else {
723  need_show = false;
724  }
725  }
726  if (need_show) {
727  int w = qMax(isVisible() ? width() : 0, sizeHint().width());
728  int h = qMax(isVisible() ? height() : 0, sizeHint().height());
729  resize(w, h);
730  show();
731  d->shown_once = true;
732  }
733  }
734 #ifdef Q_WS_MAC
736 #endif
737  }
738 
739  if (progress == d->bar->maximum() && d->autoReset)
740  reset();
741 }
742 
750 {
751  Q_D(const QProgressDialog);
752  QSize sh = d->label ? d->label->sizeHint() : QSize(0, 0);
753  QSize bh = d->bar->sizeHint();
756  int h = margin * 2 + bh.height() + sh.height() + spacing;
757  if (d->cancel)
758  h += d->cancel->sizeHint().height() + spacing;
759 #ifdef Q_WS_S60
761  return QSize(qMax(QApplication::desktop()->size().width(), sh.width() + 2 * margin), h);
762  else
763  return QSize(qMax(QApplication::desktop()->size().height(), sh.width() + 2 * margin), h);
764 #else
765  return QSize(qMax(200, sh.width() + 2 * margin), h);
766 #endif
767 }
768 
772 {
774  d->layout();
775 }
776 
781 {
783  if (ev->type() == QEvent::StyleChange) {
784  d->layout();
785  } else if (ev->type() == QEvent::LanguageChange) {
786  d->retranslateStrings();
787  }
789 }
790 
809 {
811  d->showTime = ms;
812  if (d->bar->value() == 0) {
813  d->forceTimer->stop();
814  d->forceTimer->start(ms);
815  }
816 }
817 
819 {
820  Q_D(const QProgressDialog);
821  return d->showTime;
822 }
823 
824 
830 {
831  emit canceled();
833 }
834 
848 {
850  d->autoReset = b;
851 }
852 
853 bool QProgressDialog::autoReset() const
854 {
855  Q_D(const QProgressDialog);
856  return d->autoReset;
857 }
858 
872 {
874  d->autoClose = close;
875 }
876 
877 bool QProgressDialog::autoClose() const
878 {
879  Q_D(const QProgressDialog);
880  return d->autoClose;
881 }
882 
888 {
891  int w = qMax(isVisible() ? width() : 0, sizeHint().width());
892  int h = qMax(isVisible() ? height() : 0, sizeHint().height());
893  resize(w, h);
894  d->forceTimer->stop();
895 }
896 
905 {
907  d->forceTimer->stop();
908  if (d->shown_once || d->cancellation_flag)
909  return;
910 
911  show();
912  d->shown_once = true;
913 }
914 
927 void QProgressDialog::open(QObject *receiver, const char *member)
928 {
930  connect(this, SIGNAL(canceled()), receiver, member);
931  d->receiverToDisconnectOnClose = receiver;
932  d->memberToDisconnectOnClose = member;
933  QDialog::open();
934 }
935 
937 
938 #include "moc_qprogressdialog.cpp"
939 
940 #endif // QT_NO_PROGRESSDIALOG
bool isModal() const
Definition: qwidget.h:951
double d
Definition: qnumeric_p.h:62
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
void setLabel(QLabel *label)
Sets the label to label.
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition: qcursor.h:89
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
static double elapsed(qint64 after, qint64 before)
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
QString text() const
void setParent(QWidget *parent)
Sets the parent of the widget to parent, and resets the window flags.
Definition: qwidget.cpp:10479
QSize size() const
~QProgressDialog()
Destroys the progress dialog.
static const int defaultShowTime
The QDialog class is the base class of dialog windows.
Definition: qdialog.h:56
void closeEvent(QCloseEvent *event)
Reimplemented Function
bool isVisible() const
Definition: qwidget.h:1005
int minimumDuration() const
QByteArray memberToDisconnectOnClose
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
void cancel()
Resets the progress dialog.
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void forceShow()
Shows the dialog if it is still hidden after the algorithm has been started and minimumDuration milli...
#define SLOT(a)
Definition: qobjectdefs.h:226
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QProgressDialog(QWidget *parent=0, Qt::WindowFlags flags=0)
Constructs a progress dialog.
The QPushButton widget provides a command button.
Definition: qpushbutton.h:57
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QSize sizeHint() const
Reimplemented Function
void reset()
Resets the progress dialog.
void changeEvent(QEvent *event)
Reimplemented Function
static const int minWaitTime
QSize sizeHint() const
Returns a size that fits the contents of the progress dialog.
void showEvent(QShowEvent *)
This event handler can be reimplemented in a subclass to receive widget show events which are passed ...
Definition: qdialog.cpp:838
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qwidget.h:1017
The QProgressBar widget provides a horizontal or vertical progress bar.
Definition: qprogressbar.h:58
The QString class provides a Unicode character string.
Definition: qstring.h:83
void setHeight(int h)
Sets the height to the given height.
Definition: qsize.h:135
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_D(Class)
Definition: qglobal.h:2482
int height() const
The QElapsedTimer class provides a fast way to calculate elapsed times.
Definition: qelapsedtimer.h:53
void addAction(QAction *action)
Appends the action action to this widget&#39;s list of actions.
Definition: qwidget.cpp:3317
void setAutoClose(bool close)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
static void processEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Processes all pending events for the calling thread according to the specified flags until there are ...
The QShortcut class is used to create keyboard shortcuts.
Definition: qshortcut.h:57
QStyle * style() const
Definition: qwidget.cpp:2742
#define Q_Q(Class)
Definition: qglobal.h:2483
#define SIGNAL(a)
Definition: qobjectdefs.h:227
int width() const
Returns the width.
Definition: qsize.h:126
void setValue(int progress)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
void closeEvent(QCloseEvent *)
Reimplemented Function
Definition: qdialog.cpp:733
int width() const
bool autoClose() const
#define emit
Definition: qobjectdefs.h:76
virtual void changeEvent(QEvent *)
This event handler can be reimplemented to handle state changes.
Definition: qwidget.cpp:9170
The QResizeEvent class contains event parameters for resize events.
Definition: qevent.h:349
Q_CORE_EXPORT void qWarning(const char *,...)
bool wasCanceled() const
QSize sizeHint() const
Reimplemented Function
void setCursor(const QCursor &)
Definition: qwidget.cpp:5290
void init(const QString &labelText, const QString &cancelText, int min, int max)
void setBar(QProgressBar *bar)
Sets the progress bar widget to bar.
void show()
Shows the widget and its child widgets.
The QShowEvent class provides an event that is sent when a widget is shown.
Definition: qevent.h:380
void hide()
Hides the widget.
Definition: qwidget.h:501
#define QT_NO_SHORTCUT
void setLabelText(const QString &text)
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
bool isNull() const
Returns true if this string is null; otherwise returns false.
Definition: qstring.h:505
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
Definition: qobject.cpp:2895
void setRange(int minimum, int maximum)
Sets the progress bar&#39;s minimum and maximum values to minimum and maximum respectively.
bool autoReset() const
#define Q_DECLARE_PUBLIC(Class)
Definition: qglobal.h:2477
void resize(int w, int h)
This corresponds to resize(QSize(w, h)).
Definition: qwidget.h:1014
QPointer< QObject > receiverToDisconnectOnClose
friend class QPushButton
Definition: qdialog.h:59
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
void setRange(int minimum, int maximum)
Sets the progress dialog&#39;s minimum and maximum values to minimum and maximum, respectively.
The QProgressDialog class provides feedback on the progress of a slow operation.
void setCancelButtonText(const QString &text)
Sets the cancel button&#39;s text to cancelButtonText.
QObject * parent() const
Returns a pointer to the parent object.
Definition: qobject.h:273
QString labelText() const
int height() const
Returns the height.
Definition: qsize.h:129
void resizeEvent(QResizeEvent *event)
Reimplemented Function
The QLabel widget provides a text or image display.
Definition: qlabel.h:55
int value() const
QObject * parent
Definition: qobject.h:92
void setAutoReset(bool reset)
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
Invokes the member (a signal or a slot name) on the object obj.
void setMaximum(int maximum)
void open()
Shows the dialog as a window modal dialog, returning immediately.
Definition: qdialog.cpp:492
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
bool close()
Closes this widget.
Definition: qwidget.cpp:8305
The QTimer class provides repetitive and single-shot timers.
Definition: qtimer.h:56
void showEvent(QShowEvent *event)
Reimplemented Function
void setMinimumDuration(int ms)
void setCancelButton(QPushButton *button)
Sets the cancel button to the push button, cancelButton.
int maximum() const
The QEvent class is the base class of all event classes.
Definition: qcoreevent.h:56
Type type() const
Returns the event type.
Definition: qcoreevent.h:303
void setAlignment(Qt::Alignment)
Without this function, a call to e.
Definition: qlabel.cpp:532
int minimum() const
#define INT_MAX
The QCloseEvent class contains parameters that describe a close event.
Definition: qevent.h:364
void canceled()
This signal is emitted when the cancel button is clicked.
void setMinimum(int minimum)
void clear()
Clears the contents of the byte array and makes it empty.
The QAction class provides an abstract user interface action that can be inserted into widgets...
Definition: qaction.h:64
static void flush()
Flushes the platform specific event queues.
#define text
Definition: qobjectdefs.h:80