forked from qt-creator/qt-creator
Use Q_ENUM instead of obsoleted Q_ENUMS
It fixes the following warning:
Use Q_ENUM instead of Q_ENUMS [clazy-qenums]
In addition, it amends 8588cf268f
where WidgetStyle got removed.
Change-Id: I4d72dd762a2f18ba8886360b3581b4ef19bf4c5e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -176,7 +176,7 @@ public: // must be public to make Q_GADGET introspection work
|
|||||||
case_start, // after a 'case' or 'default' token
|
case_start, // after a 'case' or 'default' token
|
||||||
case_cont // after the colon in a case/default
|
case_cont // after the colon in a case/default
|
||||||
};
|
};
|
||||||
Q_ENUMS(StateType)
|
Q_ENUM(StateType)
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// extends Token::Kind from qmljsscanner.h
|
// extends Token::Kind from qmljsscanner.h
|
||||||
|
@@ -44,7 +44,6 @@ class QTCREATOR_UTILS_EXPORT DetailsWidget : public QWidget
|
|||||||
Q_PROPERTY(bool useCheckBox READ useCheckBox WRITE setUseCheckBox DESIGNABLE true)
|
Q_PROPERTY(bool useCheckBox READ useCheckBox WRITE setUseCheckBox DESIGNABLE true)
|
||||||
Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE true)
|
Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE true)
|
||||||
Q_PROPERTY(State state READ state WRITE setState)
|
Q_PROPERTY(State state READ state WRITE setState)
|
||||||
Q_ENUMS(State)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum State {
|
enum State {
|
||||||
@@ -53,6 +52,7 @@ public:
|
|||||||
NoSummary,
|
NoSummary,
|
||||||
OnlySummary
|
OnlySummary
|
||||||
};
|
};
|
||||||
|
Q_ENUM(State)
|
||||||
|
|
||||||
explicit DetailsWidget(QWidget *parent = nullptr);
|
explicit DetailsWidget(QWidget *parent = nullptr);
|
||||||
~DetailsWidget() override;
|
~DetailsWidget() override;
|
||||||
|
@@ -71,10 +71,9 @@ private:
|
|||||||
class QTCREATOR_UTILS_EXPORT FancyLineEdit : public CompletingLineEdit
|
class QTCREATOR_UTILS_EXPORT FancyLineEdit : public CompletingLineEdit
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_ENUMS(Side)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum Side {Left = 0, Right = 1};
|
enum Side {Left = 0, Right = 1};
|
||||||
|
Q_ENUM(Side)
|
||||||
|
|
||||||
explicit FancyLineEdit(QWidget *parent = nullptr);
|
explicit FancyLineEdit(QWidget *parent = nullptr);
|
||||||
~FancyLineEdit() override;
|
~FancyLineEdit() override;
|
||||||
|
@@ -32,7 +32,6 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QMetaEnum>
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPaintEngine>
|
#include <QPaintEngine>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
@@ -33,13 +33,13 @@ namespace Utils {
|
|||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT ParameterAction : public QAction
|
class QTCREATOR_UTILS_EXPORT ParameterAction : public QAction
|
||||||
{
|
{
|
||||||
Q_ENUMS(EnablingMode)
|
|
||||||
Q_PROPERTY(QString emptyText READ emptyText WRITE setEmptyText)
|
Q_PROPERTY(QString emptyText READ emptyText WRITE setEmptyText)
|
||||||
Q_PROPERTY(QString parameterText READ parameterText WRITE setParameterText)
|
Q_PROPERTY(QString parameterText READ parameterText WRITE setParameterText)
|
||||||
Q_PROPERTY(EnablingMode enablingMode READ enablingMode WRITE setEnablingMode)
|
Q_PROPERTY(EnablingMode enablingMode READ enablingMode WRITE setEnablingMode)
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
enum EnablingMode { AlwaysEnabled, EnabledWithParameter };
|
enum EnablingMode { AlwaysEnabled, EnabledWithParameter };
|
||||||
|
Q_ENUM(EnablingMode)
|
||||||
|
|
||||||
explicit ParameterAction(const QString &emptyText,
|
explicit ParameterAction(const QString &emptyText,
|
||||||
const QString ¶meterText,
|
const QString ¶meterText,
|
||||||
|
@@ -46,7 +46,6 @@ class PathChooserPrivate;
|
|||||||
class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget
|
class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_ENUMS(Kind)
|
|
||||||
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged DESIGNABLE true)
|
Q_PROPERTY(QString path READ path WRITE setPath NOTIFY pathChanged DESIGNABLE true)
|
||||||
Q_PROPERTY(QString promptDialogTitle READ promptDialogTitle WRITE setPromptDialogTitle DESIGNABLE true)
|
Q_PROPERTY(QString promptDialogTitle READ promptDialogTitle WRITE setPromptDialogTitle DESIGNABLE true)
|
||||||
Q_PROPERTY(QString promptDialogFilter READ promptDialogFilter WRITE setPromptDialogFilter DESIGNABLE true)
|
Q_PROPERTY(QString promptDialogFilter READ promptDialogFilter WRITE setPromptDialogFilter DESIGNABLE true)
|
||||||
@@ -72,6 +71,7 @@ public:
|
|||||||
Command, // A command that may or may not exist at the time of selection (e.g. result of a build)
|
Command, // A command that may or may not exist at the time of selection (e.g. result of a build)
|
||||||
Any
|
Any
|
||||||
};
|
};
|
||||||
|
Q_ENUM(Kind)
|
||||||
|
|
||||||
// Default is <Directory>
|
// Default is <Directory>
|
||||||
void setExpectedKind(Kind expected);
|
void setExpectedKind(Kind expected);
|
||||||
|
@@ -40,13 +40,6 @@ class ThemePrivate;
|
|||||||
class QTCREATOR_UTILS_EXPORT Theme : public QObject
|
class QTCREATOR_UTILS_EXPORT Theme : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_ENUMS(Color)
|
|
||||||
Q_ENUMS(ImageFile)
|
|
||||||
Q_ENUMS(Gradient)
|
|
||||||
Q_ENUMS(Flag)
|
|
||||||
Q_ENUMS(WidgetStyle)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Theme(const QString &id, QObject *parent = nullptr);
|
Theme(const QString &id, QObject *parent = nullptr);
|
||||||
~Theme() override;
|
~Theme() override;
|
||||||
@@ -381,6 +374,11 @@ public:
|
|||||||
DarkUserInterface
|
DarkUserInterface
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Q_ENUM(Color)
|
||||||
|
Q_ENUM(ImageFile)
|
||||||
|
Q_ENUM(Gradient)
|
||||||
|
Q_ENUM(Flag)
|
||||||
|
|
||||||
Q_INVOKABLE bool flag(Flag f) const;
|
Q_INVOKABLE bool flag(Flag f) const;
|
||||||
Q_INVOKABLE QColor color(Color role) const;
|
Q_INVOKABLE QColor color(Color role) const;
|
||||||
QString imageFile(ImageFile imageFile, const QString &fallBack) const;
|
QString imageFile(ImageFile imageFile, const QString &fallBack) const;
|
||||||
|
@@ -45,7 +45,6 @@ class ShellCommand;
|
|||||||
class CORE_EXPORT IVersionControl : public QObject
|
class CORE_EXPORT IVersionControl : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_ENUMS(SettingsFlag Operation)
|
|
||||||
public:
|
public:
|
||||||
enum SettingsFlag {
|
enum SettingsFlag {
|
||||||
AutoOpen = 0x1
|
AutoOpen = 0x1
|
||||||
@@ -59,6 +58,8 @@ public:
|
|||||||
AnnotateOperation,
|
AnnotateOperation,
|
||||||
InitialCheckoutOperation
|
InitialCheckoutOperation
|
||||||
};
|
};
|
||||||
|
Q_ENUM(SettingsFlag)
|
||||||
|
Q_ENUM(Operation)
|
||||||
|
|
||||||
enum OpenSupportMode {
|
enum OpenSupportMode {
|
||||||
NoOpen, /*!< Files can be edited without noticing the VCS */
|
NoOpen, /*!< Files can be edited without noticing the VCS */
|
||||||
|
@@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QMetaEnum>
|
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
@@ -35,8 +35,6 @@ struct NewClassWidgetPrivate;
|
|||||||
class NewClassWidget : public QWidget
|
class NewClassWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_ENUMS(ClassType)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum ClassType { NoClassType,
|
enum ClassType { NoClassType,
|
||||||
ClassInheritsQObject,
|
ClassInheritsQObject,
|
||||||
@@ -45,6 +43,7 @@ public:
|
|||||||
ClassInheritsQQuickItem,
|
ClassInheritsQQuickItem,
|
||||||
SharedDataClass
|
SharedDataClass
|
||||||
};
|
};
|
||||||
|
Q_ENUM(ClassType)
|
||||||
explicit NewClassWidget(QWidget *parent = nullptr);
|
explicit NewClassWidget(QWidget *parent = nullptr);
|
||||||
~NewClassWidget() override;
|
~NewClassWidget() override;
|
||||||
|
|
||||||
|
@@ -39,7 +39,6 @@ class PerfProfilerFlameGraphModel : public QAbstractItemModel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_DISABLE_COPY(PerfProfilerFlameGraphModel);
|
Q_DISABLE_COPY(PerfProfilerFlameGraphModel);
|
||||||
Q_ENUMS(Role)
|
|
||||||
public:
|
public:
|
||||||
PerfProfilerFlameGraphModel(PerfProfilerFlameGraphModel &&) = delete;
|
PerfProfilerFlameGraphModel(PerfProfilerFlameGraphModel &&) = delete;
|
||||||
PerfProfilerFlameGraphModel &operator=(PerfProfilerFlameGraphModel &&) = delete;
|
PerfProfilerFlameGraphModel &operator=(PerfProfilerFlameGraphModel &&) = delete;
|
||||||
@@ -61,6 +60,7 @@ public:
|
|||||||
ResourcePeakRole,
|
ResourcePeakRole,
|
||||||
MaxRole
|
MaxRole
|
||||||
};
|
};
|
||||||
|
Q_ENUM(Role)
|
||||||
|
|
||||||
struct Data {
|
struct Data {
|
||||||
Data *parent = nullptr;
|
Data *parent = nullptr;
|
||||||
|
@@ -41,9 +41,6 @@ namespace QmlDesigner {
|
|||||||
class QMLDESIGNERCORE_EXPORT Theme : public Utils::Theme
|
class QMLDESIGNERCORE_EXPORT Theme : public Utils::Theme
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_ENUMS(Icon)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum Icon {
|
enum Icon {
|
||||||
actionIcon,
|
actionIcon,
|
||||||
@@ -146,6 +143,7 @@ public:
|
|||||||
zoomOut,
|
zoomOut,
|
||||||
zoomSelection
|
zoomSelection
|
||||||
};
|
};
|
||||||
|
Q_ENUM(Icon)
|
||||||
|
|
||||||
static Theme *instance();
|
static Theme *instance();
|
||||||
static QString replaceCssColors(const QString &input);
|
static QString replaceCssColors(const QString &input);
|
||||||
|
@@ -74,14 +74,13 @@ class QmlAnchorBindingProxy : public QObject
|
|||||||
|
|
||||||
Q_PROPERTY(QStringList possibleTargetItems READ possibleTargetItems NOTIFY itemNodeChanged)
|
Q_PROPERTY(QStringList possibleTargetItems READ possibleTargetItems NOTIFY itemNodeChanged)
|
||||||
|
|
||||||
Q_ENUMS(RelativeAnchorTarget)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum RelativeAnchorTarget {
|
enum RelativeAnchorTarget {
|
||||||
SameEdge = 0,
|
SameEdge = 0,
|
||||||
Center = 1,
|
Center = 1,
|
||||||
OppositeEdge = 2
|
OppositeEdge = 2
|
||||||
};
|
};
|
||||||
|
Q_ENUM(RelativeAnchorTarget)
|
||||||
|
|
||||||
//only enable if node has parent
|
//only enable if node has parent
|
||||||
|
|
||||||
|
@@ -55,7 +55,6 @@ struct FlameGraphData {
|
|||||||
class FlameGraphModel : public QAbstractItemModel
|
class FlameGraphModel : public QAbstractItemModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_ENUMS(Role)
|
|
||||||
public:
|
public:
|
||||||
enum Role {
|
enum Role {
|
||||||
TypeIdRole = Qt::UserRole + 1, // Sort by data, not by displayed string
|
TypeIdRole = Qt::UserRole + 1, // Sort by data, not by displayed string
|
||||||
@@ -74,6 +73,7 @@ public:
|
|||||||
MemoryRole,
|
MemoryRole,
|
||||||
MaxRole
|
MaxRole
|
||||||
};
|
};
|
||||||
|
Q_ENUM(Role)
|
||||||
|
|
||||||
FlameGraphModel(QmlProfilerModelManager *modelManager, QObject *parent = nullptr);
|
FlameGraphModel(QmlProfilerModelManager *modelManager, QObject *parent = nullptr);
|
||||||
|
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QMetaEnum>
|
|
||||||
#include <QXmlStreamWriter>
|
#include <QXmlStreamWriter>
|
||||||
|
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
|
@@ -41,13 +41,13 @@ class UpdateInfoPlugin final : public ExtensionSystem::IPlugin
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "UpdateInfo.json")
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "UpdateInfo.json")
|
||||||
Q_ENUMS(CheckUpdateInterval)
|
|
||||||
public:
|
public:
|
||||||
enum CheckUpdateInterval {
|
enum CheckUpdateInterval {
|
||||||
DailyCheck,
|
DailyCheck,
|
||||||
WeeklyCheck,
|
WeeklyCheck,
|
||||||
MonthlyCheck
|
MonthlyCheck
|
||||||
};
|
};
|
||||||
|
Q_ENUM(CheckUpdateInterval)
|
||||||
|
|
||||||
UpdateInfoPlugin();
|
UpdateInfoPlugin();
|
||||||
~UpdateInfoPlugin() override;
|
~UpdateInfoPlugin() override;
|
||||||
|
@@ -38,8 +38,6 @@ namespace Callgrind {
|
|||||||
class CallgrindController : public QObject
|
class CallgrindController : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_ENUMS(Option)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum Option {
|
enum Option {
|
||||||
Unknown,
|
Unknown,
|
||||||
@@ -48,6 +46,7 @@ public:
|
|||||||
Pause,
|
Pause,
|
||||||
UnPause
|
UnPause
|
||||||
};
|
};
|
||||||
|
Q_ENUM(Option)
|
||||||
|
|
||||||
CallgrindController();
|
CallgrindController();
|
||||||
~CallgrindController() override;
|
~CallgrindController() override;
|
||||||
|
Reference in New Issue
Block a user