diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-12-02 23:17:57 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-12-09 19:00:03 +0000 |
commit | b8922c35ba9090b0d030baca4f38c5f468440098 (patch) | |
tree | 265ec3dbca905c3dfd4ee7c17d0e0f815966d2b5 /src/gui/kernel | |
parent | e8c7f77854c23b962cae1018feccc8842c92b954 (diff) |
Register QPA Menu, Dialog & SysTray enums & flags
This allows QML Menu, Dialog & SystemTrayIcon to use the same enums
without having to duplicate them.
Change-Id: I1401583d3ae2ef07cdc795d2765fba07c9b30f2f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qplatformdialoghelper.h | 17 | ||||
-rw-r--r-- | src/gui/kernel/qplatformmenu.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qplatformsystemtrayicon.h | 2 |
3 files changed, 21 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h index 936dbdfa89..5b2f4ece77 100644 --- a/src/gui/kernel/qplatformdialoghelper.h +++ b/src/gui/kernel/qplatformdialoghelper.h @@ -104,6 +104,7 @@ public: }; Q_DECLARE_FLAGS(StandardButtons, StandardButton) + Q_FLAG(StandardButtons) enum ButtonRole { // keep this in sync with QDialogButtonBox::ButtonRole and QMessageBox::ButtonRole @@ -128,6 +129,7 @@ public: Reverse = 0x40000000, EOL = InvalidRole }; + Q_ENUM(ButtonRole) enum ButtonLayout { // keep this in sync with QDialogButtonBox::ButtonLayout and QMessageBox::ButtonLayout @@ -167,6 +169,7 @@ QT_BEGIN_NAMESPACE class Q_GUI_EXPORT QColorDialogOptions { + Q_GADGET public: enum ColorDialogOption { ShowAlphaChannel = 0x00000001, @@ -175,6 +178,7 @@ public: }; Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption) + Q_FLAG(ColorDialogOptions) QColorDialogOptions(); QColorDialogOptions(const QColorDialogOptions &rhs); @@ -226,6 +230,7 @@ private: class Q_GUI_EXPORT QFontDialogOptions { + Q_GADGET public: enum FontDialogOption { NoButtons = 0x00000001, @@ -237,6 +242,7 @@ public: }; Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption) + Q_FLAG(FontDialogOptions) QFontDialogOptions(); QFontDialogOptions(const QFontDialogOptions &rhs); @@ -279,11 +285,19 @@ private: class Q_GUI_EXPORT QFileDialogOptions { + Q_GADGET public: enum ViewMode { Detail, List }; + Q_ENUM(ViewMode) + enum FileMode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly }; + Q_ENUM(FileMode) + enum AcceptMode { AcceptOpen, AcceptSave }; + Q_ENUM(AcceptMode) + enum DialogLabel { LookIn, FileName, FileType, Accept, Reject, DialogLabelCount }; + Q_ENUM(DialogLabel) enum FileDialogOption { @@ -297,6 +311,7 @@ public: DontUseCustomDirectoryIcons = 0x00000080 }; Q_DECLARE_FLAGS(FileDialogOptions, FileDialogOption) + Q_FLAG(FileDialogOptions) QFileDialogOptions(); QFileDialogOptions(const QFileDialogOptions &rhs); @@ -396,9 +411,11 @@ private: class Q_GUI_EXPORT QMessageDialogOptions { + Q_GADGET public: // Keep in sync with QMessageBox::Icon enum Icon { NoIcon, Information, Warning, Critical, Question }; + Q_ENUM(Icon) QMessageDialogOptions(); QMessageDialogOptions(const QMessageDialogOptions &rhs); diff --git a/src/gui/kernel/qplatformmenu.h b/src/gui/kernel/qplatformmenu.h index 1022d0ed4a..bc0b3a4870 100644 --- a/src/gui/kernel/qplatformmenu.h +++ b/src/gui/kernel/qplatformmenu.h @@ -63,6 +63,7 @@ public: // They could be added as public QAction roles if necessary. CutRole, CopyRole, PasteRole, SelectAllRole, RoleCount }; + Q_ENUM(MenuRole) virtual void setTag(quintptr tag) = 0; virtual quintptr tag()const = 0; @@ -91,6 +92,7 @@ class Q_GUI_EXPORT QPlatformMenu : public QObject Q_OBJECT public: enum MenuType { DefaultMenu = 0, EditMenu }; + Q_ENUM(MenuType) virtual void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) = 0; virtual void removeMenuItem(QPlatformMenuItem *menuItem) = 0; diff --git a/src/gui/kernel/qplatformsystemtrayicon.h b/src/gui/kernel/qplatformsystemtrayicon.h index 437f5e02b1..6ef2d1538f 100644 --- a/src/gui/kernel/qplatformsystemtrayicon.h +++ b/src/gui/kernel/qplatformsystemtrayicon.h @@ -57,8 +57,10 @@ public: Trigger, MiddleClick }; + Q_ENUM(ActivationReason) enum MessageIcon { NoIcon, Information, Warning, Critical }; + Q_ENUM(MessageIcon) QPlatformSystemTrayIcon(); ~QPlatformSystemTrayIcon(); |