QtWidgets: use Q_ENUM instead of Q_ENUMS

Change-Id: Id5280c1d9feab95e1506569f3d0eb23eeb74935f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
bb10
Olivier Goffart 2015-02-07 13:00:49 +01:00 committed by Olivier Goffart (Woboq GmbH)
parent e768d96e8b
commit 163b852951
35 changed files with 72 additions and 43 deletions

View File

@ -47,7 +47,6 @@ class Q_WIDGETS_EXPORT QColorDialog : public QDialog
{
Q_OBJECT
Q_DECLARE_PRIVATE(QColorDialog)
Q_ENUMS(ColorDialogOption)
Q_PROPERTY(QColor currentColor READ currentColor WRITE setCurrentColor
NOTIFY currentColorChanged)
Q_PROPERTY(ColorDialogOptions options READ options WRITE setOptions)
@ -58,6 +57,7 @@ public:
NoButtons = 0x00000002,
DontUseNativeDialog = 0x00000004
};
Q_ENUM(ColorDialogOption)
Q_DECLARE_FLAGS(ColorDialogOptions, ColorDialogOption)

View File

@ -55,7 +55,6 @@ class QAbstractProxyModel;
class Q_WIDGETS_EXPORT QFileDialog : public QDialog
{
Q_OBJECT
Q_ENUMS(ViewMode FileMode AcceptMode Option)
Q_FLAGS(Options)
Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode)
Q_PROPERTY(FileMode fileMode READ fileMode WRITE setFileMode)
@ -70,8 +69,11 @@ class Q_WIDGETS_EXPORT QFileDialog : public QDialog
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 };
enum Option
@ -85,6 +87,7 @@ public:
HideNameFilterDetails = 0x00000040,
DontUseCustomDirectoryIcons = 0x00000080
};
Q_ENUM(Option)
Q_DECLARE_FLAGS(Options, Option)
QFileDialog(QWidget *parent, Qt::WindowFlags f);

View File

@ -49,7 +49,6 @@ class Q_WIDGETS_EXPORT QFontDialog : public QDialog
{
Q_OBJECT
Q_DECLARE_PRIVATE(QFontDialog)
Q_ENUMS(FontDialogOption)
Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged)
Q_PROPERTY(FontDialogOptions options READ options WRITE setOptions)
@ -62,6 +61,7 @@ public:
MonospacedFonts = 0x00000010,
ProportionalFonts = 0x00000020
};
Q_ENUM(FontDialogOption)
Q_DECLARE_FLAGS(FontDialogOptions, FontDialogOption)

View File

