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>
This commit is contained in:
parent
e8c7f77854
commit
b8922c35ba
@ -104,6 +104,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
|
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
|
||||||
|
Q_FLAG(StandardButtons)
|
||||||
|
|
||||||
enum ButtonRole {
|
enum ButtonRole {
|
||||||
// keep this in sync with QDialogButtonBox::ButtonRole and QMessageBox::ButtonRole
|
// keep this in sync with QDialogButtonBox::ButtonRole and QMessageBox::ButtonRole
|
||||||
@ -128,6 +129,7 @@ public:
|
|||||||
Reverse = 0x40000000,
|
Reverse = 0x40000000,
|
||||||
EOL = InvalidRole
|
EOL = InvalidRole
|
||||||
};
|
};
|
||||||
|
Q_ENUM(ButtonRole)
|
||||||
|
|
||||||
enum ButtonLayout {
|
enum ButtonLayout {
|
||||||
// keep this in sync with QDialogButtonBox::ButtonLayout and QMessageBox::ButtonLayout
|
// keep this in sync with QDialogButtonBox::ButtonLayout and QMessageBox::ButtonLayout
|
||||||
@ -167,6 +169,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class Q_GUI_EXPORT QColorDialogOptions
|
class Q_GUI_EXPORT QColorDialogOptions
|
||||||
{
|
{
|
||||||
|
Q_GADGET
|
||||||
public:
|
public:
|
||||||
enum ColorDialogOption {
|
enum ColorDialogOption {
|
||||||
ShowAlphaChannel = 0x00000001,
|
ShowAlphaChannel = 0x00000001,
|
||||||
@ -175,6 +178,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption)
|
Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption)
|
||||||
|
Q_FLAG(ColorDialogOptions)
|
||||||
|
|
||||||
QColorDialogOptions();
|
QColorDialogOptions();
|
||||||
QColorDialogOptions(const QColorDialogOptions &rhs);
|
QColorDialogOptions(const QColorDialogOptions &rhs);
|
||||||
@ -226,6 +230,7 @@ private:
|
|||||||
|
|
||||||
class Q_GUI_EXPORT QFontDialogOptions
|
class Q_GUI_EXPORT QFontDialogOptions
|
||||||
{
|
{
|
||||||
|
Q_GADGET
|
||||||
public:
|
public:
|
||||||
enum FontDialogOption {
|
enum FontDialogOption {
|
||||||
NoButtons = 0x00000001,
|
NoButtons = 0x00000001,
|
||||||
@ -237,6 +242,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption)
|
Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption)
|
||||||
|
Q_FLAG(FontDialogOptions)
|
||||||
|
|
||||||
QFontDialogOptions();
|
QFontDialogOptions();
|
||||||
QFontDialogOptions(const QFontDialogOptions &rhs);
|
QFontDialogOptions(const QFontDialogOptions &rhs);
|
||||||
@ -279,11 +285,19 @@ private:
|
|||||||
|
|
||||||
class Q_GUI_EXPORT QFileDialogOptions
|
class Q_GUI_EXPORT QFileDialogOptions
|
||||||
{
|
{
|
||||||
|
Q_GADGET
|
||||||
public:
|
public:
|
||||||
enum ViewMode { Detail, List };
|
enum ViewMode { Detail, List };
|
||||||
|
Q_ENUM(ViewMode)
|
||||||
|
|
||||||
enum FileMode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly };
|
enum FileMode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly };
|
||||||
|
Q_ENUM(FileMode)
|
||||||
|
|
||||||
enum AcceptMode { AcceptOpen, AcceptSave };
|
enum AcceptMode { AcceptOpen, AcceptSave };
|
||||||
|
Q_ENUM(AcceptMode)
|
||||||
|
|
||||||
enum DialogLabel { LookIn, FileName, FileType, Accept, Reject, DialogLabelCount };
|
enum DialogLabel { LookIn, FileName, FileType, Accept, Reject, DialogLabelCount };
|
||||||
|
Q_ENUM(DialogLabel)
|
||||||
|
|
||||||
enum FileDialogOption
|
enum FileDialogOption
|
||||||
{
|
{
|
||||||
@ -297,6 +311,7 @@ public:
|
|||||||
DontUseCustomDirectoryIcons = 0x00000080
|
DontUseCustomDirectoryIcons = 0x00000080
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(FileDialogOptions, FileDialogOption)
|
Q_DECLARE_FLAGS(FileDialogOptions, FileDialogOption)
|
||||||
|
Q_FLAG(FileDialogOptions)
|
||||||
|
|
||||||
QFileDialogOptions();
|
QFileDialogOptions();
|
||||||
QFileDialogOptions(const QFileDialogOptions &rhs);
|
QFileDialogOptions(const QFileDialogOptions &rhs);
|
||||||
@ -396,9 +411,11 @@ private:
|
|||||||
|
|
||||||
class Q_GUI_EXPORT QMessageDialogOptions
|
class Q_GUI_EXPORT QMessageDialogOptions
|
||||||
{
|
{
|
||||||
|
Q_GADGET
|
||||||
public:
|
public:
|
||||||
// Keep in sync with QMessageBox::Icon
|
// Keep in sync with QMessageBox::Icon
|
||||||
enum Icon { NoIcon, Information, Warning, Critical, Question };
|
enum Icon { NoIcon, Information, Warning, Critical, Question };
|
||||||
|
Q_ENUM(Icon)
|
||||||
|
|
||||||
QMessageDialogOptions();
|
QMessageDialogOptions();
|
||||||
QMessageDialogOptions(const QMessageDialogOptions &rhs);
|
QMessageDialogOptions(const QMessageDialogOptions &rhs);
|
||||||
|
@ -63,6 +63,7 @@ public:
|
|||||||
// They could be added as public QAction roles if necessary.
|
// They could be added as public QAction roles if necessary.
|
||||||
CutRole, CopyRole, PasteRole, SelectAllRole,
|
CutRole, CopyRole, PasteRole, SelectAllRole,
|
||||||
RoleCount };
|
RoleCount };
|
||||||
|
Q_ENUM(MenuRole)
|
||||||
|
|
||||||
virtual void setTag(quintptr tag) = 0;
|
virtual void setTag(quintptr tag) = 0;
|
||||||
virtual quintptr tag()const = 0;
|
virtual quintptr tag()const = 0;
|
||||||
@ -91,6 +92,7 @@ class Q_GUI_EXPORT QPlatformMenu : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
enum MenuType { DefaultMenu = 0, EditMenu };
|
enum MenuType { DefaultMenu = 0, EditMenu };
|
||||||
|
Q_ENUM(MenuType)
|
||||||
|
|
||||||
virtual void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) = 0;
|
virtual void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) = 0;
|
||||||
virtual void removeMenuItem(QPlatformMenuItem *menuItem) = 0;
|
virtual void removeMenuItem(QPlatformMenuItem *menuItem) = 0;
|
||||||
|
@ -57,8 +57,10 @@ public:
|
|||||||
Trigger,
|
Trigger,
|
||||||
MiddleClick
|
MiddleClick
|
||||||
};
|
};
|
||||||
|
Q_ENUM(ActivationReason)
|
||||||
|
|
||||||
enum MessageIcon { NoIcon, Information, Warning, Critical };
|
enum MessageIcon { NoIcon, Information, Warning, Critical };
|
||||||
|
Q_ENUM(MessageIcon)
|
||||||
|
|
||||||
QPlatformSystemTrayIcon();
|
QPlatformSystemTrayIcon();
|
||||||
~QPlatformSystemTrayIcon();
|
~QPlatformSystemTrayIcon();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user