Q_ENUMS -> Q_ENUM and Q_FLAGS -> Q_FLAG

Change-Id: I3cdc7338354da40ab20bdaeb9d5745264ea27228
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
Albert Astals Cid 2016-12-23 11:52:47 +01:00
parent 92f6a4588f
commit 59ae55e12e
20 changed files with 29 additions and 21 deletions

View File

@ -73,10 +73,9 @@ class QDBusConnectionPrivate;
class Q_DBUS_EXPORT QDBusConnection
{
Q_GADGET
Q_ENUMS(BusType UnregisterMode)
Q_FLAGS(RegisterOptions)
public:
enum BusType { SessionBus, SystemBus, ActivationBus };
Q_ENUM(BusType)
enum RegisterOption {
ExportAdaptors = 0x01,
@ -106,11 +105,13 @@ public:
// Reserved = 0xff000000
};
Q_DECLARE_FLAGS(RegisterOptions, RegisterOption)
Q_FLAG(RegisterOptions)
enum UnregisterMode {
UnregisterNode,
UnregisterTree
};
Q_ENUM(UnregisterMode)
enum VirtualObjectRegisterOption {
SingleNode = 0x0,

View File

@ -61,7 +61,6 @@ class QByteArray;
class Q_DBUS_EXPORT QDBusConnectionInterface: public QDBusAbstractInterface
{
Q_OBJECT
Q_ENUMS(ServiceQueueOptions ServiceReplacementOptions RegisterServiceReply)
friend class QDBusConnectionPrivate;
static inline const char *staticInterfaceName();
@ -76,15 +75,18 @@ public:
QueueService,
ReplaceExistingService
};
Q_ENUM(ServiceQueueOptions)
enum ServiceReplacementOptions {
DontAllowReplacement,
AllowReplacement
};
Q_ENUM(ServiceReplacementOptions)
enum RegisterServiceReply {
ServiceNotRegistered = 0,
ServiceRegistered,
ServiceQueued
};
Q_ENUM(RegisterServiceReply)
public Q_SLOTS:
QDBusReply<QStringList> registeredServiceNames() const;

View File

@ -83,7 +83,6 @@ class Q_GUI_EXPORT QPainter
{
Q_DECLARE_PRIVATE(QPainter)
Q_GADGET
Q_FLAGS(RenderHint RenderHints)
public:
enum RenderHint {
@ -94,8 +93,10 @@ public:
NonCosmeticDefaultPen = 0x10,
Qt4CompatiblePainting = 0x20
};
Q_FLAG(RenderHint)
Q_DECLARE_FLAGS(RenderHints, RenderHint)
Q_FLAG(RenderHints)
class PixmapFragment {
public:

View File

@ -56,7 +56,6 @@ class Q_NETWORK_EXPORT QLocalServer : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QLocalServer)
Q_PROPERTY(SocketOptions socketOptions READ socketOptions WRITE setSocketOptions)
Q_FLAGS(SocketOption SocketOptions)
Q_SIGNALS:
void newConnection();
@ -69,7 +68,9 @@ public:
OtherAccessOption = 0x4,
WorldAccessOption = 0x7
};
Q_FLAG(SocketOption)
Q_DECLARE_FLAGS(SocketOptions, SocketOption)
Q_FLAG(SocketOptions)
explicit QLocalServer(QObject *parent = Q_NULLPTR);
~QLocalServer();

View File

@ -68,7 +68,6 @@ QT_BEGIN_NAMESPACE
class QDeviceDiscovery : public QObject
{
Q_OBJECT
Q_ENUMS(QDeviceType)
public:
enum QDeviceType {
@ -84,6 +83,7 @@ public:
Device_InputMask = Device_Mouse | Device_Touchpad | Device_Touchscreen | Device_Keyboard | Device_Tablet | Device_Joystick,
Device_VideoMask = Device_DRM
};
Q_ENUM(QDeviceType)
Q_DECLARE_FLAGS(QDeviceTypes, QDeviceType)
static QDeviceDiscovery *create(QDeviceTypes type, QObject *parent = 0);

View File

@ -76,8 +76,10 @@ public:
DontUseSheet = 0x0020,
PrintCurrentPage = 0x0040
};
Q_ENUM(PrintDialogOption)
Q_DECLARE_FLAGS(PrintDialogOptions, PrintDialogOption)
Q_FLAG(PrintDialogOptions)
#ifndef QT_NO_PRINTDIALOG
explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);

View File

@ -56,7 +56,6 @@ class Q_PRINTSUPPORT_EXPORT QPrintDialog : public QAbstractPrintDialog
{
Q_OBJECT
Q_DECLARE_PRIVATE(QPrintDialog)
Q_ENUMS(PrintDialogOption)
Q_PROPERTY(PrintDialogOptions options READ options WRITE setOptions)
public:

View File

@ -62,7 +62,6 @@ class QAbstractProxyModel;
class Q_WIDGETS_EXPORT QFileDialog : public QDialog
{
Q_OBJECT
Q_FLAGS(Options)
Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode)
Q_PROPERTY(FileMode fileMode READ fileMode WRITE setFileMode)
Q_PROPERTY(AcceptMode acceptMode READ acceptMode WRITE setAcceptMode)
@ -97,6 +96,7 @@ public:
};
Q_ENUM(Option)
Q_DECLARE_FLAGS(Options, Option)
Q_FLAG(Options)
QFileDialog(QWidget *parent, Qt::WindowFlags f);
explicit QFileDialog(QWidget *parent = Q_NULLPTR,

View File

@ -56,7 +56,6 @@ class QCheckBox;
class Q_WIDGETS_EXPORT QMessageBox : public QDialog
{
Q_OBJECT
Q_FLAGS(StandardButtons)
Q_PROPERTY(QString text READ text WRITE setText)
Q_PROPERTY(Icon icon READ icon WRITE setIcon)
Q_PROPERTY(QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap)
@ -131,6 +130,7 @@ public:
typedef StandardButton Button; // obsolete
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
Q_FLAG(StandardButtons)
explicit QMessageBox(QWidget *parent = Q_NULLPTR);
QMessageBox(Icon icon, const QString &title, const QString &text,

View File

@ -55,7 +55,6 @@ class QWizardPrivate;
class Q_WIDGETS_EXPORT QWizard : public QDialog
{
Q_OBJECT
Q_FLAGS(WizardOptions)
Q_PROPERTY(WizardStyle wizardStyle READ wizardStyle WRITE setWizardStyle)
Q_PROPERTY(WizardOptions options READ options WRITE setOptions)
Q_PROPERTY(Qt::TextFormat titleFormat READ titleFormat WRITE setTitleFormat)
@ -120,6 +119,7 @@ public:
Q_ENUM(WizardOption)
Q_DECLARE_FLAGS(WizardOptions, WizardOption)
Q_FLAG(WizardOptions)
explicit QWizard(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
~QWizard();

View File

@ -62,7 +62,6 @@ class QGraphicsEffectPrivate;
class Q_WIDGETS_EXPORT QGraphicsEffect : public QObject
{
Q_OBJECT
Q_FLAGS(ChangeFlags)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
public:
enum ChangeFlag {
@ -72,6 +71,7 @@ public:
SourceInvalidated = 0x8
};
Q_DECLARE_FLAGS(ChangeFlags, ChangeFlag)
Q_FLAG(ChangeFlags)
enum PixmapPadMode {
NoPad,
@ -155,7 +155,6 @@ class QGraphicsBlurEffectPrivate;
class Q_WIDGETS_EXPORT QGraphicsBlurEffect: public QGraphicsEffect
{
Q_OBJECT
Q_FLAGS(BlurHint BlurHints)
Q_PROPERTY(qreal blurRadius READ blurRadius WRITE setBlurRadius NOTIFY blurRadiusChanged)
Q_PROPERTY(BlurHints blurHints READ blurHints WRITE setBlurHints NOTIFY blurHintsChanged)
public:
@ -164,7 +163,9 @@ public:
QualityHint = 0x01,
AnimationHint = 0x02
};
Q_FLAG(BlurHint)
Q_DECLARE_FLAGS(BlurHints, BlurHint)
Q_FLAG(BlurHints)
QGraphicsBlurEffect(QObject *parent = Q_NULLPTR);
~QGraphicsBlurEffect();

View File

@ -62,7 +62,6 @@ class QAbstractItemViewPrivate;
class Q_WIDGETS_EXPORT QAbstractItemView : public QAbstractScrollArea
{
Q_OBJECT
Q_FLAGS(EditTriggers)
Q_PROPERTY(bool autoScroll READ hasAutoScroll WRITE setAutoScroll)
Q_PROPERTY(int autoScrollMargin READ autoScrollMargin WRITE setAutoScrollMargin)
Q_PROPERTY(EditTriggers editTriggers READ editTriggers WRITE setEditTriggers)
@ -118,6 +117,7 @@ public:
};
Q_DECLARE_FLAGS(EditTriggers, EditTrigger)
Q_FLAG(EditTriggers)
enum ScrollMode {
ScrollPerItem,

View File

@ -135,7 +135,6 @@ class Q_WIDGETS_EXPORT QPinchGesture : public QGesture
{
Q_OBJECT
Q_DECLARE_PRIVATE(QPinchGesture)
Q_FLAGS(ChangeFlags ChangeFlag)
public:
enum ChangeFlag {
@ -143,7 +142,9 @@ public:
RotationAngleChanged = 0x2,
CenterPointChanged = 0x4
};
Q_FLAG(ChangeFlag)
Q_DECLARE_FLAGS(ChangeFlags, ChangeFlag)
Q_FLAG(ChangeFlags)
Q_PROPERTY(ChangeFlags totalChangeFlags READ totalChangeFlags WRITE setTotalChangeFlags)
Q_PROPERTY(ChangeFlags changeFlags READ changeFlags WRITE setChangeFlags)

View File

@ -54,7 +54,6 @@ Q_DECL_CONST_FUNCTION inline uint qHash(QSizePolicy key, uint seed = 0) Q_DECL_N
class Q_WIDGETS_EXPORT QSizePolicy
{
Q_GADGET
Q_FLAGS(ControlTypes)
public:
enum PolicyFlag {
@ -93,6 +92,7 @@ public:
ToolButton = 0x00004000
};
Q_DECLARE_FLAGS(ControlTypes, ControlType)
Q_FLAG(ControlTypes)
QSizePolicy() : data(0) { }

View File

@ -58,7 +58,6 @@ class Q_WIDGETS_EXPORT QDateTimeEdit : public QAbstractSpinBox
{
Q_OBJECT
Q_FLAGS(Sections)
Q_PROPERTY(QDateTime dateTime READ dateTime WRITE setDateTime NOTIFY dateTimeChanged USER true)
Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY dateChanged)
Q_PROPERTY(QTime time READ time WRITE setTime NOTIFY timeChanged)
@ -92,6 +91,7 @@ public:
Q_ENUM(Section)
Q_DECLARE_FLAGS(Sections, Section)
Q_FLAG(Sections)
explicit QDateTimeEdit(QWidget *parent = Q_NULLPTR);
explicit QDateTimeEdit(const QDateTime &dt, QWidget *parent = Q_NULLPTR);

View File

@ -53,7 +53,6 @@ class QDialogButtonBoxPrivate;
class Q_WIDGETS_EXPORT QDialogButtonBox : public QWidget
{
Q_OBJECT
Q_FLAGS(StandardButtons)
Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
Q_PROPERTY(StandardButtons standardButtons READ standardButtons WRITE setStandardButtons)
Q_PROPERTY(bool centerButtons READ centerButtons WRITE setCenterButtons)
@ -104,6 +103,7 @@ public:
};
Q_DECLARE_FLAGS(StandardButtons, StandardButton)
Q_FLAG(StandardButtons)
enum ButtonLayout {
// keep this in sync with QMessageBox::ButtonLayout and QPlatformDialogHelper::ButtonLayout

View File

@ -57,7 +57,6 @@ class Q_WIDGETS_EXPORT QDockWidget : public QWidget
{
Q_OBJECT
Q_FLAGS(DockWidgetFeatures)
Q_PROPERTY(bool floating READ isFloating WRITE setFloating)
Q_PROPERTY(DockWidgetFeatures features READ features WRITE setFeatures NOTIFY featuresChanged)
Q_PROPERTY(Qt::DockWidgetAreas allowedAreas READ allowedAreas
@ -86,6 +85,7 @@ public:
Reserved = 0xff
};
Q_DECLARE_FLAGS(DockWidgetFeatures, DockWidgetFeature)
Q_FLAG(DockWidgetFeatures)
void setFeatures(DockWidgetFeatures features);
DockWidgetFeatures features() const;

View File

@ -54,7 +54,6 @@ class QFontComboBoxPrivate;
class Q_WIDGETS_EXPORT QFontComboBox : public QComboBox
{
Q_OBJECT
Q_FLAGS(FontFilters)
Q_PROPERTY(QFontDatabase::WritingSystem writingSystem READ writingSystem WRITE setWritingSystem)
Q_PROPERTY(FontFilters fontFilters READ fontFilters WRITE setFontFilters)
Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged)
@ -74,6 +73,7 @@ public:
ProportionalFonts = 0x8
};
Q_DECLARE_FLAGS(FontFilters, FontFilter)
Q_FLAG(FontFilters)
void setFontFilters(FontFilters filters);
FontFilters fontFilters() const;

View File

@ -60,7 +60,6 @@ class Q_WIDGETS_EXPORT QMainWindow : public QWidget
{
Q_OBJECT
Q_FLAGS(DockOptions)
Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
Q_PROPERTY(Qt::ToolButtonStyle toolButtonStyle READ toolButtonStyle WRITE setToolButtonStyle)
#ifndef QT_NO_DOCKWIDGET
@ -89,6 +88,7 @@ public:
};
Q_ENUM(DockOption)
Q_DECLARE_FLAGS(DockOptions, DockOption)
Q_FLAG(DockOptions)
explicit QMainWindow(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
~QMainWindow();

View File

@ -64,7 +64,6 @@ class Q_WIDGETS_EXPORT QTextEdit : public QAbstractScrollArea
{
Q_OBJECT
Q_DECLARE_PRIVATE(QTextEdit)
Q_FLAGS(AutoFormatting)
Q_PROPERTY(AutoFormatting autoFormatting READ autoFormatting WRITE setAutoFormatting)
Q_PROPERTY(bool tabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus)
Q_PROPERTY(QString documentTitle READ documentTitle WRITE setDocumentTitle)
@ -100,6 +99,7 @@ public:
};
Q_DECLARE_FLAGS(AutoFormatting, AutoFormattingFlag)
Q_FLAG(AutoFormatting)
explicit QTextEdit(QWidget *parent = Q_NULLPTR);
explicit QTextEdit(const QString &text, QWidget *parent = Q_NULLPTR);