@ -49,7 +49,6 @@ class QCheckBox;
class Q_WIDGETS_EXPORT QMessageBox : public QDialog
{
Q_OBJECT
Q_ENUMS(Icon)
Q_FLAGS(StandardButtons)
Q_PROPERTY(QString text READ text WRITE setText)
Q_PROPERTY(Icon icon READ icon WRITE setIcon)
@ -71,6 +70,7 @@ public:
Critical = 3,
Question = 4
};
Q_ENUM(Icon)
enum ButtonRole {
// keep this in sync with QDialogButtonBox::ButtonRole and QPlatformDialogHelper::ButtonRole

View File

@ -48,7 +48,6 @@ class QWizardPrivate;
class Q_WIDGETS_EXPORT QWizard : public QDialog
{
Q_OBJECT
Q_ENUMS(WizardStyle WizardOption)
Q_FLAGS(WizardOptions)
Q_PROPERTY(WizardStyle wizardStyle READ wizardStyle WRITE setWizardStyle)
Q_PROPERTY(WizardOptions options READ options WRITE setOptions)
@ -74,6 +73,7 @@ public:
NStandardButtons = 6,
NButtons = 9
};
Q_ENUM(WizardButton)
enum WizardPixmap {
WatermarkPixmap,
@ -110,6 +110,7 @@ public:
HaveCustomButton3 = 0x00008000,
NoCancelButtonOnLastPage = 0x00010000
};
Q_ENUM(WizardOption)
Q_DECLARE_FLAGS(WizardOptions, WizardOption)

View File

@ -54,7 +54,6 @@ class Q_WIDGETS_EXPORT QGraphicsView : public QAbstractScrollArea
{
Q_OBJECT
Q_FLAGS(QPainter::RenderHints CacheMode OptimizationFlags)
Q_ENUMS(ViewportAnchor DragMode ViewportUpdateMode)
Q_PROPERTY(QBrush backgroundBrush READ backgroundBrush WRITE setBackgroundBrush)
Q_PROPERTY(QBrush foregroundBrush READ foregroundBrush WRITE setForegroundBrush)
Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive)
@ -77,6 +76,7 @@ public:
AnchorViewCenter,
AnchorUnderMouse
};
Q_ENUM(ViewportAnchor)
enum CacheModeFlag {
CacheNone = 0x0,
@ -89,6 +89,7 @@ public:
ScrollHandDrag,
RubberBandDrag
};
Q_ENUM(DragMode)
enum ViewportUpdateMode {
FullViewportUpdate,
@ -97,6 +98,7 @@ public:
NoViewportUpdate,
BoundingRectViewportUpdate
};
Q_ENUM(ViewportUpdateMode)
enum OptimizationFlag {
DontClipPainter = 0x1, // obsolete

View File

@ -52,7 +52,6 @@ class QAbstractItemViewPrivate;
class Q_WIDGETS_EXPORT QAbstractItemView : public QAbstractScrollArea
{
Q_OBJECT
Q_ENUMS(SelectionMode SelectionBehavior ScrollHint ScrollMode DragDropMode)
Q_FLAGS(EditTriggers)
Q_PROPERTY(bool autoScroll READ hasAutoScroll WRITE setAutoScroll)
Q_PROPERTY(int autoScrollMargin READ autoScrollMargin WRITE setAutoScrollMargin)
@ -81,12 +80,14 @@ public:
ExtendedSelection,
ContiguousSelection
};
Q_ENUM(SelectionMode)
enum SelectionBehavior {
SelectItems,
SelectRows,
SelectColumns
};
Q_ENUM(SelectionBehavior)
enum ScrollHint {
EnsureVisible,
@ -94,6 +95,7 @@ public:
PositionAtBottom,
PositionAtCenter
};
Q_ENUM(ScrollHint)
enum EditTrigger {
NoEditTriggers = 0,
@ -111,6 +113,7 @@ public:
ScrollPerItem,
ScrollPerPixel
};
Q_ENUM(ScrollMode)
explicit QAbstractItemView(QWidget *parent = 0);
~QAbstractItemView();
@ -168,6 +171,7 @@ public:
DragDrop,
InternalMove
};
Q_ENUM(DragDropMode)
void setDragDropMode(DragDropMode behavior);
DragDropMode dragDropMode() const;

View File

@ -50,7 +50,6 @@ class Q_WIDGETS_EXPORT QDataWidgetMapper: public QObject
{
Q_OBJECT
Q_ENUMS(SubmitPolicy)
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
Q_PROPERTY(SubmitPolicy submitPolicy READ submitPolicy WRITE setSubmitPolicy)
@ -72,6 +71,7 @@ public:
Qt::Orientation orientation() const;
enum SubmitPolicy { AutoSubmit, ManualSubmit };
Q_ENUM(SubmitPolicy)
void setSubmitPolicy(SubmitPolicy policy);
SubmitPolicy submitPolicy() const;

View File

@ -55,7 +55,6 @@ class Q_WIDGETS_EXPORT QHeaderView : public QAbstractItemView
Q_PROPERTY(int minimumSectionSize READ minimumSectionSize WRITE setMinimumSectionSize)
Q_PROPERTY(int maximumSectionSize READ maximumSectionSize WRITE setMaximumSectionSize)
Q_PROPERTY(Qt::Alignment defaultAlignment READ defaultAlignment WRITE setDefaultAlignment)
Q_ENUMS(ResizeMode)
public:
@ -67,6 +66,7 @@ public:
ResizeToContents,
Custom = Fixed
};
Q_ENUM(ResizeMode)
explicit QHeaderView(Qt::Orientation orientation, QWidget *parent = 0);
virtual ~QHeaderView();

