Skip to content

Commit

Permalink
Flip Q_ENUMS to Q_ENUM
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 29, 2017
1 parent 51170ae commit 1fddfcf
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 20 deletions.
1 change: 1 addition & 0 deletions python/core/qgsdataitem.sip
Expand Up @@ -52,6 +52,7 @@ class QgsDataItem : QObject
Project
};


QgsDataItem( QgsDataItem::Type type, QgsDataItem *parent /TransferThis/, const QString &name, const QString &path );
%Docstring
Create new data item.
Expand Down
1 change: 0 additions & 1 deletion python/core/qgsdataprovider.sip
Expand Up @@ -46,7 +46,6 @@ class QgsDataProvider : QObject
%End
public:


enum DataCapability
{
NoDataCapabilities,
Expand Down
1 change: 1 addition & 0 deletions python/gui/attributetable/qgsdualview.sip
Expand Up @@ -34,6 +34,7 @@ class QgsDualView : QStackedWidget
AttributeEditor
};


explicit QgsDualView( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsfontbutton.sip
Expand Up @@ -31,13 +31,13 @@ class QgsFontButton : QToolButton
%End
public:


enum Mode
{
ModeTextRenderer,
ModeQFont,
};


QgsFontButton( QWidget *parent /TransferThis/ = 0, const QString &dialogTitle = QString() );
%Docstring
Construct a new font button.
Expand Down
2 changes: 1 addition & 1 deletion scripts/sipify.pl
Expand Up @@ -464,7 +464,7 @@ sub detect_comment_block{
next;
}
# Skip Q_OBJECT, Q_PROPERTY, Q_ENUM, Q_GADGET etc.
if ($LINE =~ m/^\s*Q_(OBJECT|ENUMS|PROPERTY|GADGET|DECLARE_METATYPE|DECLARE_TYPEINFO|DECL_DEPRECATED|NOWARN_DEPRECATED_(PUSH|POP)).*?$/){
if ($LINE =~ m/^\s*Q_(OBJECT|ENUMS|ENUM|PROPERTY|GADGET|DECLARE_METATYPE|DECLARE_TYPEINFO|DECL_DEPRECATED|NOWARN_DEPRECATED_(PUSH|POP)).*?$/){
next;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/auth/qgsauthmanager.h
Expand Up @@ -60,7 +60,6 @@ class QTimer;
class CORE_EXPORT QgsAuthManager : public QObject
{
Q_OBJECT
Q_ENUMS( MessageLevel )

public:

Expand All @@ -71,6 +70,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
WARNING = 1,
CRITICAL = 2
};
Q_ENUM( MessageLevel );

/** Enforce singleton pattern
* \note To set up the manager instance and initialize everything use QgsAuthManager::instance()->init()
Expand Down
1 change: 0 additions & 1 deletion src/core/qgsapplication.cpp
Expand Up @@ -146,7 +146,6 @@ void QgsApplication::init( QString profileFolder )
qRegisterMetaType<QgsGeometry::Error>( "QgsGeometry::Error" );
qRegisterMetaType<QgsProcessingFeatureSourceDefinition>( "QgsProcessingFeatureSourceDefinition" );
qRegisterMetaType<QgsProcessingOutputLayerDefinition>( "QgsProcessingOutputLayerDefinition" );
qRegisterMetaType<QgsUnitTypes::LayoutUnit>( "QgsUnitTypes::LayoutUnit" );
qRegisterMetaType<QgsFeatureIds>( "QgsFeatureIds" );

QString prefixPath( getenv( "QGIS_PREFIX_PATH" ) ? getenv( "QGIS_PREFIX_PATH" ) : applicationDirPath() );
Expand Down
10 changes: 6 additions & 4 deletions src/core/qgsdataitem.h
Expand Up @@ -69,8 +69,7 @@ class CORE_EXPORT QgsDataItem : public QObject
#endif

Q_OBJECT
Q_ENUMS( Type )
Q_ENUMS( State )

public:
enum Type
{
Expand All @@ -82,6 +81,8 @@ class CORE_EXPORT QgsDataItem : public QObject
Project //!< Represents a QGIS project
};

Q_ENUM( Type );

//! Create new data item.
QgsDataItem( QgsDataItem::Type type, QgsDataItem *parent SIP_TRANSFERTHIS, const QString &name, const QString &path );
virtual ~QgsDataItem();
Expand All @@ -100,6 +101,7 @@ class CORE_EXPORT QgsDataItem : public QObject
Populating, //!< Creating children in separate thread (populating or refreshing)
Populated //!< Children created
};
Q_ENUM( State );

//! \since QGIS 2.8
State state() const;
Expand Down Expand Up @@ -328,7 +330,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS( QgsDataItem::Capabilities )
class CORE_EXPORT QgsLayerItem : public QgsDataItem
{
Q_OBJECT
Q_ENUMS( LayerType )

public:
enum LayerType
{
Expand All @@ -344,7 +346,7 @@ class CORE_EXPORT QgsLayerItem : public QgsDataItem
Plugin //!< Added in 2.10
};

Q_ENUMS( LayerType )
Q_ENUM( LayerType );

QgsLayerItem( QgsDataItem *parent, const QString &name, const QString &path, const QString &uri, LayerType layerType, const QString &providerKey );

Expand Down
3 changes: 1 addition & 2 deletions src/core/qgsdataprovider.h
Expand Up @@ -67,8 +67,6 @@ class CORE_EXPORT QgsDataProvider : public QObject

public:

Q_ENUMS( DataCapability )

enum DataCapability
{
NoDataCapabilities = 0,
Expand All @@ -77,6 +75,7 @@ class CORE_EXPORT QgsDataProvider : public QObject
Database = 1 << 2,
Net = 1 << 3 // Internet source
};
Q_ENUM( DataCapability );

/**
* Properties are used to pass custom configuration options into data providers.
Expand Down
1 change: 0 additions & 1 deletion src/core/qgsmessagelog.cpp
Expand Up @@ -25,7 +25,6 @@ class QgsMessageLogConsole;
QgsMessageLog::QgsMessageLog()
: QObject()
{
qRegisterMetaType< QgsMessageLog::MessageLevel >( "QgsMessageLog::MessageLevel" );
}

void QgsMessageLog::logMessage( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmessagelog.h
Expand Up @@ -36,7 +36,6 @@
class CORE_EXPORT QgsMessageLog : public QObject
{
Q_OBJECT
Q_ENUMS( MessageLevel )

public:

Expand All @@ -48,6 +47,7 @@ class CORE_EXPORT QgsMessageLog : public QObject
CRITICAL = 2,
NONE = 3
};
Q_ENUM( MessageLevel );

QgsMessageLog();

Expand Down
5 changes: 5 additions & 0 deletions src/core/qgsunittypes.h
Expand Up @@ -52,6 +52,7 @@ class CORE_EXPORT QgsUnitTypes
DistanceMillimeters, //!< Millimeters
DistanceUnknownUnit, //!< Unknown distance unit
};
Q_ENUM( DistanceUnit );

/** Types of distance units
*/
Expand All @@ -78,6 +79,7 @@ class CORE_EXPORT QgsUnitTypes
AreaSquareMillimeters, //! Square millimeters
AreaUnknownUnit, //!< Unknown areal unit
};
Q_ENUM( AreaUnit );

//! Units of angles
enum AngleUnit
Expand All @@ -90,6 +92,7 @@ class CORE_EXPORT QgsUnitTypes
AngleTurn, //!< Turn/revolutions
AngleUnknownUnit, //!< Unknown angle unit
};
Q_ENUM( AngleUnit );

//! Rendering size units
enum RenderUnit
Expand All @@ -103,6 +106,7 @@ class CORE_EXPORT QgsUnitTypes
RenderUnknownUnit, //!< Mixed or unknown units
RenderMetersInMapUnits, //!< Meters value as Map units
};
Q_ENUM( RenderUnit );

