mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -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:
 | 
			
		||||
    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 )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user