View File

@ -46,7 +46,6 @@ class QListViewPrivate;
class Q_WIDGETS_EXPORT QListView : public QAbstractItemView
{
Q_OBJECT
Q_ENUMS(Movement Flow ResizeMode LayoutMode ViewMode)
Q_PROPERTY(Movement movement READ movement WRITE setMovement)
Q_PROPERTY(Flow flow READ flow WRITE setFlow)
Q_PROPERTY(bool isWrapping READ isWrapping WRITE setWrapping)
@ -63,10 +62,15 @@ class Q_WIDGETS_EXPORT QListView : public QAbstractItemView
public:
enum Movement { Static, Free, Snap };
Q_ENUM(Movement)
enum Flow { LeftToRight, TopToBottom };
Q_ENUM(Flow)
enum ResizeMode { Fixed, Adjust };
Q_ENUM(ResizeMode)
enum LayoutMode { SinglePass, Batched };
Q_ENUM(LayoutMode)
enum ViewMode { ListMode, IconMode };
Q_ENUM(ViewMode)
explicit QListView(QWidget *parent = 0);
~QListView();

View File

@ -55,8 +55,6 @@ class Q_WIDGETS_EXPORT QAction : public QObject
Q_OBJECT
Q_DECLARE_PRIVATE(QAction)
Q_ENUMS(MenuRole)
Q_ENUMS(Priority)
Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY changed)
Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled)
Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY changed)
@ -81,9 +79,11 @@ public:
// note this is copied into qplatformmenu.h, which must stay in sync
enum MenuRole { NoRole = 0, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole,
AboutRole, PreferencesRole, QuitRole };
Q_ENUM(MenuRole)
enum Priority { LowPriority = 0,
NormalPriority = 128,
HighPriority = 256};
Q_ENUM(Priority)
explicit QAction(QObject* parent);
QAction(const QString &text, QObject* parent);
QAction(const QIcon &icon, const QString &text, QObject* parent);

View File

@ -44,7 +44,6 @@ class QFormLayoutPrivate;
class Q_WIDGETS_EXPORT QFormLayout : public QLayout
{
Q_OBJECT
Q_ENUMS(FieldGrowthPolicy RowWrapPolicy ItemRole)
Q_DECLARE_PRIVATE(QFormLayout)
Q_PROPERTY(FieldGrowthPolicy fieldGrowthPolicy READ fieldGrowthPolicy WRITE setFieldGrowthPolicy RESET resetFieldGrowthPolicy)
Q_PROPERTY(RowWrapPolicy rowWrapPolicy READ rowWrapPolicy WRITE setRowWrapPolicy RESET resetRowWrapPolicy)
@ -59,18 +58,21 @@ public:
ExpandingFieldsGrow,
AllNonFixedFieldsGrow
};
Q_ENUM(FieldGrowthPolicy)
enum RowWrapPolicy {
DontWrapRows,
WrapLongRows,
WrapAllRows
};
Q_ENUM(RowWrapPolicy)
enum ItemRole {
LabelRole = 0,
FieldRole = 1,
SpanningRole = 2
};
Q_ENUM(ItemRole)
explicit QFormLayout(QWidget *parent = 0);
~QFormLayout();

View File

