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:
Jarek Kobus
2020-12-08 17:32:27 +01:00
parent dce06016ef
commit d42f38cc96
17 changed files with 19 additions and 29 deletions

View File

@@ -45,7 +45,6 @@ class ShellCommand;
class CORE_EXPORT IVersionControl : public QObject
{
Q_OBJECT
Q_ENUMS(SettingsFlag Operation)
public:
enum SettingsFlag {
AutoOpen = 0x1
@@ -59,6 +58,8 @@ public:
AnnotateOperation,
InitialCheckoutOperation
};
Q_ENUM(SettingsFlag)
Q_ENUM(Operation)
enum OpenSupportMode {
NoOpen, /*!< Files can be edited without noticing the VCS */

View File

@@ -32,7 +32,6 @@
#include <QHBoxLayout>
#include <QLabel>
#include <QMetaEnum>
#include <QPainter>
#include <QPixmap>
#include <QUrl>

View File

@@ -35,8 +35,6 @@ struct NewClassWidgetPrivate;
class NewClassWidget : public QWidget
{
Q_OBJECT
Q_ENUMS(ClassType)
public:
enum ClassType { NoClassType,
ClassInheritsQObject,
@@ -45,6 +43,7 @@ public:
ClassInheritsQQuickItem,
SharedDataClass
};
Q_ENUM(ClassType)
explicit NewClassWidget(QWidget *parent = nullptr);
~NewClassWidget() override;

View File

@@ -39,7 +39,6 @@ class PerfProfilerFlameGraphModel : public QAbstractItemModel
{
Q_OBJECT
Q_DISABLE_COPY(PerfProfilerFlameGraphModel);
Q_ENUMS(Role)
public:
PerfProfilerFlameGraphModel(PerfProfilerFlameGraphModel &&) = delete;
PerfProfilerFlameGraphModel &operator=(PerfProfilerFlameGraphModel &&) = delete;
@@ -61,6 +60,7 @@ public:
ResourcePeakRole,
MaxRole
};
Q_ENUM(Role)
struct Data {
Data *parent = nullptr;

View File

@@ -41,9 +41,6 @@ namespace QmlDesigner {
class QMLDESIGNERCORE_EXPORT Theme : public Utils::Theme
{
Q_OBJECT
Q_ENUMS(Icon)
public:
enum Icon {
actionIcon,
@@ -146,6 +143,7 @@ public:
zoomOut,
zoomSelection
};
Q_ENUM(Icon)
static Theme *instance();
static QString replaceCssColors(const QString &input);

View File

@@ -74,14 +74,13 @@ class QmlAnchorBindingProxy : public QObject
Q_PROPERTY(QStringList possibleTargetItems READ possibleTargetItems NOTIFY itemNodeChanged)
Q_ENUMS(RelativeAnchorTarget)
public:
enum RelativeAnchorTarget {
SameEdge = 0,
Center = 1,
OppositeEdge = 2
};
Q_ENUM(RelativeAnchorTarget)
//only enable if node has parent

View File

@@ -55,7 +55,6 @@ struct FlameGraphData {
class FlameGraphModel : public QAbstractItemModel
{
Q_OBJECT
Q_ENUMS(Role)
public:
enum Role {
TypeIdRole = Qt::UserRole + 1, // Sort by data, not by displayed string
@@ -74,6 +73,7 @@ public:
MemoryRole,
MaxRole
};
Q_ENUM(Role)
FlameGraphModel(QmlProfilerModelManager *modelManager, QObject *parent = nullptr);

View File

@@ -31,7 +31,6 @@
#include <QFile>
#include <QCoreApplication>
#include <QMetaEnum>
#include <QXmlStreamWriter>
using namespace TextEditor;

View File

@@ -41,13 +41,13 @@ class UpdateInfoPlugin final : public ExtensionSystem::IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "UpdateInfo.json")
Q_ENUMS(CheckUpdateInterval)
public:
enum CheckUpdateInterval {
DailyCheck,
WeeklyCheck,
MonthlyCheck
};
Q_ENUM(CheckUpdateInterval)
UpdateInfoPlugin();
~UpdateInfoPlugin() override;

View File

@@ -38,8 +38,6 @@ namespace Callgrind {
class CallgrindController : public QObject
{
Q_OBJECT
Q_ENUMS(Option)
public:
enum Option {
Unknown,
@@ -48,6 +46,7 @@ public:
Pause,
UnPause
};
Q_ENUM(Option)
CallgrindController();
~CallgrindController() override;