Q_ENUMS -> Q_ENUM and Q_FLAGS -> Q_FLAG

REVIEW: 129826
This commit is contained in:
Albert Astals Cid 2017-01-14 01:05:54 +01:00
parent 3aec1bf2d3
commit 5c46e32993
9 changed files with 27 additions and 29 deletions

View File

@ -119,7 +119,6 @@ class Calendar : public QObject
*/ */
Q_PROPERTY(QAbstractListModel *daysModel READ daysModel CONSTANT) Q_PROPERTY(QAbstractListModel *daysModel READ daysModel CONSTANT)
Q_ENUMS(Type DateMatchingPrecision)
public: public:
enum Type { enum Type {
@ -128,6 +127,7 @@ public:
Todo = 4, Todo = 4,
Journal = 8 Journal = 8
}; };
Q_ENUM(Type)
Q_DECLARE_FLAGS(Types, Type) Q_DECLARE_FLAGS(Types, Type)
enum DateMatchingPrecision { enum DateMatchingPrecision {
@ -135,6 +135,7 @@ public:
MatchYearAndMonth, MatchYearAndMonth,
MatchYearMonthAndDay MatchYearMonthAndDay
}; };
Q_ENUM(DateMatchingPrecision)
explicit Calendar(QObject *parent = 0); explicit Calendar(QObject *parent = 0);

View File

@ -37,8 +37,6 @@ class CalendarData : public QObject
Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged) Q_PROPERTY(bool loading READ loading NOTIFY loadingChanged)
// Q_PROPERTY(QAbstractItemModel* model READ model CONSTANT) // Q_PROPERTY(QAbstractItemModel* model READ model CONSTANT)
Q_ENUMS(Type)
public: public:
enum Type { enum Type {
Holiday = 1, Holiday = 1,
@ -46,6 +44,7 @@ public:
Todo = 4, Todo = 4,
Journal = 8 Journal = 8
}; };
Q_ENUM(Type)
Q_DECLARE_FLAGS(Types, Type) Q_DECLARE_FLAGS(Types, Type)
explicit CalendarData(QObject *parent = 0); explicit CalendarData(QObject *parent = 0);

View File

