Skip to content
Permalink
Browse files

osm export: add buttons to select/unselect all tags

  • Loading branch information
jef-n committed Mar 23, 2015
1 parent 7b57caf commit 28a2bf919da3166d518eeedb14cae5ae69e5b649
@@ -40,6 +40,8 @@ QgsOSMExportDialog::QgsOSMExportDialog( QWidget *parent ) :
connect( radPolylines, SIGNAL( clicked() ), this, SLOT( updateLayerName() ) );
connect( radPolygons, SIGNAL( clicked() ), this, SLOT( updateLayerName() ) );
connect( btnLoadTags, SIGNAL( clicked() ), this, SLOT( onLoadTags() ) );
connect( btnSelectAll, SIGNAL( clicked() ), this, SLOT( onSelectAll() ) );
connect( btnUnselectAll, SIGNAL( clicked() ), this, SLOT( onUnselectAll() ) );

mTagsModel = new QStandardItemModel( this );
mTagsModel->setHorizontalHeaderLabels( QStringList() << tr( "Tag" ) << tr( "Count" ) );
@@ -182,3 +184,19 @@ void QgsOSMExportDialog::onClose()
{
reject();
}

void QgsOSMExportDialog::onSelectAll()
{
for ( int i = 0; i < mTagsModel->rowCount(); ++i )
{
mTagsModel->item( i, 0 )->setCheckState( Qt::Checked );
}
}

void QgsOSMExportDialog::onUnselectAll()
{
for ( int i = 0; i < mTagsModel->rowCount(); ++i )
{
mTagsModel->item( i, 0 )->setCheckState( Qt::Unchecked );
}
}
@@ -38,6 +38,8 @@ class QgsOSMExportDialog : public QDialog, private Ui::QgsOSMExportDialog
void onBrowse();
void updateLayerName();
void onLoadTags();
void onSelectAll();
void onUnselectAll();

void onOK();
void onClose();
@@ -106,6 +106,20 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnSelectAll">
<property name="text">
<string>Select All</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnUnselectAll">
<property name="text">
<string>Unselect All</string>
</property>
</widget>
</item>
</layout>
</item>
<item>

0 comments on commit 28a2bf9

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