Skip to content

Commit

Permalink
QgsFieldModel::layer() returns QgsVectorLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 2, 2014
1 parent fe20f7b commit 41cc509
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion python/gui/qgsfieldmodel.sip
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class QgsFieldModel : QAbstractItemModel
void removeExpression();

//! returns the currently used layer
QgsMapLayer* layer();
QgsVectorLayer* layer();

public slots:
//! set the layer of whch fields are displayed
Expand Down
7 changes: 1 addition & 6 deletions src/gui/qgsfieldcombobox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ void QgsFieldComboBox::setLayer( QgsMapLayer *layer )

QgsVectorLayer *QgsFieldComboBox::layer()
{
QgsMapLayer* layer = mFieldModel->layer();
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( layer );
if ( vl )
return vl;
else
return 0;
return mFieldModel->layer();
}

void QgsFieldComboBox::setField( QString fieldName )
Expand Down
7 changes: 1 addition & 6 deletions src/gui/qgsfieldexpressionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,7 @@ QString QgsFieldExpressionWidget::currentField( bool *isExpression )

QgsVectorLayer *QgsFieldExpressionWidget::layer()
{
QgsMapLayer* layer = mFieldModel->layer();
QgsVectorLayer* vl = dynamic_cast<QgsVectorLayer*>( layer );
if ( vl )
return vl;
else
return 0;
return mFieldModel->layer();
}

void QgsFieldExpressionWidget::setLayer( QgsVectorLayer *layer )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsfieldmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class GUI_EXPORT QgsFieldModel : public QAbstractItemModel
void removeExpression();

//! returns the currently used layer
QgsMapLayer* layer() {return mLayer;}
QgsVectorLayer* layer() {return mLayer;}

public slots:
//! set the layer of whch fields are displayed
Expand Down

0 comments on commit 41cc509

Please sign in to comment.