Skip to content
Permalink
Browse files

more flag operators declaration in SIP, better use of flags in data d…

…efined button
  • Loading branch information
3nids committed Sep 1, 2014
1 parent 8a65115 commit 5b1a516f2ecfb673e8d360ec734665a7a34a05bc
@@ -6,10 +6,10 @@ class QgsDataDefinedButton : QToolButton
public:
enum DataType
{
AnyType,
String,
Int,
Double,
AnyType
};
typedef QFlags<QgsDataDefinedButton::DataType> DataTypes;

@@ -207,3 +207,5 @@ class QgsDataDefinedButton : QToolButton
void setField( QString field );

};

QFlags<QgsDataDefinedButton::DataType> operator|(QgsDataDefinedButton::DataType f1, QFlags<QgsDataDefinedButton::DataType> f2);
@@ -45,3 +45,5 @@ class QgsFieldProxyModel : QSortFilterProxyModel
bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;
};

QFlags<QgsFieldProxyModel::Filter> operator|(QgsFieldProxyModel::Filter f1, QFlags<QgsFieldProxyModel::Filter> f2);

@@ -45,6 +45,8 @@ class QgsMapLayerAction : QAction

};

QFlags<QgsMapLayerAction::Target> operator|(QgsMapLayerAction::Target f1, QFlags<QgsMapLayerAction::Target> f2);

class QgsMapLayerActionRegistry : QObject
{
%TypeHeaderCode
@@ -131,15 +131,15 @@ void QgsDataDefinedButton::init( const QgsVectorLayer* vl,
mDataTypesString = QString( "" );

QStringList ts;
if ( mDataTypes.testFlag( AnyType ) || mDataTypes.testFlag( String ) )
if ( mDataTypes.testFlag( String ) )
{
ts << tr( "string" );
}
if ( mDataTypes.testFlag( AnyType ) || mDataTypes.testFlag( Int ) )
if ( mDataTypes.testFlag( Int ) )
{
ts << tr( "int" );
}
if ( mDataTypes.testFlag( AnyType ) || mDataTypes.testFlag( Double ) )
if ( mDataTypes.testFlag( Double ) )
{
ts << tr( "double" );
}
@@ -39,10 +39,10 @@ class GUI_EXPORT QgsDataDefinedButton: public QToolButton
public:
enum DataType
{
AnyType = 0,
String = 1,
Int = 2,
Double = 4
Double = 4,
AnyType = String | Int | Double
};
Q_DECLARE_FLAGS( DataTypes, DataType )

0 comments on commit 5b1a516

Please sign in to comment.
You can’t perform that action at this time.