@ -200,7 +200,6 @@ class Q_WIDGETS_EXPORT QSwipeGesture : public QGesture
{
Q_OBJECT
Q_DECLARE_PRIVATE(QSwipeGesture)
Q_ENUMS(SwipeDirection)
Q_PROPERTY(SwipeDirection horizontalDirection READ horizontalDirection STORED false)
Q_PROPERTY(SwipeDirection verticalDirection READ verticalDirection STORED false)
@ -209,6 +208,7 @@ class Q_WIDGETS_EXPORT QSwipeGesture : public QGesture
public:
enum SwipeDirection { NoDirection, Left, Right, Up, Down };
Q_ENUM(SwipeDirection)
explicit QSwipeGesture(QObject *parent = 0);
~QSwipeGesture();

View File

@ -56,7 +56,6 @@ class Q_WIDGETS_EXPORT QLayout : public QObject, public QLayoutItem
Q_OBJECT
Q_DECLARE_PRIVATE(QLayout)
Q_ENUMS(SizeConstraint)
Q_PROPERTY(int margin READ margin WRITE setMargin)
Q_PROPERTY(int spacing READ spacing WRITE setSpacing)
Q_PROPERTY(SizeConstraint sizeConstraint READ sizeConstraint WRITE setSizeConstraint)
@ -69,6 +68,7 @@ public:
SetMaximumSize,
SetMinAndMaxSize
};
Q_ENUM(SizeConstraint)
QLayout(QWidget *parent);
QLayout();

View File

@ -44,7 +44,6 @@ class QVariant;
class Q_WIDGETS_EXPORT QSizePolicy
{
Q_GADGET
Q_ENUMS(Policy)
Q_FLAGS(ControlTypes)
public:
@ -64,6 +63,7 @@ public:
Expanding = GrowFlag | ShrinkFlag | ExpandFlag,
Ignored = ShrinkFlag | GrowFlag | IgnoreFlag
};
Q_ENUM(Policy)
enum ControlType {
DefaultType = 0x00000001,

View File

@ -45,7 +45,6 @@ class Q_WIDGETS_EXPORT QStackedLayout : public QLayout
{
Q_OBJECT
Q_DECLARE_PRIVATE(QStackedLayout)
Q_ENUMS(StackingMode)
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
Q_PROPERTY(StackingMode stackingMode READ stackingMode WRITE setStackingMode)
QDOC_PROPERTY(int count READ count)
@ -55,6 +54,7 @@ public:
StackOne,
StackAll
};
Q_ENUM(StackingMode)
QStackedLayout();
explicit QStackedLayout(QWidget *parent);

View File

@ -58,9 +58,6 @@ class Q_WIDGETS_EXPORT QStyle : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QStyle)
Q_ENUMS(StateFlag PrimitiveElement ControlElement SubElement ComplexControl)
Q_ENUMS(SubControl PixelMetric ContentsType RequestSoftwareInputPanel StyleHint)
Q_ENUMS(StandardPixmap)
protected:
QStyle(QStylePrivate &dd);
@ -125,6 +122,7 @@ public:
State_Small = 0x04000000,
State_Mini = 0x08000000
};
Q_ENUM(StateFlag)
Q_DECLARE_FLAGS(State, StateFlag)
@ -191,6 +189,7 @@ public:
// do not add any values below/greater this
PE_CustomBase = 0xf000000
};
Q_ENUM(PrimitiveElement)
virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
const QWidget *w = 0) const = 0;
@ -261,6 +260,7 @@ public:
// do not add any values below/greater than this
CE_CustomBase = 0xf0000000
};
Q_ENUM(ControlElement)
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
const QWidget *w = 0) const = 0;
@ -344,6 +344,7 @@ public:
// do not add any values below/greater than this
SE_CustomBase = 0xf0000000
};
Q_ENUM(SubElement)
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option,
const QWidget *widget = 0) const = 0;
@ -363,6 +364,7 @@ public:
// do not add any values below/greater than this
CC_CustomBase = 0xf0000000
};
Q_ENUM(ComplexControl)
enum SubControl {
SC_None = 0x00000000,
@ -419,6 +421,7 @@ public:
SC_CustomBase = 0xf0000000,
SC_All = 0xffffffff
};
Q_ENUM(SubControl)
Q_DECLARE_FLAGS(SubControls, SubControl)
@ -556,6 +559,7 @@ public:
// do not add any values below/greater than this
PM_CustomBase = 0xf0000000
};
Q_ENUM(PixelMetric)
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option = 0,
const QWidget *widget = 0) const = 0;
@ -587,6 +591,7 @@ public:
// do not add any values below/greater than this
CT_CustomBase = 0xf0000000
};
Q_ENUM(ContentsType)
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
const QSize &contentsSize, const QWidget *w = 0) const = 0;
@ -595,6 +600,7 @@ public:
RSIP_OnMouseClickAndAlreadyFocused,
RSIP_OnMouseClick
};
Q_ENUM(RequestSoftwareInputPanel)
enum StyleHint {
SH_EtchDisabledText,
@ -716,6 +722,7 @@ public:
SH_CustomBase = 0xf0000000
};
Q_ENUM(StyleHint)
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt = 0,
const QWidget *widget = 0, QStyleHintReturn* returnData = 0) const = 0;
@ -795,6 +802,7 @@ public:
// do not add any values below/greater than this
SP_CustomBase = 0xf0000000
};
Q_ENUM(StandardPixmap)
virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt = 0,
const QWidget *widget = 0) const = 0;