//! Layout measurement units
enum LayoutUnit
Expand All @@ -116,6 +120,7 @@ class CORE_EXPORT QgsUnitTypes
LayoutPicas, //!< Typographic picas
LayoutPixels //!< Pixels
};
Q_ENUM( LayoutUnit );

//! Types of layout units
enum LayoutUnitType
Expand Down
3 changes: 2 additions & 1 deletion src/gui/attributetable/qgsdualview.h
Expand Up @@ -42,7 +42,6 @@ class QgsScrollArea;
class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBase
{
Q_OBJECT
Q_ENUMS( ViewMode )

public:

Expand All @@ -67,6 +66,8 @@ class GUI_EXPORT QgsDualView : public QStackedWidget, private Ui::QgsDualViewBas
AttributeEditor = 1
};

Q_ENUM( ViewMode );

/**
* \brief Constructor
* \param parent The parent widget
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgscolorbutton.h
Expand Up @@ -46,7 +46,6 @@ class GUI_EXPORT QgsColorButton : public QToolButton


Q_OBJECT
Q_ENUMS( Behavior )
Q_PROPERTY( QString colorDialogTitle READ colorDialogTitle WRITE setColorDialogTitle )
Q_PROPERTY( bool acceptLiveUpdates READ acceptLiveUpdates WRITE setAcceptLiveUpdates )
Q_PROPERTY( QColor color READ color WRITE setColor )
Expand All @@ -67,6 +66,7 @@ class GUI_EXPORT QgsColorButton : public QToolButton
ShowDialog = 0, //!< Show a color picker dialog when clicked
SignalOnly //!< Emit colorClicked signal only, no dialog
};
Q_ENUM( Behavior );

/** Construct a new color ramp button.
* Use \a parent to attach a parent QWidget to the dialog.
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsfilterlineedit.h
Expand Up @@ -47,7 +47,6 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
#endif

Q_OBJECT
Q_ENUMS( ClearMode )
Q_PROPERTY( ClearMode clearMode READ clearMode WRITE setClearMode )
Q_PROPERTY( QString nullValue READ nullValue WRITE setNullValue )
Q_PROPERTY( QString defaultValue READ defaultValue WRITE setDefaultValue )
Expand All @@ -63,6 +62,7 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
ClearToNull = 0, //!< Reset value to null
ClearToDefault, //!< Reset value to default value (see defaultValue() )
};
Q_ENUM( ClearMode );

/** Constructor for QgsFilterLineEdit.
* \param parent parent widget
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsfloatingwidget.h
Expand Up @@ -32,7 +32,6 @@ class QgsFloatingWidgetEventFilter;
class GUI_EXPORT QgsFloatingWidget: public QWidget
{
Q_OBJECT
Q_ENUMS( AnchorPoint )
Q_PROPERTY( QWidget *anchorWidget READ anchorWidget WRITE setAnchorWidget NOTIFY anchorWidgetChanged )
Q_PROPERTY( AnchorPoint anchorPoint READ anchorPoint WRITE setAnchorPoint NOTIFY anchorPointChanged )
Q_PROPERTY( AnchorPoint anchorWidgetPoint READ anchorWidgetPoint WRITE setAnchorWidgetPoint NOTIFY anchorWidgetPointChanged )
Expand All @@ -52,6 +51,7 @@ class GUI_EXPORT QgsFloatingWidget: public QWidget
BottomMiddle, //!< Bottom center of widget
BottomRight, //!< Bottom-right of widget
};
Q_ENUM( AnchorPoint );

/** Constructor for QgsFloatingWidget.
* \param parent parent widget
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsfontbutton.h
Expand Up @@ -50,15 +50,15 @@ class GUI_EXPORT QgsFontButton : public QToolButton

public:

Q_ENUMS( Mode )

//! Available button modes.
enum Mode
{
ModeTextRenderer, //!< Configure font settings for use with QgsTextRenderer
ModeQFont, //!< Configure font settings for use with QFont objects
};

Q_ENUM( Mode );

/**
* Construct a new font button.
* Use \a parent to attach a parent QWidget to the dialog.
Expand Down
1 change: 0 additions & 1 deletion tests/src/analysis/testqgsrastercalculator.cpp
Expand Up @@ -25,7 +25,6 @@ Email : nyall dot dawson at gmail dot com

Q_DECLARE_METATYPE( QgsRasterCalcNode::Operator )


class TestQgsRasterCalculator : public QObject
{
Q_OBJECT
Expand Down

0 comments on commit 1fddfcf

Please sign in to comment.