24 if ( QFile::exists( path + iconFile ) )
25 return path + iconFile;
34 connect( mAddButton, &QPushButton::clicked,
this, &QgsDashSpaceDialog::mAddButton_clicked );
35 connect( mRemoveButton, &QPushButton::clicked,
this, &QgsDashSpaceDialog::mRemoveButton_clicked );
37 mAddButton->setIcon( QIcon(
iconPath(
"symbologyAdd.svg" ) ) );
38 mRemoveButton->setIcon( QIcon(
iconPath(
"symbologyRemove.svg" ) ) );
42 for (
int i = 0; i < ( v.size() - 1 ); ++i )
47 QTreeWidgetItem *entry =
new QTreeWidgetItem();
48 entry->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
49 entry->setText( 0, QString::number( dash ) );
50 entry->setText( 1, QString::number( space ) );
51 mDashSpaceTreeWidget->addTopLevelItem( entry );
55 void QgsDashSpaceDialog::mAddButton_clicked()
58 QTreeWidgetItem *entry =
new QTreeWidgetItem();
59 entry->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
60 entry->setText( 0, QStringLiteral(
"5" ) );
61 entry->setText( 1, QStringLiteral(
"2" ) );
62 mDashSpaceTreeWidget->addTopLevelItem( entry );
65 void QgsDashSpaceDialog::mRemoveButton_clicked()
68 QTreeWidgetItem *currentItem = mDashSpaceTreeWidget->currentItem();
71 mDashSpaceTreeWidget->takeTopLevelItem( mDashSpaceTreeWidget->indexOfTopLevelItem( currentItem ) );
77 QVector<qreal> dashVector;
78 int nTopLevelItems = mDashSpaceTreeWidget->topLevelItemCount();
79 for (
int i = 0; i < nTopLevelItems; ++i )
81 QTreeWidgetItem *currentItem = mDashSpaceTreeWidget->topLevelItem( i );
84 dashVector << currentItem->text( 0 ).toDouble() << currentItem->text( 1 ).toDouble();
static QString defaultThemePath()
Returns the path to the default theme directory.
QString iconPath(const QString &iconFile)
QgsDashSpaceDialog(const QVector< qreal > &v, QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
Constructor for QgsDashSpaceDialog.
QVector< qreal > dashDotVector() const
static QString activeThemePath()
Returns the path to the currently active theme directory.