24 if ( QFile::exists( path + iconFile ) )
25 return path + iconFile;
35 mAddButton->setIcon( QIcon(
iconPath(
"symbologyAdd.png" ) ) );
36 mRemoveButton->setIcon( QIcon(
iconPath(
"symbologyRemove.png" ) ) );
40 for (
int i = 0; i < ( v.size() - 1 ); ++i )
45 QTreeWidgetItem* entry =
new QTreeWidgetItem();
46 entry->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
47 entry->setText( 0, QString::number( dash ) );
48 entry->setText( 1, QString::number( space ) );
49 mDashSpaceTreeWidget->addTopLevelItem( entry );
58 void QgsDashSpaceDialog::on_mAddButton_clicked()
61 QTreeWidgetItem* entry =
new QTreeWidgetItem();
62 entry->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
63 entry->setText( 0,
"5" );
64 entry->setText( 1,
"2" );
65 mDashSpaceTreeWidget->addTopLevelItem( entry );
68 void QgsDashSpaceDialog::on_mRemoveButton_clicked()
71 QTreeWidgetItem* currentItem = mDashSpaceTreeWidget->currentItem();
74 mDashSpaceTreeWidget->takeTopLevelItem( mDashSpaceTreeWidget->indexOfTopLevelItem( currentItem ) );
80 QVector<qreal> dashVector;
81 int nTopLevelItems = mDashSpaceTreeWidget->topLevelItemCount();
82 for (
int i = 0; i < nTopLevelItems; ++i )
84 QTreeWidgetItem* currentItem = mDashSpaceTreeWidget->topLevelItem( i );
87 dashVector << currentItem->text( 0 ).toDouble() << currentItem->text( 1 ).toDouble();