Skip to content

Commit

Permalink
Qt 5.5 prefers Q_FLAG over Q_FLAGS
Browse files Browse the repository at this point in the history
this also allow to use QMetaEnum for flags
  • Loading branch information
3nids committed Feb 19, 2018
1 parent 1a1b197 commit 42908eb
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsfieldproxymodel.h
Expand Up @@ -32,7 +32,6 @@ class QgsFieldModel;
class CORE_EXPORT QgsFieldProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
Q_FLAGS( Filters )

public:

Expand All @@ -50,6 +49,7 @@ class CORE_EXPORT QgsFieldProxyModel : public QSortFilterProxyModel
AllTypes = Numeric | Date | String | Time, //!< All field types
};
Q_DECLARE_FLAGS( Filters, Filter )
Q_FLAG( Filters )

/**
* \brief QgsFieldProxModel creates a proxy model with a QgsFieldModel as source model.
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayerproxymodel.h
Expand Up @@ -33,7 +33,6 @@ class QgsMapLayer;
class CORE_EXPORT QgsMapLayerProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
Q_FLAGS( Filters )

Q_PROPERTY( QgsMapLayerProxyModel::Filters filters READ filters WRITE setFilters )
Q_PROPERTY( QList<QgsMapLayer *> exceptedLayerList READ exceptedLayerList WRITE setExceptedLayerList )
Expand All @@ -54,6 +53,7 @@ class CORE_EXPORT QgsMapLayerProxyModel : public QSortFilterProxyModel
All = RasterLayer | VectorLayer | PluginLayer
};
Q_DECLARE_FLAGS( Filters, Filter )
Q_FLAG( Filters )

/**
* \brief QgsMapLayerProxModel creates a proxy model with a QgsMapLayerModel as source model.
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsadvanceddigitizingdockwidget.h
Expand Up @@ -42,7 +42,6 @@ class QgsPointXY;
class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private Ui::QgsAdvancedDigitizingDockWidgetBase
{
Q_OBJECT
Q_FLAGS( CadCapacities )

public:

Expand All @@ -58,6 +57,7 @@ class GUI_EXPORT QgsAdvancedDigitizingDockWidget : public QgsDockWidget, private
RelativeCoordinates = 4, //!< This corresponds to distance and relative coordinates
};
Q_DECLARE_FLAGS( CadCapacities, CadCapacity )
Q_FLAG( CadCapacities )

/**
* Additional constraints which can be enabled
Expand Down
1 change: 0 additions & 1 deletion src/gui/qgsfieldcombobox.h
Expand Up @@ -37,7 +37,6 @@ class QgsVectorLayer;
class GUI_EXPORT QgsFieldComboBox : public QComboBox
{
Q_OBJECT
Q_FLAGS( QgsFieldProxyModel::Filters )
Q_PROPERTY( QgsFieldProxyModel::Filters filters READ filters WRITE setFilters )
Q_PROPERTY( bool allowEmptyFieldName READ allowEmptyFieldName WRITE setAllowEmptyFieldName )

Expand Down
2 changes: 0 additions & 2 deletions src/gui/qgsfieldexpressionwidget.h
Expand Up @@ -50,8 +50,6 @@ class GUI_EXPORT QgsFieldExpressionWidget : public QWidget
Q_PROPERTY( QgsFieldProxyModel::Filters filters READ filters WRITE setFilters )
Q_PROPERTY( bool allowEvalErrors READ allowEvalErrors WRITE setAllowEvalErrors NOTIFY allowEvalErrorsChanged )

Q_FLAGS( QgsFieldProxyModel::Filters )

public:

/**
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmaplayeractionregistry.h
Expand Up @@ -34,7 +34,6 @@ class QgsFeature;
class GUI_EXPORT QgsMapLayerAction : public QAction
{
Q_OBJECT
Q_FLAGS( Availability )

public:
enum Target
Expand All @@ -45,6 +44,7 @@ class GUI_EXPORT QgsMapLayerAction : public QAction
AllActions = Layer | SingleFeature | MultipleFeatures
};
Q_DECLARE_FLAGS( Targets, Target )
Q_FLAG( Targets )

/**
* Creates a map layer action which can run on any layer
Expand Down
1 change: 0 additions & 1 deletion src/gui/qgsmaplayercombobox.h
Expand Up @@ -34,7 +34,6 @@ class QgsVectorLayer;
class GUI_EXPORT QgsMapLayerComboBox : public QComboBox
{
Q_OBJECT
Q_FLAGS( QgsMapLayerProxyModel::Filters )
Q_PROPERTY( QgsMapLayerProxyModel::Filters filters READ filters WRITE setFilters )
Q_PROPERTY( bool allowEmptyLayer READ allowEmptyLayer WRITE setAllowEmptyLayer )
Q_PROPERTY( bool showCrs READ showCrs WRITE setShowCrs )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmaptoolidentify.h
Expand Up @@ -46,7 +46,6 @@ class QgsDistanceArea;
class GUI_EXPORT QgsMapToolIdentify : public QgsMapTool
{
Q_OBJECT
Q_FLAGS( LayerType )

public:

Expand All @@ -67,6 +66,7 @@ class GUI_EXPORT QgsMapToolIdentify : public QgsMapTool
AllLayers = VectorLayer | RasterLayer
};
Q_DECLARE_FLAGS( LayerType, Type )
Q_FLAG( LayerType )

struct IdentifyResult
{
Expand Down

0 comments on commit 42908eb

Please sign in to comment.