Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:09:37

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QPROGRESSDIALOG_H
0005 #define QPROGRESSDIALOG_H
0006 
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 
0009 #include <QtWidgets/qdialog.h>
0010 
0011 QT_REQUIRE_CONFIG(progressdialog);
0012 
0013 QT_BEGIN_NAMESPACE
0014 
0015 class QPushButton;
0016 class QLabel;
0017 class QProgressBar;
0018 class QTimer;
0019 class QProgressDialogPrivate;
0020 
0021 class Q_WIDGETS_EXPORT QProgressDialog : public QDialog
0022 {
0023     Q_OBJECT
0024     Q_DECLARE_PRIVATE(QProgressDialog)
0025     Q_PROPERTY(bool wasCanceled READ wasCanceled)
0026     Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
0027     Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
0028     Q_PROPERTY(int value READ value WRITE setValue)
0029     Q_PROPERTY(bool autoReset READ autoReset WRITE setAutoReset)
0030     Q_PROPERTY(bool autoClose READ autoClose WRITE setAutoClose)
0031     Q_PROPERTY(int minimumDuration READ minimumDuration WRITE setMinimumDuration)
0032     Q_PROPERTY(QString labelText READ labelText WRITE setLabelText)
0033 
0034 public:
0035     explicit QProgressDialog(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
0036     QProgressDialog(const QString &labelText, const QString &cancelButtonText,
0037                     int minimum, int maximum, QWidget *parent = nullptr,
0038                     Qt::WindowFlags flags = Qt::WindowFlags());
0039     ~QProgressDialog();
0040 
0041     void setLabel(QLabel *label);
0042     void setCancelButton(QPushButton *button);
0043     void setBar(QProgressBar *bar);
0044 
0045     bool wasCanceled() const;
0046 
0047     int minimum() const;
0048     int maximum() const;
0049 
0050     int value() const;
0051 
0052     QSize sizeHint() const override;
0053 
0054     QString labelText() const;
0055     int minimumDuration() const;
0056 
0057     void setAutoReset(bool reset);
0058     bool autoReset() const;
0059     void setAutoClose(bool close);
0060     bool autoClose() const;
0061 
0062     using QDialog::open;
0063     void open(QObject *receiver, const char *member);
0064 
0065 public Q_SLOTS:
0066     void cancel();
0067     void reset();
0068     void setMaximum(int maximum);
0069     void setMinimum(int minimum);
0070     void setRange(int minimum, int maximum);
0071     void setValue(int progress);
0072     void setLabelText(const QString &text);
0073     void setCancelButtonText(const QString &text);
0074     void setMinimumDuration(int ms);
0075 
0076 Q_SIGNALS:
0077     void canceled();
0078 
0079 protected:
0080     void resizeEvent(QResizeEvent *event) override;
0081     void closeEvent(QCloseEvent *event) override;
0082     void changeEvent(QEvent *event) override;
0083     void showEvent(QShowEvent *event) override;
0084 
0085 protected Q_SLOTS:
0086     void forceShow();
0087 
0088 private:
0089     Q_DISABLE_COPY(QProgressDialog)
0090 
0091     Q_PRIVATE_SLOT(d_func(), void _q_disconnectOnClose())
0092 };
0093 
0094 QT_END_NAMESPACE
0095 
0096 #endif // QPROGRESSDIALOG_H