View File

@ -54,7 +54,6 @@ class Q_WIDGETS_EXPORT QScroller : public QObject
Q_OBJECT
Q_PROPERTY(State state READ state NOTIFY stateChanged)
Q_PROPERTY(QScrollerProperties scrollerProperties READ scrollerProperties WRITE setScrollerProperties NOTIFY scrollerPropertiesChanged)
Q_ENUMS(State)
public:
enum State
@ -64,6 +63,7 @@ public:
Dragging,
Scrolling
};
Q_ENUM(State)
enum ScrollerGestureType
{

View File

@ -49,7 +49,6 @@ class Q_WIDGETS_EXPORT QAbstractScrollArea : public QFrame
{
Q_OBJECT
Q_ENUMS(SizeAdjustPolicy)
Q_PROPERTY(Qt::ScrollBarPolicy verticalScrollBarPolicy READ verticalScrollBarPolicy WRITE setVerticalScrollBarPolicy)
Q_PROPERTY(Qt::ScrollBarPolicy horizontalScrollBarPolicy READ horizontalScrollBarPolicy WRITE setHorizontalScrollBarPolicy)
Q_PROPERTY(SizeAdjustPolicy sizeAdjustPolicy READ sizeAdjustPolicy WRITE setSizeAdjustPolicy)
@ -63,6 +62,7 @@ public:
AdjustToContentsOnFirstShow,
AdjustToContents
};
Q_ENUM(SizeAdjustPolicy)
Qt::ScrollBarPolicy verticalScrollBarPolicy() const;
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy);

View File

@ -51,8 +51,6 @@ class Q_WIDGETS_EXPORT QAbstractSpinBox : public QWidget
{
Q_OBJECT
Q_ENUMS(ButtonSymbols)
Q_ENUMS(CorrectionMode)
Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping)
Q_PROPERTY(bool frame READ hasFrame WRITE setFrame)
Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
@ -74,11 +72,13 @@ public:
Q_DECLARE_FLAGS(StepEnabled, StepEnabledFlag)
enum ButtonSymbols { UpDownArrows, PlusMinus, NoButtons };
Q_ENUM(ButtonSymbols)
ButtonSymbols buttonSymbols() const;
void setButtonSymbols(ButtonSymbols bs);
enum CorrectionMode { CorrectToPreviousValue, CorrectToNearestValue };
Q_ENUM(CorrectionMode)
void setCorrectionMode(CorrectionMode cm);
CorrectionMode correctionMode() const;

View File