@ -133,7 +133,6 @@ class FrameSvgItem : public QQuickItem
*/ */
Q_PROPERTY(QObject *fixedMargins READ fixedMargins CONSTANT) Q_PROPERTY(QObject *fixedMargins READ fixedMargins CONSTANT)
Q_FLAGS(Plasma::FrameSvg::EnabledBorders)
/** /**
* The borders that will be rendered, it's a flag combination of: * The borders that will be rendered, it's a flag combination of:
* NoBorder * NoBorder

View File

@ -25,7 +25,6 @@
class DialogStatus : public QObject class DialogStatus : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_ENUMS(Status)
public: public:
enum Status { enum Status {
@ -34,12 +33,12 @@ public:
Closing, Closing,
Closed Closed
}; };
Q_ENUM(Status)
}; };
class PageOrientation : public QObject class PageOrientation : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_ENUMS(Orientation)
public: public:
enum Orientation { enum Orientation {
@ -49,12 +48,12 @@ public:
LockPrevious, LockPrevious,
Manual Manual
}; };
Q_ENUM(Orientation)
}; };
class PageStatus : public QObject class PageStatus : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_ENUMS(Status)
public: public:
enum Status { enum Status {
@ -63,6 +62,7 @@ public:
Active, Active,
Deactivating Deactivating
}; };
Q_ENUM(Status)
}; };
#endif // ENUMS_H #endif // ENUMS_H

View File

@ -77,7 +77,6 @@ class PLASMA_EXPORT FrameSvg : public Svg
{ {
Q_OBJECT Q_OBJECT
Q_FLAGS(EnabledBorders)
Q_PROPERTY(EnabledBorders enabledBorders READ enabledBorders WRITE setEnabledBorders) Q_PROPERTY(EnabledBorders enabledBorders READ enabledBorders WRITE setEnabledBorders)
public: public:
@ -93,6 +92,7 @@ public:
AllBorders = TopBorder | BottomBorder | LeftBorder | RightBorder AllBorders = TopBorder | BottomBorder | LeftBorder | RightBorder
}; };
Q_DECLARE_FLAGS(EnabledBorders, EnabledBorder) Q_DECLARE_FLAGS(EnabledBorders, EnabledBorder)
Q_FLAG(EnabledBorders)
/** /**
* Constructs a new FrameSvg that paints the proper named subelements * Constructs a new FrameSvg that paints the proper named subelements

View File

@ -61,7 +61,7 @@ public:
AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint | AllConstraints = FormFactorConstraint | LocationConstraint | ScreenConstraint |
ImmutableConstraint ImmutableConstraint
}; };
Q_ENUMS(Constraint) Q_ENUM(Constraint)
Q_DECLARE_FLAGS(Constraints, Constraint) Q_DECLARE_FLAGS(Constraints, Constraint)
/** /**
@ -87,7 +87,7 @@ public:
Application /**< The Applet lives in a plane and should be optimized to look as a full application, Application /**< The Applet lives in a plane and should be optimized to look as a full application,
for the desktop or the particular device. */ for the desktop or the particular device. */
}; };
Q_ENUMS(FormFactor) Q_ENUM(FormFactor)
/** /**
* This enumeration describes the type of the Containment. * This enumeration describes the type of the Containment.
@ -103,7 +103,7 @@ public:
CustomPanelContainment = 128, /**< A customized desktop panel */ CustomPanelContainment = 128, /**< A customized desktop panel */
CustomEmbeddedContainment = 129 /**< A customized containment embedded in another applet */ CustomEmbeddedContainment = 129 /**< A customized containment embedded in another applet */
}; };
Q_ENUMS(ContainmentType) Q_ENUM(ContainmentType)
/** /**
* A descriptrive type for QActions, to help categorizing them when presented to the user * A descriptrive type for QActions, to help categorizing them when presented to the user
@ -116,7 +116,7 @@ public:
DestructiveAction = 400, /** A dangerous action, such as deletion of objects, plasmoids and files. They are intended to be shown separed from other actions */ DestructiveAction = 400, /** A dangerous action, such as deletion of objects, plasmoids and files. They are intended to be shown separed from other actions */
UserAction = DestructiveAction + 1000 /** If new types are needed in a C++ implementation, define them as ids more than UserAction*/ UserAction = DestructiveAction + 1000 /** If new types are needed in a C++ implementation, define them as ids more than UserAction*/
}; };
Q_ENUMS(ActionType) Q_ENUM(ActionType)
/** /**
* The Direction enumeration describes in which direction, relative to the * The Direction enumeration describes in which direction, relative to the
@ -130,7 +130,7 @@ public:
Left, /**< Display to the left */ Left, /**< Display to the left */
Right /**< Display to the right */ Right /**< Display to the right */
}; };
Q_ENUMS(Direction) Q_ENUM(Direction)
/** /**
* The Location enumeration describes where on screen an element, such as an * The Location enumeration describes where on screen an element, such as an
@ -147,7 +147,7 @@ public:
LeftEdge, /**< Along the left side of the screen */ LeftEdge, /**< Along the left side of the screen */
RightEdge /**< Along the right side of the screen */ RightEdge /**< Along the right side of the screen */
}; };
Q_ENUMS(Location) Q_ENUM(Location)
/** /**
* The position enumeration * The position enumeration
@ -160,7 +160,7 @@ public:
BottomPositioned, /**< Positioned bottom */ BottomPositioned, /**< Positioned bottom */
CenterPositioned /**< Positioned in the center */ CenterPositioned /**< Positioned in the center */
}; };
Q_ENUMS(Position) Q_ENUM(Position)
/** /**
* The popup position enumeration relatively to his attached widget * The popup position enumeration relatively to his attached widget
@ -185,7 +185,7 @@ public:
RightPosedBottomAlignedPopup /**< Popup positioned on the right, aligned RightPosedBottomAlignedPopup /**< Popup positioned on the right, aligned
to the bottom of the widget */ to the bottom of the widget */
}; };
Q_ENUMS(PopupPlacement) Q_ENUM(PopupPlacement)
/** /**
* Flip enumeration * Flip enumeration
@ -195,7 +195,7 @@ public:
HorizontalFlip = 1, /**< Flip horizontally */ HorizontalFlip = 1, /**< Flip horizontally */
VerticalFlip = 2 /**< Flip vertically */ VerticalFlip = 2 /**< Flip vertically */
}; };
Q_ENUMS(FlipDirection) Q_ENUM(FlipDirection)
Q_DECLARE_FLAGS(Flip, FlipDirection) Q_DECLARE_FLAGS(Flip, FlipDirection)
/** /**
@ -206,7 +206,7 @@ public:
AlignToMinute, /**< Align to the minute **/ AlignToMinute, /**< Align to the minute **/
AlignToHour /**< Align to the hour **/ AlignToHour /**< Align to the hour **/
}; };
Q_ENUMS(IntervalAlignment) Q_ENUM(IntervalAlignment)
/** /**
* Defines the immutability of items like applets, corona and containments * Defines the immutability of items like applets, corona and containments
@ -220,7 +220,7 @@ public:
SystemImmutable = 4 /**< the item is locked down by the system, the user SystemImmutable = 4 /**< the item is locked down by the system, the user
can't unlock it **/ can't unlock it **/
}; };
Q_ENUMS(ImmutabilityType) Q_ENUM(ImmutabilityType)
/** /**
* The ComonentType enumeration refers to the various types of components, * The ComonentType enumeration refers to the various types of components,
@ -233,7 +233,7 @@ public:
WallpaperComponent = 8, /**< Plasma::Wallpaper based plugins **/ WallpaperComponent = 8, /**< Plasma::Wallpaper based plugins **/
GenericComponent = 16 /** Generic repositories of files, usually they keep QML files and their assets **/ GenericComponent = 16 /** Generic repositories of files, usually they keep QML files and their assets **/
}; };
Q_ENUMS(ComponentType) Q_ENUM(ComponentType)
Q_DECLARE_FLAGS(ComponentTypes, ComponentType) Q_DECLARE_FLAGS(ComponentTypes, ComponentType)
enum MarginEdge { enum MarginEdge {
@ -242,7 +242,7 @@ public:
LeftMargin, /**< The left margin **/ LeftMargin, /**< The left margin **/
RightMargin /**< The right margin **/ RightMargin /**< The right margin **/
}; };
Q_ENUMS(MarginEdge) Q_ENUM(MarginEdge)
/** /**
* Status of an applet * Status of an applet
@ -257,7 +257,7 @@ public:
AcceptingInputStatus = 5, /**< The Item is accepting input **/ AcceptingInputStatus = 5, /**< The Item is accepting input **/
HiddenStatus = 6 /**< The Item will be hidden totally **/ HiddenStatus = 6 /**< The Item will be hidden totally **/
}; };
Q_ENUMS(ItemStatus) Q_ENUM(ItemStatus)
enum TrustLevel { enum TrustLevel {
UnverifiableTrust = 0, /**< The trust of the object can not be verified, usually because no UnverifiableTrust = 0, /**< The trust of the object can not be verified, usually because no
@ -270,7 +270,7 @@ public:
FullyTrusted, /**< The signature is valid and made with a key signed by the vendor's key*/ FullyTrusted, /**< The signature is valid and made with a key signed by the vendor's key*/
UltimatelyTrusted /**< The signature is valid and made with the vendor's key*/ UltimatelyTrusted /**< The signature is valid and made with the vendor's key*/
}; };
Q_ENUMS(TrustLevel) Q_ENUM(TrustLevel)
/** /**
* Description on how draw a background for the applet * Description on how draw a background for the applet
@ -281,7 +281,7 @@ public:
TranslucentBackground = 2, /**< An alternate version of the background is drawn, usually more translucent */ TranslucentBackground = 2, /**< An alternate version of the background is drawn, usually more translucent */
DefaultBackground = StandardBackground /**< Default settings: both standard background */ DefaultBackground = StandardBackground /**< Default settings: both standard background */
}; };
Q_ENUMS(BackgroundHints) Q_ENUM(BackgroundHints)
private: private:
Types(QObject *parent = 0); Types(QObject *parent = 0);

