Skip to content

Commit 1437433

Browse files
committedSep 29, 2015
[geometry-checker-ui] use qgsmalayercombobox for layers list
1 parent dfb7819 commit 1437433

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
 

‎src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ QgsGeometryCheckerSetupTab::QgsGeometryCheckerSetupTab( QgisInterface* iface , Q
4545
ui.setupUi( this );
4646
ui.progressBar->hide();
4747
ui.labelStatus->hide();
48+
ui.comboBoxInputLayer->setFilters( QgsMapLayerProxyModel::HasGeometry );
4849
mRunButton = ui.buttonBox->addButton( tr( "Run" ), QDialogButtonBox::ActionRole );
4950
mAbortButton = new QPushButton( tr( "Abort" ) );
5051
mRunButton->setEnabled( false );
@@ -107,8 +108,8 @@ QgsVectorLayer* QgsGeometryCheckerSetupTab::getSelectedLayer()
107108
{
108109
return 0;
109110
}
110-
QString inputLayerId = ui.comboBoxInputLayer->itemData( inputIdx ).toString();
111-
return static_cast<QgsVectorLayer*>( QgsMapLayerRegistry::instance()->mapLayer( inputLayerId ) );
111+
QgsVectorLayer *layer = dynamic_cast<QgsVectorLayer*>( ui.comboBoxInputLayer->currentLayer() );
112+
return layer;
112113
}
113114

114115
void QgsGeometryCheckerSetupTab::validateInput()

‎src/plugins/geometry_checker/ui/qgsgeometrycheckersetuptab.ui

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<property name="geometry">
3333
<rect>
3434
<x>0</x>
35-
<y>-276</y>
35+
<y>0</y>
3636
<width>625</width>
3737
<height>767</height>
3838
</rect>
@@ -72,7 +72,7 @@
7272
<number>2</number>
7373
</property>
7474
<item>
75-
<widget class="QComboBox" name="comboBoxInputLayer"/>
75+
<widget class="QgsMapLayerComboBox" name="comboBoxInputLayer"/>
7676
</item>
7777
<item>
7878
<widget class="QCheckBox" name="checkBoxInputSelectedOnly">
@@ -616,6 +616,13 @@
616616
</item>
617617
</layout>
618618
</widget>
619+
<customwidgets>
620+
<customwidget>
621+
<class>QgsMapLayerComboBox</class>
622+
<extends>QComboBox</extends>
623+
<header location="global">qgsmaplayercombobox.h</header>
624+
</customwidget>
625+
</customwidgets>
619626
<resources>
620627
<include location="../pluginres.qrc"/>
621628
</resources>

0 commit comments

Comments
 (0)
Please sign in to comment.