mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-13 00:07:27 -05:00
more flag operators declaration in SIP, better use of flags in data defined button
This commit is contained in:
parent
8a65115100
commit
5b1a516f2e
@ -6,10 +6,10 @@ class QgsDataDefinedButton : QToolButton
|
|||||||
public:
|
public:
|
||||||
enum DataType
|
enum DataType
|
||||||
{
|
{
|
||||||
AnyType,
|
|
||||||
String,
|
String,
|
||||||
Int,
|
Int,
|
||||||
Double,
|
Double,
|
||||||
|
AnyType
|
||||||
};
|
};
|
||||||
typedef QFlags<QgsDataDefinedButton::DataType> DataTypes;
|
typedef QFlags<QgsDataDefinedButton::DataType> DataTypes;
|
||||||
|
|
||||||
@ -207,3 +207,5 @@ class QgsDataDefinedButton : QToolButton
|
|||||||
void setField( QString field );
|
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;
|
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
|
class QgsMapLayerActionRegistry : QObject
|
||||||
{
|
{
|
||||||
%TypeHeaderCode
|
%TypeHeaderCode
|
||||||
|
|||||||
@ -131,15 +131,15 @@ void QgsDataDefinedButton::init( const QgsVectorLayer* vl,
|
|||||||
mDataTypesString = QString( "" );
|
mDataTypesString = QString( "" );
|
||||||
|
|
||||||
QStringList ts;
|
QStringList ts;
|
||||||
if ( mDataTypes.testFlag( AnyType ) || mDataTypes.testFlag( String ) )
|
if ( mDataTypes.testFlag( String ) )
|
||||||
{
|
{
|
||||||
ts << tr( "string" );
|
ts << tr( "string" );
|
||||||
}
|
}
|
||||||
if ( mDataTypes.testFlag( AnyType ) || mDataTypes.testFlag( Int ) )
|
if ( mDataTypes.testFlag( Int ) )
|
||||||
{
|
{
|
||||||
ts << tr( "int" );
|
ts << tr( "int" );
|
||||||
}
|
}
|
||||||
if ( mDataTypes.testFlag( AnyType ) || mDataTypes.testFlag( Double ) )
|
if ( mDataTypes.testFlag( Double ) )
|
||||||
{
|
{
|
||||||
ts << tr( "double" );
|
ts << tr( "double" );
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,10 +39,10 @@ class GUI_EXPORT QgsDataDefinedButton: public QToolButton
|
|||||||
public:
|
public:
|
||||||
enum DataType
|
enum DataType
|
||||||
{
|
{
|
||||||
AnyType = 0,
|
|
||||||
String = 1,
|
String = 1,
|
||||||
Int = 2,
|
Int = 2,
|
||||||
Double = 4
|
Double = 4,
|
||||||
|
AnyType = String | Int | Double
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS( DataTypes, DataType )
|
Q_DECLARE_FLAGS( DataTypes, DataType )
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user