@ -50,9 +50,6 @@ class Q_WIDGETS_EXPORT QCalendarWidget : public QWidget
{
Q_OBJECT
Q_ENUMS(Qt::DayOfWeek)
Q_ENUMS(HorizontalHeaderFormat)
Q_ENUMS(VerticalHeaderFormat)
Q_ENUMS(SelectionMode)
Q_PROPERTY(QDate selectedDate READ selectedDate WRITE setSelectedDate)
Q_PROPERTY(QDate minimumDate READ minimumDate WRITE setMinimumDate)
Q_PROPERTY(QDate maximumDate READ maximumDate WRITE setMaximumDate)
@ -72,16 +69,19 @@ public:
ShortDayNames,
LongDayNames
};
Q_ENUM(HorizontalHeaderFormat)
enum VerticalHeaderFormat {
NoVerticalHeader,
ISOWeekNumbers
};
Q_ENUM(VerticalHeaderFormat)
enum SelectionMode {
NoSelection,
SingleSelection
};
Q_ENUM(SelectionMode)
explicit QCalendarWidget(QWidget *parent = 0);
~QCalendarWidget();

View File

@ -52,8 +52,6 @@ class Q_WIDGETS_EXPORT QComboBox : public QWidget
{
Q_OBJECT
Q_ENUMS(InsertPolicy)
Q_ENUMS(SizeAdjustPolicy)
Q_PROPERTY(bool editable READ isEditable WRITE setEditable)
Q_PROPERTY(int count READ count)
Q_PROPERTY(QString currentText READ currentText WRITE setCurrentText NOTIFY currentTextChanged USER true)
@ -115,6 +113,7 @@ public:
InsertBeforeCurrent,
InsertAlphabetically
};
Q_ENUM(InsertPolicy)
InsertPolicy insertPolicy() const;
void setInsertPolicy(InsertPolicy policy);
@ -125,6 +124,7 @@ public:
AdjustToMinimumContentsLength, // ### Qt 6: remove
AdjustToMinimumContentsLengthWithIcon
};
Q_ENUM(SizeAdjustPolicy)
SizeAdjustPolicy sizeAdjustPolicy() const;
void setSizeAdjustPolicy(SizeAdjustPolicy policy);

View File

@ -51,7 +51,6 @@ class Q_WIDGETS_EXPORT QDateTimeEdit : public QAbstractSpinBox
{
Q_OBJECT
Q_ENUMS(Section)
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)
@ -83,6 +82,7 @@ public:
TimeSections_Mask = AmPmSection|MSecSection|SecondSection|MinuteSection|HourSection,
DateSections_Mask = DaySection|MonthSection|YearSection
};
Q_ENUM(Section)
Q_DECLARE_FLAGS(Sections, Section)

View File

@ -46,7 +46,6 @@ class Q_WIDGETS_EXPORT QFrame : public QWidget
{
Q_OBJECT
Q_ENUMS(Shape Shadow)
Q_PROPERTY(Shape frameShape READ frameShape WRITE setFrameShape)
Q_PROPERTY(Shadow frameShadow READ frameShadow WRITE setFrameShadow)
Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth)
@ -74,11 +73,13 @@ public:
VLine = 0x0005, // vertical line
StyledPanel = 0x0006 // rectangular panel depending on the GUI style
};
Q_ENUM(Shape)
enum Shadow {
Plain = 0x0010, // plain line
Raised = 0x0020, // raised shadow effect
Sunken = 0x0030 // sunken shadow effect
};
Q_ENUM(Shadow)
enum StyleMask {
Shadow_Mask = 0x00f0, // mask for the shadow

View File

@ -45,7 +45,6 @@ class QLCDNumberPrivate;
class Q_WIDGETS_EXPORT QLCDNumber : public QFrame // LCD number widget
{
Q_OBJECT
Q_ENUMS(Mode SegmentStyle)
Q_PROPERTY(bool smallDecimalPoint READ smallDecimalPoint WRITE setSmallDecimalPoint)
Q_PROPERTY(int digitCount READ digitCount WRITE setDigitCount)
Q_PROPERTY(Mode mode READ mode WRITE setMode)
@ -61,9 +60,11 @@ public:
enum Mode {
Hex, Dec, Oct, Bin
};
Q_ENUM(Mode)
enum SegmentStyle {
Outline, Filled, Flat
};
Q_ENUM(SegmentStyle)
bool smallDecimalPoint() const;
int digitCount() const;

View File

@ -58,7 +58,6 @@ class Q_WIDGETS_EXPORT QLineEdit : public QWidget
{
Q_OBJECT
Q_ENUMS(ActionPosition EchoMode)
Q_PROPERTY(QString inputMask READ inputMask WRITE setInputMask)
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged USER true)
Q_PROPERTY(int maxLength READ maxLength WRITE setMaxLength)
@ -83,6 +82,7 @@ public:
LeadingPosition,
TrailingPosition
};
Q_ENUM(ActionPosition)
explicit QLineEdit(QWidget* parent=0);
explicit QLineEdit(const QString &, QWidget* parent=0);
@ -105,6 +105,7 @@ public:
bool isClearButtonEnabled() const;
enum EchoMode { Normal, NoEcho, Password, PasswordEchoOnEdit };
Q_ENUM(EchoMode)
EchoMode echoMode() const;
void setEchoMode(EchoMode);

View File

@ -53,7 +53,6 @@ class Q_WIDGETS_EXPORT QMainWindow : public QWidget
{
Q_OBJECT
Q_ENUMS(DockOption)
Q_FLAGS(DockOptions)
Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
Q_PROPERTY(Qt::ToolButtonStyle toolButtonStyle READ toolButtonStyle WRITE setToolButtonStyle)
@ -80,6 +79,7 @@ public:
ForceTabbedDocks = 0x08, // implies AllowTabbedDocks, !AllowNestedDocks
VerticalTabs = 0x10 // implies AllowTabbedDocks
};
Q_ENUM(DockOption)
Q_DECLARE_FLAGS(DockOptions, DockOption)
explicit QMainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);

