Skip to content

Commit

Permalink
rename QgsFieldProxyModel::Filter All to AllTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Aug 23, 2016
1 parent bd887ba commit f5aa28b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions doc/api_break.dox
Expand Up @@ -526,6 +526,12 @@ None will need to be modified, as the method will return an empty geometry if th
<li>registerGetExpressionContextCallback has been removed in favor of registerExpressionContextGenerator</li>
</ul>

\subsection qgis_api_break_3_0_QgsFieldProxyModel QgsFieldProxyModel

<ul>
<li>In QgsFieldProxyModel::Filter, All has been renamed to AllTypes</li>
</ul>

\subsection qgis_api_break_3_0_QgsGeometry QgsGeometry

<ul>
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsfieldproxymodel.sip
Expand Up @@ -22,7 +22,7 @@ class QgsFieldProxyModel : QSortFilterProxyModel
Date, /*!< Date or datetime fields */
Time, /*!< Time fields */
HideReadOnly, /*!< Hide read-only fields */
All, /*!< All field types */
AllTypes, /*!< All field types */
};
typedef QFlags<QgsFieldProxyModel::Filter> Filters;

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsattributetabledialog.cpp
Expand Up @@ -275,7 +275,7 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
}

mUpdateExpressionText->registerExpressionContextGenerator( this );
mFieldCombo->setFilters( QgsFieldProxyModel::All | QgsFieldProxyModel::HideReadOnly );
mFieldCombo->setFilters( QgsFieldProxyModel::AllTypes | QgsFieldProxyModel::HideReadOnly );
mFieldCombo->setLayer( mLayer );

connect( mRunFieldCalc, SIGNAL( clicked() ), this, SLOT( updateFieldFromExpression() ) );
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsfieldproxymodel.cpp
Expand Up @@ -19,7 +19,7 @@

QgsFieldProxyModel::QgsFieldProxyModel( QObject *parent )
: QSortFilterProxyModel( parent )
, mFilters( All )
, mFilters( AllTypes )
, mModel( new QgsFieldModel( this ) )
{
setSourceModel( mModel );
Expand Down Expand Up @@ -65,7 +65,7 @@ bool QgsFieldProxyModel::filterAcceptsRow( int source_row, const QModelIndex &so
if ( mFilters.testFlag( HideReadOnly ) && isReadOnly( index ) )
return false;

if ( mFilters.testFlag( All ) )
if ( mFilters.testFlag( AllTypes ) )
return true;

QVariant typeVar = sourceModel()->data( index, QgsFieldModel::FieldTypeRole );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsfieldproxymodel.h
Expand Up @@ -42,7 +42,7 @@ class GUI_EXPORT QgsFieldProxyModel : public QSortFilterProxyModel
Date = 16, /*!< Date or datetime fields */
Time = 32, /*!< Time fields */
HideReadOnly = 64, /*!< Hide read-only fields */
All = Numeric | Date | String | Time, /*!< All field types */ //TODO QGIS 3 - rename to AllTypes
AllTypes = Numeric | Date | String | Time, /*!< All field types */
};
Q_DECLARE_FLAGS( Filters, Filter )

Expand Down

0 comments on commit f5aa28b

Please sign in to comment.