Skip to content
Permalink
Browse files

QgsFieldModel::layer() returns QgsVectorLayer

  • Loading branch information
3nids committed May 2, 2014
1 parent fe20f7b commit 41cc509cbbe45ab0c6aeff355d2e66a593c36dca
Showing with 4 additions and 14 deletions.
  1. +1 −1 python/gui/qgsfieldmodel.sip
  2. +1 −6 src/gui/qgsfieldcombobox.cpp
  3. +1 −6 src/gui/qgsfieldexpressionwidget.cpp
  4. +1 −1 src/gui/qgsfieldmodel.h
@@ -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
@@ -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 )
@@ -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 )
@@ -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

0 comments on commit 41cc509

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