View File

@ -48,7 +48,6 @@ class QMdiAreaPrivate;
class Q_WIDGETS_EXPORT QMdiArea : public QAbstractScrollArea
{
Q_OBJECT
Q_ENUMS(ViewMode)
Q_PROPERTY(QBrush background READ background WRITE setBackground)
Q_PROPERTY(WindowOrder activationOrder READ activationOrder WRITE setActivationOrder)
Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode)
@ -61,7 +60,6 @@ class Q_WIDGETS_EXPORT QMdiArea : public QAbstractScrollArea
Q_PROPERTY(QTabWidget::TabShape tabShape READ tabShape WRITE setTabShape)
Q_PROPERTY(QTabWidget::TabPosition tabPosition READ tabPosition WRITE setTabPosition)
#endif
Q_ENUMS(WindowOrder)
public:
enum AreaOption {
DontMaximizeSubWindowOnActivation = 0x1
@ -73,11 +71,13 @@ public:
StackingOrder,
ActivationHistoryOrder
};
Q_ENUM(WindowOrder)
enum ViewMode {
SubWindowView,
TabbedView
};
Q_ENUM(ViewMode)
QMdiArea(QWidget *parent = 0);
~QMdiArea();

View File

@ -59,7 +59,6 @@ class Q_WIDGETS_EXPORT QPlainTextEdit : public QAbstractScrollArea
{
Q_OBJECT
Q_DECLARE_PRIVATE(QPlainTextEdit)
Q_ENUMS(LineWrapMode)
Q_PROPERTY(bool tabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus)
Q_PROPERTY(QString documentTitle READ documentTitle WRITE setDocumentTitle)
Q_PROPERTY(bool undoRedoEnabled READ isUndoRedoEnabled WRITE setUndoRedoEnabled)
@ -81,6 +80,7 @@ public:
NoWrap,
WidgetWidth
};
Q_ENUM(LineWrapMode)
explicit QPlainTextEdit(QWidget *parent = 0);
explicit QPlainTextEdit(const QString &text, QWidget *parent = 0);

View File