View File

@ -56,7 +56,6 @@ class SvgPrivate;
class PLASMA_EXPORT Svg : public QObject class PLASMA_EXPORT Svg : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_ENUMS(ContentType)
Q_PROPERTY(QSize size READ size WRITE resize NOTIFY sizeChanged) Q_PROPERTY(QSize size READ size WRITE resize NOTIFY sizeChanged)
Q_PROPERTY(bool multipleImages READ containsMultipleImages WRITE setContainsMultipleImages) Q_PROPERTY(bool multipleImages READ containsMultipleImages WRITE setContainsMultipleImages)
Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath NOTIFY imagePathChanged) Q_PROPERTY(QString imagePath READ imagePath WRITE setImagePath NOTIFY imagePathChanged)
@ -70,7 +69,7 @@ public:
Normal = 0, Normal = 0,
Selected Selected
}; };
Q_ENUMS(Status) Q_ENUM(Status)
/** /**
* Constructs an SVG object that implicitly shares and caches rendering. * Constructs an SVG object that implicitly shares and caches rendering.

View File

@ -87,7 +87,7 @@ public:
ViewColorGroup = 2, ViewColorGroup = 2,
ComplementaryColorGroup = 3 ComplementaryColorGroup = 3
}; };
Q_ENUMS(ColorGroup) Q_ENUM(ColorGroup)
/** /**
* Default constructor. It will be the global theme configured in plasmarc * Default constructor. It will be the global theme configured in plasmarc

View File

@ -159,13 +159,13 @@ public:
Notification = NET::Notification, Notification = NET::Notification,
OnScreenDisplay = NET::OnScreenDisplay OnScreenDisplay = NET::OnScreenDisplay
}; };
Q_ENUMS(WindowType) Q_ENUM(WindowType)
enum BackgroundHints { enum BackgroundHints {
NoBackground = 0, /**< Not drawing a background under the applet, the dialog has its own implementation */ NoBackground = 0, /**< Not drawing a background under the applet, the dialog has its own implementation */
StandardBackground = 1 /**< The standard background from the theme is drawn */ StandardBackground = 1 /**< The standard background from the theme is drawn */
}; };
Q_ENUMS(BackgroundHints) Q_ENUM(BackgroundHints)
Dialog(QQuickItem *parent = 0); Dialog(QQuickItem *parent = 0);
~Dialog(); ~Dialog();