diff options
Diffstat (limited to 'src/gui/kernel/qplatformdialoghelper.h')
-rw-r--r-- | src/gui/kernel/qplatformdialoghelper.h | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h index 43d3dfe358..0569a7e2f9 100644 --- a/src/gui/kernel/qplatformdialoghelper.h +++ b/src/gui/kernel/qplatformdialoghelper.h @@ -157,7 +157,8 @@ public: enum ColorDialogOption { ShowAlphaChannel = 0x00000001, NoButtons = 0x00000002, - DontUseNativeDialog = 0x00000004 + DontUseNativeDialog = 0x00000004, + NoEyeDropperButton = 0x00000008 }; Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption) @@ -403,6 +404,13 @@ protected: ~QMessageDialogOptions(); public: + // Keep in sync with QMessageBox Option + enum class Option { + DontUseNativeDialog = 0x00000001, + }; + Q_DECLARE_FLAGS(Options, Option); + Q_FLAG(Options); + // Keep in sync with QMessageBox::Icon enum StandardIcon { NoIcon, Information, Warning, Critical, Question }; Q_ENUM(StandardIcon) @@ -428,6 +436,11 @@ public: void setDetailedText(const QString &text); QString detailedText() const; + void setOption(Option option, bool on = true); + bool testOption(Option option) const; + void setOptions(Options options); + Options options() const; + void setStandardButtons(QPlatformDialogHelper::StandardButtons buttons); QPlatformDialogHelper::StandardButtons standardButtons() const; @@ -446,13 +459,21 @@ public: }; int addButton(const QString &label, QPlatformDialogHelper::ButtonRole role, - void *buttonImpl = nullptr); + void *buttonImpl = nullptr, int buttonId = 0); void removeButton(int id); const QList<CustomButton> &customButtons(); const CustomButton *customButton(int id); + void clearCustomButtons(); + + void setCheckBox(const QString &label, Qt::CheckState state); + QString checkBoxLabel() const; + Qt::CheckState checkBoxState() const; + + void setEscapeButton(int id); + int escapeButton() const; - void setSupressionCheckBoxEnabled(bool enabled); - bool supressionCheckBoxEnabled() const; + void setDefaultButton(int id); + int defaultButton() const; private: QMessageDialogOptionsPrivate *d; @@ -467,7 +488,7 @@ public: Q_SIGNALS: void clicked(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role); - void supressionCheckBoxChanged(bool checked); + void checkBoxStateChanged(Qt::CheckState state); private: QSharedPointer<QMessageDialogOptions> m_options; |