@ -47,7 +47,6 @@ class QStyleOptionProgressBar;
class Q_WIDGETS_EXPORT QProgressBar : public QWidget
{
Q_OBJECT
Q_ENUMS(Direction)
Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
Q_PROPERTY(QString text READ text)
@ -61,6 +60,7 @@ class Q_WIDGETS_EXPORT QProgressBar : public QWidget
public:
enum Direction { TopToBottom, BottomToTop };
Q_ENUM(Direction)
explicit QProgressBar(QWidget *parent = 0);
~QProgressBar();

View File

@ -47,7 +47,6 @@ class Q_WIDGETS_EXPORT QSlider : public QAbstractSlider
{
Q_OBJECT
Q_ENUMS(TickPosition)
Q_PROPERTY(TickPosition tickPosition READ tickPosition WRITE setTickPosition)
Q_PROPERTY(int tickInterval READ tickInterval WRITE setTickInterval)
@ -60,6 +59,7 @@ public:
TicksRight = TicksBelow,
TicksBothSides = 3
};
Q_ENUM(TickPosition)
explicit QSlider(QWidget *parent = 0);
explicit QSlider(Qt::Orientation orientation, QWidget *parent = 0);

View File

@ -49,7 +49,6 @@ class Q_WIDGETS_EXPORT QTabBar: public QWidget
{
Q_OBJECT
Q_ENUMS(Shape)
Q_PROPERTY(Shape shape READ shape WRITE setShape)
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
Q_PROPERTY(int count READ count)
@ -72,6 +71,7 @@ public:
enum Shape { RoundedNorth, RoundedSouth, RoundedWest, RoundedEast,
TriangularNorth, TriangularSouth, TriangularWest, TriangularEast
};
Q_ENUM(Shape)
enum ButtonPosition {
LeftSide,

View File

@ -49,7 +49,6 @@ class QStyleOptionTabWidgetFrame;
class Q_WIDGETS_EXPORT QTabWidget : public QWidget
{
Q_OBJECT
Q_ENUMS(TabPosition TabShape)
Q_PROPERTY(TabPosition tabPosition READ tabPosition WRITE setTabPosition)
Q_PROPERTY(TabShape tabShape READ tabShape WRITE setTabShape)
Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
@ -100,6 +99,7 @@ public:
int count() const;
enum TabPosition { North, South, West, East };
Q_ENUM(TabPosition)
TabPosition tabPosition() const;
void setTabPosition(TabPosition);
@ -110,6 +110,7 @@ public:
void setMovable(bool movable);
enum TabShape { Rounded, Triangular };
Q_ENUM(TabShape)
TabShape tabShape() const;
void setTabShape(TabShape s);

View File

@ -58,7 +58,6 @@ class Q_WIDGETS_EXPORT QTextEdit : public QAbstractScrollArea
Q_OBJECT
Q_DECLARE_PRIVATE(QTextEdit)
Q_FLAGS(AutoFormatting)
Q_ENUMS(LineWrapMode)
Q_PROPERTY(AutoFormatting autoFormatting READ autoFormatting WRITE setAutoFormatting)
Q_PROPERTY(bool tabChangesFocus READ tabChangesFocus WRITE setTabChangesFocus)
Q_PROPERTY(QString documentTitle READ documentTitle WRITE setDocumentTitle)
@ -85,6 +84,7 @@ public:
FixedPixelWidth,
FixedColumnWidth
};
Q_ENUM(LineWrapMode)
enum AutoFormattingFlag {
AutoNone = 0,

View File

@ -48,7 +48,7 @@ class QStyleOptionToolButton;
class Q_WIDGETS_EXPORT QToolButton : public QAbstractButton
{
Q_OBJECT
Q_ENUMS(Qt::ToolButtonStyle Qt::ArrowType ToolButtonPopupMode)
Q_ENUMS(Qt::ToolButtonStyle Qt::ArrowType)
#ifndef QT_NO_MENU
Q_PROPERTY(ToolButtonPopupMode popupMode READ popupMode WRITE setPopupMode)
#endif
@ -62,6 +62,7 @@ public:
MenuButtonPopup,
InstantPopup
};
Q_ENUM(ToolButtonPopupMode)
explicit QToolButton(QWidget * parent=0);
~QToolButton();