diff options
author | Christian Heimlich <chris@pcserenity.com> | 2020-10-07 04:07:36 -0400 |
---|---|---|
committer | Christian Heimlich <chris@pcserenity.com> | 2020-10-07 07:03:27 -0400 |
commit | dc193277513d72c00fdee015bb75d5b8c844a785 (patch) | |
tree | 215ab8dbab2f11b6782380dc2e4476558f7b91b9 /src/widgets/dialogs | |
parent | 0efe79f80d6f249040f47162ebbfc82289ca073d (diff) |
Member initialization and default constructor for QProgressDialogPrivate
Change QProgressDialogPrivate to use default member initializers,
allowing its constructor to be explicitly defaulted since it was only
used for its member initializer list. Reduces #ifdefery.
Change-Id: Id3885e6d520cde47de96f3b475f6a6bba1ed001f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r-- | src/widgets/dialogs/qprogressdialog.cpp | 44 |
1 files changed, 15 insertions, 29 deletions
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp index d0645a4e8a..645ca1013a 100644 --- a/src/widgets/dialogs/qprogressdialog.cpp +++ b/src/widgets/dialogs/qprogressdialog.cpp @@ -68,21 +68,7 @@ class QProgressDialogPrivate : public QDialogPrivate Q_DECLARE_PUBLIC(QProgressDialog) public: - QProgressDialogPrivate() : label(nullptr), cancel(nullptr), bar(nullptr), - #ifndef QT_NO_SHORTCUT - escapeShortcut(nullptr), - #endif - showTime(defaultShowTime), - processingEvents(false), - shownOnce(false), - autoClose(true), - autoReset(true), - forceHide(false), - cancellationFlag(false), - setValueCalled(false), - useDefaultCancelText(false) - { - } + QProgressDialogPrivate() = default; void init(const QString &labelText, const QString &cancelText, int min, int max); void layout(); @@ -92,25 +78,25 @@ public: void ensureSizeIsAtLeastSizeHint(); void _q_disconnectOnClose(); - QLabel *label; - QPushButton *cancel; - QProgressBar *bar; - QTimer *forceTimer; + QLabel *label = nullptr; + QPushButton *cancel = nullptr; + QProgressBar *bar = nullptr; + QTimer *forceTimer = nullptr; #ifndef QT_NO_SHORTCUT - QShortcut *escapeShortcut; + QShortcut *escapeShortcut = nullptr; #endif QPointer<QObject> receiverToDisconnectOnClose; QElapsedTimer starttime; QByteArray memberToDisconnectOnClose; - int showTime; - bool processingEvents; - bool shownOnce; - bool autoClose; - bool autoReset; - bool forceHide; - bool cancellationFlag; - bool setValueCalled; - bool useDefaultCancelText; + int showTime = defaultShowTime; + bool processingEvents = false; + bool shownOnce = false; + bool autoClose = true; + bool autoReset = true; + bool forceHide = false; + bool cancellationFlag = false; + bool setValueCalled = false; + bool useDefaultCancelText = false; }; void QProgressDialogPrivate::init(const QString &labelText, const QString &cancelText, |