36 #include <QFileDialog> 37 #include <QInputDialog> 38 #include <QMessageBox> 39 #include <QPushButton> 40 #include <QStandardItemModel> 51 QgsCheckableStyleModel::QgsCheckableStyleModel(
QgsStyle *style, QObject *parent,
bool readOnly )
54 , mReadOnly( readOnly )
59 void QgsCheckableStyleModel::setCheckable(
bool checkable )
61 if ( checkable == mCheckable )
64 mCheckable = checkable;
65 emit dataChanged( index( 0, 0 ), index( rowCount() - 1, 0 ), QVector< int >() << Qt::CheckStateRole );
68 void QgsCheckableStyleModel::setCheckTag(
const QString &tag )
70 if ( tag == mCheckTag )
74 emit dataChanged( index( 0, 0 ), index( rowCount() - 1, 0 ), QVector< int >() << Qt::CheckStateRole );
77 Qt::ItemFlags QgsCheckableStyleModel::flags(
const QModelIndex &index )
const 79 Qt::ItemFlags f = QgsStyleProxyModel::flags( index );
80 if ( !mReadOnly && mCheckable && index.column() == 0 )
81 f |= Qt::ItemIsUserCheckable;
84 f &= ~Qt::ItemIsEditable;
89 QVariant QgsCheckableStyleModel::data(
const QModelIndex &index,
int role )
const 96 QFont f = QgsStyleProxyModel::data( index, role ).value< QFont >();
101 case Qt::CheckStateRole:
103 if ( !mCheckable || index.column() != 0 )
107 return tags.contains( mCheckTag ) ? Qt::Checked : Qt::Unchecked;
114 return QgsStyleProxyModel::data( index, role );
117 bool QgsCheckableStyleModel::setData(
const QModelIndex &i,
const QVariant &value,
int role )
119 if ( i.row() < 0 || i.row() >= rowCount( QModelIndex() ) ||
120 ( role != Qt::EditRole && role != Qt::CheckStateRole ) )
126 if ( role == Qt::CheckStateRole )
128 if ( !mCheckable || mCheckTag.isEmpty() )
131 const QString name = data( index( i.row(),
QgsStyleModel::Name ), Qt::DisplayRole ).toString();
134 if ( value.toInt() == Qt::Checked )
135 return mStyle->
tagSymbol( entity, name, QStringList() << mCheckTag );
137 return mStyle->
detagSymbol( entity, name, QStringList() << mCheckTag );
139 return QgsStyleProxyModel::setData( i, value, role );
148 : QDialog( parent, flags )
150 , mReadOnly( readOnly )
153 connect( tabItemType, &QTabWidget::currentChanged,
this, &QgsStyleManagerDialog::tabItemType_currentChanged );
158 setWindowModality( Qt::WindowModal );
163 restoreGeometry( settings.
value( QStringLiteral(
"Windows/StyleV2Manager/geometry" ) ).toByteArray() );
164 mSplitter->setSizes( QList<int>() << 170 << 540 );
165 mSplitter->restoreState( settings.
value( QStringLiteral(
"Windows/StyleV2Manager/splitter" ) ).toByteArray() );
167 tabItemType->setDocumentMode(
true );
168 searchBox->setShowSearchIcon(
true );
169 searchBox->setPlaceholderText( tr(
"Filter symbols…" ) );
177 connect( btnAddItem, &QPushButton::clicked,
this, [ = ](
bool ) {
addItem(); }
179 connect( btnEditItem, &QPushButton::clicked,
this, [ = ](
bool ) {
editItem(); }
181 connect( actnEditItem, &QAction::triggered,
this, [ = ](
bool ) {
editItem(); }
183 connect( btnRemoveItem, &QPushButton::clicked,
this, [ = ](
bool ) {
removeItem(); }
185 connect( actnRemoveItem, &QAction::triggered,
this, [ = ](
bool ) {
removeItem(); }
190 btnAddTag->setEnabled(
false );
191 btnAddSmartgroup->setEnabled(
false );
194 QMenu *shareMenu =
new QMenu( tr(
"Share Menu" ),
this );
195 QAction *exportAction =
new QAction( tr(
"Export Item(s)…" ),
this );
197 shareMenu->addAction( exportAction );
200 QAction *importAction =
new QAction( tr(
"Import Item(s)…" ),
this );
202 shareMenu->addAction( importAction );
207 mActionCopyToDefault =
new QAction( tr(
"Copy Selection to Default Style…" ),
this );
208 shareMenu->addAction( mActionCopyToDefault );
209 connect( mActionCopyToDefault, &QAction::triggered,
this, &QgsStyleManagerDialog::copyItemsToDefault );
210 connect( mCopyToDefaultButton, &QPushButton::clicked,
this, &QgsStyleManagerDialog::copyItemsToDefault );
214 mCopyToDefaultButton->hide();
217 shareMenu->addSeparator();
218 shareMenu->addAction( actnExportAsPNG );
219 shareMenu->addAction( actnExportAsSVG );
224 btnShare->setMenu( shareMenu );
227 listItems->setIconSize( QSize( static_cast< int >( iconSize ), static_cast< int >( iconSize * 0.9 ) ) );
229 mSymbolTreeView->setIconSize( QSize( static_cast< int >( treeIconSize ), static_cast< int >( treeIconSize ) ) );
231 mModel =
new QgsCheckableStyleModel( mStyle,
this, mReadOnly );
232 mModel->addDesiredIconSize( listItems->iconSize() );
233 mModel->addDesiredIconSize( mSymbolTreeView->iconSize() );
234 listItems->setModel( mModel );
235 mSymbolTreeView->setModel( mModel );
237 listItems->setSelectionBehavior( QAbstractItemView::SelectRows );
238 listItems->setSelectionMode( QAbstractItemView::ExtendedSelection );
239 mSymbolTreeView->setSelectionModel( listItems->selectionModel() );
240 mSymbolTreeView->setSelectionMode( listItems->selectionMode() );
242 connect( listItems->selectionModel(), &QItemSelectionModel::currentChanged,
244 connect( listItems->selectionModel(), &QItemSelectionModel::selectionChanged,
247 QStandardItemModel *groupModel =
new QStandardItemModel( groupTree );
248 groupTree->setModel( groupModel );
249 groupTree->setHeaderHidden(
true );
251 groupTree->setCurrentIndex( groupTree->model()->index( 0, 0 ) );
253 connect( groupTree->selectionModel(), &QItemSelectionModel::currentChanged,
257 connect( groupModel, &QStandardItemModel::itemChanged,
263 QMenu *groupMenu =
new QMenu( tr(
"Group Actions" ),
this );
265 groupMenu->addAction( actnTagSymbols );
267 actnFinishTagging->setVisible(
false );
268 groupMenu->addAction( actnFinishTagging );
269 groupMenu->addAction( actnEditSmartGroup );
270 btnManageGroups->setMenu( groupMenu );
274 btnManageGroups->setEnabled(
false );
280 groupTree->setContextMenuPolicy( Qt::CustomContextMenu );
281 connect( groupTree, &QWidget::customContextMenuRequested,
285 listItems->setContextMenuPolicy( Qt::CustomContextMenu );
286 connect( listItems, &QWidget::customContextMenuRequested,
288 mSymbolTreeView->setContextMenuPolicy( Qt::CustomContextMenu );
289 connect( mSymbolTreeView, &QWidget::customContextMenuRequested,
295 QStringList rampTypes;
296 rampTypes << tr(
"Gradient" ) << tr(
"Color presets" ) << tr(
"Random" ) << tr(
"Catalog: cpt-city" );
297 rampTypes << tr(
"Catalog: ColorBrewer" );
299 mMenuBtnAddItemAll =
new QMenu(
this );
300 mMenuBtnAddItemColorRamp =
new QMenu(
this );
302 QAction *item =
new QAction( tr(
"Marker" ),
this );
304 mMenuBtnAddItemAll->addAction( item );
305 item =
new QAction( tr(
"Line" ),
this );
307 mMenuBtnAddItemAll->addAction( item );
308 item =
new QAction( tr(
"Fill" ),
this );
310 mMenuBtnAddItemAll->addAction( item );
311 mMenuBtnAddItemAll->addSeparator();
312 for (
const QString &rampType : qgis::as_const( rampTypes ) )
314 item =
new QAction( rampType,
this );
315 connect( item, &QAction::triggered,
this, [ = ](
bool ) {
addColorRamp( item ); } );
316 mMenuBtnAddItemAll->addAction( item );
317 mMenuBtnAddItemColorRamp->addAction(
new QAction( rampType,
this ) );
320 connect( mMenuBtnAddItemColorRamp, &QMenu::triggered,
325 mGroupMenu =
new QMenu(
this );
326 mGroupListMenu =
new QMenu( mGroupMenu );
327 mGroupListMenu->setTitle( tr(
"Add to Tag" ) );
328 mGroupListMenu->setEnabled(
false );
332 mGroupMenu->addAction( actnAddFavorite );
334 mGroupMenu->addAction( actnRemoveFavorite );
335 mGroupMenu->addSeparator()->setParent(
this );
336 mGroupMenu->addMenu( mGroupListMenu );
337 actnDetag->setData( 0 );
339 mGroupMenu->addAction( actnDetag );
340 mGroupMenu->addSeparator()->setParent(
this );
341 mGroupMenu->addAction( actnRemoveItem );
342 mGroupMenu->addAction( actnEditItem );
343 mGroupMenu->addSeparator()->setParent(
this );
347 btnAddItem->setVisible(
false );
348 btnRemoveItem->setVisible(
false );
349 btnEditItem->setVisible(
false );
350 btnAddSmartgroup->setVisible(
false );
351 btnAddTag->setVisible(
false );
352 btnManageGroups->setVisible(
false );
354 if ( mActionCopyToDefault )
356 mGroupMenu->addAction( mActionCopyToDefault );
358 mGroupMenu->addAction( actnExportAsPNG );
359 mGroupMenu->addAction( actnExportAsSVG );
362 mGroupTreeContextMenu =
new QMenu(
this );
366 mGroupTreeContextMenu->addAction( actnEditSmartGroup );
367 connect( actnAddTag, &QAction::triggered,
this, [ = ](
bool ) {
addTag(); }
369 mGroupTreeContextMenu->addAction( actnAddTag );
370 connect( actnAddSmartgroup, &QAction::triggered,
this, [ = ](
bool ) {
addSmartgroup(); }
372 mGroupTreeContextMenu->addAction( actnAddSmartgroup );
374 mGroupTreeContextMenu->addAction( actnRemoveGroup );
377 tabItemType_currentChanged( 0 );
382 connect( mButtonIconView, &QToolButton::toggled,
this, [ = ](
bool active )
386 mSymbolViewStackedWidget->setCurrentIndex( 0 );
391 connect( mButtonListView, &QToolButton::toggled,
this, [ = ](
bool active )
396 mSymbolViewStackedWidget->setCurrentIndex( 1 );
400 const int currentView = settings.
value( QStringLiteral(
"Windows/StyleV2Manager/lastIconView" ), 0,
QgsSettings::Gui ).toInt();
401 if ( currentView == 0 )
402 mButtonIconView->setChecked(
true );
404 mButtonListView->setChecked(
true );
406 mSymbolTreeView->header()->restoreState( settings.
value( QStringLiteral(
"Windows/StyleV2Manager/treeState" ), QByteArray(),
QgsSettings::Gui ).toByteArray() );
407 connect( mSymbolTreeView->header(), &QHeaderView::sectionResized,
this, [
this]
419 if ( mModified && !mReadOnly )
426 settings.
setValue( QStringLiteral(
"Windows/StyleV2Manager/splitter" ), mSplitter->saveState() );
433 void QgsStyleManagerDialog::tabItemType_currentChanged(
int )
437 searchBox->setPlaceholderText( isSymbol ? tr(
"Filter symbols…" ) : tr(
"Filter color ramps…" ) );
439 if ( !mReadOnly && !isSymbol )
441 btnAddItem->setMenu( mMenuBtnAddItemColorRamp );
443 else if ( !mReadOnly && tabItemType->currentIndex() == 0 )
445 btnAddItem->setMenu( mMenuBtnAddItemAll );
449 btnAddItem->setMenu(
nullptr );
452 actnExportAsPNG->setVisible( isSymbol );
453 actnExportAsSVG->setVisible( isSymbol );
456 mModel->setEntityFilterEnabled( !allTypesSelected() );
457 mModel->setSymbolTypeFilterEnabled( isSymbol && !allTypesSelected() );
458 if ( isSymbol && !allTypesSelected() )
459 mModel->setSymbolType( static_cast< QgsSymbol::SymbolType >(
currentItemType() ) );
464 void QgsStyleManagerDialog::copyItemsToDefault()
466 const QList< ItemDetails > items = selectedItems();
467 if ( !items.empty() )
470 const QString tags = QInputDialog::getText(
this, tr(
"Import Items" ),
471 tr(
"Additional tags to add (comma separated)" ), QLineEdit::Normal,
476 const QStringList parts = tags.split(
',', QString::SkipEmptyParts );
477 QStringList additionalTags;
478 additionalTags.reserve( parts.count() );
479 for (
const QString &tag : parts )
480 additionalTags << tag.trimmed();
482 auto cursorOverride = qgis::make_unique< QgsTemporaryCursorOverride >( Qt::WaitCursor );
483 const int count = copyItems( items, mStyle,
QgsStyle::defaultStyle(),
this, cursorOverride,
true, additionalTags,
false,
false );
484 cursorOverride.reset();
487 QMessageBox::information(
this, tr(
"Import Items" ),
488 count > 1 ? tr(
"Successfully imported %1 items." ).arg( count )
489 : tr(
"Successfully imported item." ) );
494 int QgsStyleManagerDialog::selectedItemType()
496 QModelIndex index = listItems->selectionModel()->currentIndex();
497 if ( !index.isValid() )
507 bool QgsStyleManagerDialog::allTypesSelected()
const 509 return tabItemType->currentIndex() == 0;
512 QList< QgsStyleManagerDialog::ItemDetails > QgsStyleManagerDialog::selectedItems()
514 QList<QgsStyleManagerDialog::ItemDetails > res;
515 QModelIndexList indices = listItems->selectionModel()->selectedRows();
516 for (
const QModelIndex &index : indices )
518 if ( !index.isValid() )
525 details.name = mModel->data( mModel->index( index.row(),
QgsStyleModel::Name, index.parent() ), Qt::DisplayRole ).toString();
532 int QgsStyleManagerDialog::copyItems(
const QList<QgsStyleManagerDialog::ItemDetails> &items,
QgsStyle *src,
QgsStyle *dst, QWidget *parentWidget,
533 std::unique_ptr< QgsTemporaryCursorOverride > &cursorOverride,
bool isImport,
const QStringList &importTags,
bool addToFavorites,
bool ignoreSourceTags )
536 bool overwriteAll =
true;
542 for (
auto &details : items )
544 QStringList symbolTags;
545 if ( !ignoreSourceTags )
547 symbolTags = src->
tagsOfSymbol( details.entityType, details.name );
550 bool addItemToFavorites =
false;
553 symbolTags << importTags;
554 addItemToFavorites = addToFavorites;
557 switch ( details.entityType )
561 std::unique_ptr< QgsSymbol > symbol( src->
symbol( details.name ) );
565 const bool hasDuplicateName = dst->
symbolNames().contains( details.name );
566 bool overwriteThis =
false;
568 addItemToFavorites = favoriteSymbols.contains( details.name );
570 if ( hasDuplicateName && prompt )
572 cursorOverride.reset();
573 int res = QMessageBox::warning( parentWidget, isImport ? tr(
"Import Symbol" ) : tr(
"Export Symbol" ),
574 tr(
"A symbol with the name “%1” already exists.\nOverwrite?" )
575 .arg( details.name ),
576 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
577 cursorOverride = qgis::make_unique< QgsTemporaryCursorOverride >( Qt::WaitCursor );
580 case QMessageBox::Cancel:
583 case QMessageBox::No:
586 case QMessageBox::Yes:
587 overwriteThis =
true;
590 case QMessageBox::YesToAll:
595 case QMessageBox::NoToAll:
597 overwriteAll =
false;
602 if ( !hasDuplicateName || overwriteAll || overwriteThis )
605 dst->
addSymbol( details.name, symbol.release() );
606 dst->
saveSymbol( details.name, newSymbol, addItemToFavorites, symbolTags );
614 std::unique_ptr< QgsColorRamp > ramp( src->
colorRamp( details.name ) );
618 const bool hasDuplicateName = dst->
colorRampNames().contains( details.name );
619 bool overwriteThis =
false;
621 addItemToFavorites = favoriteColorramps.contains( details.name );
623 if ( hasDuplicateName && prompt )
625 cursorOverride.reset();
626 int res = QMessageBox::warning( parentWidget, isImport ? tr(
"Import Color Ramp" ) : tr(
"Export Color Ramp" ),
627 tr(
"A color ramp with the name “%1” already exists.\nOverwrite?" )
628 .arg( details.name ),
629 QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll | QMessageBox::Cancel );
630 cursorOverride = qgis::make_unique< QgsTemporaryCursorOverride >( Qt::WaitCursor );
633 case QMessageBox::Cancel:
636 case QMessageBox::No:
639 case QMessageBox::Yes:
640 overwriteThis =
true;
643 case QMessageBox::YesToAll:
648 case QMessageBox::NoToAll:
650 overwriteAll =
false;
655 if ( !hasDuplicateName || overwriteAll || overwriteThis )
659 dst->
saveColorRamp( details.name, newRamp, addItemToFavorites, symbolTags );
676 groupChanged( groupTree->selectionModel()->currentIndex() );
689 switch ( tabItemType->currentIndex() )
706 QModelIndex index = listItems->selectionModel()->currentIndex();
707 if ( !index.isValid() )
710 return mModel->data( mModel->index( index.row(),
QgsStyleModel::Name, index.parent() ), Qt::DisplayRole ).toString();
715 bool changed =
false;
726 Q_ASSERT(
false &&
"not implemented" );
739 QString name = tr(
"new symbol" );
744 name = tr(
"new marker" );
748 name = tr(
"new line" );
752 name = tr(
"new fill symbol" );
755 Q_ASSERT(
false &&
"unknown symbol type" );
765 if ( dlg.exec() == 0 )
772 if ( !saveDlg.exec() )
778 name = saveDlg.
name();
781 bool nameInvalid =
true;
782 while ( nameInvalid )
785 if ( name.isEmpty() )
787 QMessageBox::warning(
this, tr(
"Save Symbol" ),
788 tr(
"Cannot save symbol without name. Enter a name." ) );
792 int res = QMessageBox::warning(
this, tr(
"Save Symbol" ),
793 tr(
"Symbol with name '%1' already exists. Overwrite?" )
795 QMessageBox::Yes | QMessageBox::No );
796 if ( res == QMessageBox::Yes )
810 name = QInputDialog::getText(
this, tr(
"Symbol Name" ),
811 tr(
"Please enter a name for new symbol:" ),
812 QLineEdit::Normal, name, &ok );
821 QStringList symbolTags = saveDlg.
tags().split(
',' );
836 if ( rampType.isEmpty() )
838 QStringList rampTypes;
839 rampTypes << tr(
"Gradient" ) << tr(
"Color presets" ) << tr(
"Random" ) << tr(
"Catalog: cpt-city" );
840 rampTypes << tr(
"Catalog: ColorBrewer" );
841 rampType = QInputDialog::getItem( parent, tr(
"Color Ramp Type" ),
842 tr(
"Please select color ramp type:" ), rampTypes, 0,
false, &ok );
844 if ( !ok || rampType.isEmpty() )
847 QString name = tr(
"new ramp" );
849 std::unique_ptr< QgsColorRamp > ramp;
850 if ( rampType == tr(
"Gradient" ) )
858 name = tr(
"new gradient ramp" );
860 else if ( rampType == tr(
"Random" ) )
868 name = tr(
"new random ramp" );
870 else if ( rampType == tr(
"Catalog: ColorBrewer" ) )
880 else if ( rampType == tr(
"Color presets" ) )
888 name = tr(
"new preset ramp" );
890 else if ( rampType == tr(
"Catalog: cpt-city" ) )
912 QgsDebugMsg( QStringLiteral(
"invalid ramp type %1" ).arg( rampType ) );
917 if ( !saveDlg.exec() )
922 name = saveDlg.
name();
925 bool nameInvalid =
true;
926 while ( nameInvalid )
929 if ( name.isEmpty() )
931 QMessageBox::warning( parent, tr(
"Save Color Ramp" ),
932 tr(
"Cannot save color ramp without name. Enter a name." ) );
936 int res = QMessageBox::warning( parent, tr(
"Save Color Ramp" ),
937 tr(
"Color ramp with name '%1' already exists. Overwrite?" )
939 QMessageBox::Yes | QMessageBox::No );
940 if ( res == QMessageBox::Yes )
953 name = QInputDialog::getText( parent, tr(
"Color Ramp Name" ),
954 tr(
"Please enter a name for new color ramp:" ),
955 QLineEdit::Normal, name, &ok );
963 QStringList colorRampTags = saveDlg.
tags().split(
',' );
975 mFavoritesGroupVisible = show;
981 mSmartGroupVisible = show;
993 setWindowState( windowState() & ~Qt::WindowMinimized );
1006 action ? action->text() : QString() );
1007 if ( !rampName.isEmpty() )
1019 if ( selectedItemType() < 3 )
1023 else if ( selectedItemType() == 3 )
1029 Q_ASSERT(
false &&
"not implemented" );
1036 if ( symbolName.isEmpty() )
1039 std::unique_ptr< QgsSymbol > symbol( mStyle->
symbol( symbolName ) );
1043 if ( dlg.exec() == 0 )
1049 mStyle->
addSymbol( symbolName, symbol.release(), true );
1057 if ( name.isEmpty() )
1060 std::unique_ptr< QgsColorRamp > ramp( mStyle->
colorRamp( name ) );
1062 if ( ramp->type() == QLatin1String(
"gradient" ) )
1072 else if ( ramp->type() == QLatin1String(
"random" ) )
1082 else if ( ramp->type() == QLatin1String(
"colorbrewer" ) )
1092 else if ( ramp->type() == QLatin1String(
"preset" ) )
1102 else if ( ramp->type() == QLatin1String(
"cpt-city" ) )
1121 Q_ASSERT(
false &&
"invalid ramp type" );
1132 const QList< ItemDetails > items = selectedItems();
1134 if ( allTypesSelected() )
1136 if ( QMessageBox::Yes != QMessageBox::question(
this, tr(
"Remove Items" ),
1137 QString( tr(
"Do you really want to remove %n item(s)?",
nullptr, items.count() ) ),
1146 if ( QMessageBox::Yes != QMessageBox::question(
this, tr(
"Remove Symbol" ),
1147 QString( tr(
"Do you really want to remove %n symbol(s)?",
nullptr, items.count() ) ),
1154 if ( QMessageBox::Yes != QMessageBox::question(
this, tr(
"Remove Color Ramp" ),
1155 QString( tr(
"Do you really want to remove %n ramp(s)?",
nullptr, items.count() ) ),
1164 for (
const ItemDetails &details : items )
1166 if ( details.name.isEmpty() )
1194 QString dir = QFileDialog::getExistingDirectory(
this, tr(
"Export Selected Symbols as PNG" ),
1195 QDir::home().absolutePath(),
1196 QFileDialog::ShowDirsOnly
1197 | QFileDialog::DontResolveSymlinks );
1203 QString dir = QFileDialog::getExistingDirectory(
this, tr(
"Export Selected Symbols as SVG" ),
1204 QDir::home().absolutePath(),
1205 QFileDialog::ShowDirsOnly
1206 | QFileDialog::DontResolveSymlinks );
1213 if ( dir.isEmpty() )
1216 const QList< ItemDetails > items = selectedItems();
1217 for (
const ItemDetails &details : items )
1222 QString path = dir +
'/' + details.name +
'.' + format;
1223 std::unique_ptr< QgsSymbol > sym( mStyle->
symbol( details.name ) );
1225 sym->exportImage( path, format, size );
1245 QFont font = item->font();
1246 font.setBold(
true );
1247 item->setFont( font );
1252 if ( mBlockGroupUpdates )
1255 QStandardItemModel *model = qobject_cast<QStandardItemModel *>( groupTree->model() );
1258 if ( mFavoritesGroupVisible )
1260 QStandardItem *favoriteSymbols =
new QStandardItem( tr(
"Favorites" ) );
1261 favoriteSymbols->setData(
"favorite" );
1262 favoriteSymbols->setEditable(
false );
1264 model->appendRow( favoriteSymbols );
1267 QStandardItem *allSymbols =
new QStandardItem( tr(
"All" ) );
1268 allSymbols->setData(
"all" );
1269 allSymbols->setEditable(
false );
1271 model->appendRow( allSymbols );
1273 QStandardItem *taggroup =
new QStandardItem( QString() );
1274 taggroup->setData(
"tags" );
1275 taggroup->setEditable(
false );
1276 QStringList tags = mStyle->
tags();
1278 for (
const QString &tag : qgis::as_const( tags ) )
1280 QStandardItem *item =
new QStandardItem( tag );
1281 item->setData( mStyle->
tagId( tag ) );
1282 item->setEditable( !mReadOnly );
1283 taggroup->appendRow( item );
1285 taggroup->setText( tr(
"Tags" ) );
1287 model->appendRow( taggroup );
1289 if ( mSmartGroupVisible )
1291 QStandardItem *smart =
new QStandardItem( tr(
"Smart Groups" ) );
1292 smart->setData(
"smartgroups" );
1293 smart->setEditable(
false );
1296 QgsSymbolGroupMap::const_iterator i = sgMap.constBegin();
1297 while ( i != sgMap.constEnd() )
1299 QStandardItem *item =
new QStandardItem( i.value() );
1300 item->setData( i.key() );
1301 item->setEditable( !mReadOnly );
1302 smart->appendRow( item );
1305 model->appendRow( smart );
1309 int rows = model->rowCount( model->indexFromItem( model->invisibleRootItem() ) );
1310 for (
int i = 0; i < rows; i++ )
1312 groupTree->setExpanded( model->indexFromItem( model->item( i ) ),
true );
1318 QStringList groupSymbols;
1320 const QString category = index.data( Qt::UserRole + 1 ).toString();
1321 if ( mGroupingMode )
1323 mModel->setTagId( -1 );
1324 mModel->setSmartGroupId( -1 );
1325 mModel->setFavoritesOnly(
false );
1326 mModel->setCheckTag( index.data( Qt::DisplayRole ).toString() );
1328 else if ( category == QLatin1String(
"all" ) || category == QLatin1String(
"tags" ) || category == QLatin1String(
"smartgroups" ) )
1331 if ( category == QLatin1String(
"tags" ) )
1333 actnAddTag->setEnabled( !mReadOnly );
1334 actnAddSmartgroup->setEnabled(
false );
1336 else if ( category == QLatin1String(
"smartgroups" ) )
1338 actnAddTag->setEnabled(
false );
1339 actnAddSmartgroup->setEnabled( !mReadOnly );
1342 mModel->setTagId( -1 );
1343 mModel->setSmartGroupId( -1 );
1344 mModel->setFavoritesOnly(
false );
1346 else if ( category == QLatin1String(
"favorite" ) )
1349 mModel->setTagId( -1 );
1350 mModel->setSmartGroupId( -1 );
1351 mModel->setFavoritesOnly(
true );
1353 else if ( index.parent().data( Qt::UserRole + 1 ) ==
"smartgroups" )
1355 actnRemoveGroup->setEnabled( !mReadOnly );
1356 btnManageGroups->setEnabled( !mReadOnly );
1357 const int groupId = index.data( Qt::UserRole + 1 ).toInt();
1358 mModel->setTagId( -1 );
1359 mModel->setSmartGroupId( groupId );
1360 mModel->setFavoritesOnly(
false );
1365 int tagId = index.data( Qt::UserRole + 1 ).toInt();
1366 mModel->setTagId( tagId );
1367 mModel->setSmartGroupId( -1 );
1368 mModel->setFavoritesOnly(
false );
1371 actnEditSmartGroup->setVisible(
false );
1372 actnAddTag->setVisible(
false );
1373 actnAddSmartgroup->setVisible(
false );
1374 actnRemoveGroup->setVisible(
false );
1375 actnTagSymbols->setVisible(
false );
1376 actnFinishTagging->setVisible(
false );
1378 if ( index.parent().isValid() )
1380 if ( index.parent().data( Qt::UserRole + 1 ).toString() == QLatin1String(
"smartgroups" ) )
1382 actnEditSmartGroup->setVisible( !mGroupingMode && !mReadOnly );
1384 else if ( index.parent().data( Qt::UserRole + 1 ).toString() == QLatin1String(
"tags" ) )
1386 actnAddTag->setVisible( !mGroupingMode && !mReadOnly );
1387 actnTagSymbols->setVisible( !mGroupingMode && !mReadOnly );
1388 actnFinishTagging->setVisible( mGroupingMode && !mReadOnly );
1390 actnRemoveGroup->setVisible( !mReadOnly );
1392 else if ( index.data( Qt::UserRole + 1 ) ==
"smartgroups" )
1394 actnAddSmartgroup->setVisible( !mGroupingMode && !mReadOnly );
1396 else if ( index.data( Qt::UserRole + 1 ) ==
"tags" )
1398 actnAddTag->setVisible( !mGroupingMode && !mReadOnly );
1404 QStandardItemModel *model = qobject_cast<QStandardItemModel *>( groupTree->model() );
1406 for (
int i = 0; i < groupTree->model()->rowCount(); i++ )
1408 index = groupTree->model()->index( i, 0 );
1409 QString data = index.data( Qt::UserRole + 1 ).toString();
1410 if ( data == QLatin1String(
"tags" ) )
1419 itemName = QInputDialog::getText(
this, tr(
"Add Tag" ),
1420 tr(
"Please enter name for the new tag:" ), QLineEdit::Normal, tr(
"New tag" ), &ok ).trimmed();
1421 if ( !ok || itemName.isEmpty() )
1424 int check = mStyle->
tagId( itemName );
1427 QMessageBox::critical(
this, tr(
"Add Tag" ),
1428 tr(
"Tag name already exists in your symbol database." ) );
1434 mBlockGroupUpdates++;
1435 id = mStyle->
addTag( itemName );
1436 mBlockGroupUpdates--;
1440 QMessageBox::critical(
this, tr(
"Add Tag" ),
1441 tr(
"New tag could not be created.\n" 1442 "There was a problem with your symbol database." ) );
1446 QStandardItem *parentItem = model->itemFromIndex( index );
1447 QStandardItem *childItem =
new QStandardItem( itemName );
1448 childItem->setData(
id );
1449 parentItem->appendRow( childItem );
1456 QStandardItemModel *model = qobject_cast<QStandardItemModel *>( groupTree->model() );
1458 for (
int i = 0; i < groupTree->model()->rowCount(); i++ )
1460 index = groupTree->model()->index( i, 0 );
1461 QString data = index.data( Qt::UserRole + 1 ).toString();
1462 if ( data == QLatin1String(
"smartgroups" ) )
1471 if ( dlg.exec() == QDialog::Rejected )
1476 mBlockGroupUpdates++;
1478 mBlockGroupUpdates--;
1484 QStandardItem *parentItem = model->itemFromIndex( index );
1485 QStandardItem *childItem =
new QStandardItem( itemName );
1486 childItem->setData(
id );
1487 parentItem->appendRow( childItem );
1494 QStandardItemModel *model = qobject_cast<QStandardItemModel *>( groupTree->model() );
1495 QModelIndex index = groupTree->currentIndex();
1498 QString data = index.data( Qt::UserRole + 1 ).toString();
1499 if ( data == QLatin1String(
"all" ) || data == QLatin1String(
"favorite" ) || data == QLatin1String(
"tags" ) || index.data() ==
"smartgroups" )
1501 int err = QMessageBox::critical(
this, tr(
"Remove Group" ),
1502 tr(
"Invalid selection. Cannot delete system defined categories.\n" 1503 "Kindly select a group or smart group you might want to delete." ) );
1508 QStandardItem *parentItem = model->itemFromIndex( index.parent() );
1512 mBlockGroupUpdates++;
1514 if ( parentItem->data( Qt::UserRole + 1 ).toString() == QLatin1String(
"smartgroups" ) )
1523 mBlockGroupUpdates--;
1524 parentItem->removeRow( index.row() );
1529 QgsDebugMsg( QStringLiteral(
"Symbol group edited: data=%1 text=%2" ).arg( item->data( Qt::UserRole + 1 ).toString(), item->text() ) );
1530 int id = item->data( Qt::UserRole + 1 ).toInt();
1531 QString name = item->text();
1532 mBlockGroupUpdates++;
1533 if ( item->parent()->data( Qt::UserRole + 1 ) ==
"smartgroups" )
1541 mBlockGroupUpdates--;
1546 QStandardItemModel *treeModel = qobject_cast<QStandardItemModel *>( groupTree->model() );
1548 if ( mGroupingMode )
1550 mGroupingMode =
false;
1551 mModel->setCheckable(
false );
1552 actnTagSymbols->setVisible(
true );
1553 actnFinishTagging->setVisible(
false );
1561 connect( treeModel, &QStandardItemModel::itemChanged,
1565 listItems->setSelectionMode( QAbstractItemView::ExtendedSelection );
1566 mSymbolTreeView->setSelectionMode( QAbstractItemView::ExtendedSelection );
1570 bool validGroup =
false;
1572 QModelIndex present = groupTree->currentIndex();
1573 while ( present.parent().isValid() )
1575 if ( present.parent().data() ==
"Tags" )
1580 present = present.parent();
1585 mGroupingMode =
true;
1587 actnTagSymbols->setVisible(
false );
1588 actnFinishTagging->setVisible(
true );
1590 disconnect( treeModel, &QStandardItemModel::itemChanged,
1596 btnManageGroups->setEnabled(
true );
1598 mModel->setCheckable(
true );
1601 listItems->setSelectionMode( QAbstractItemView::NoSelection );
1602 mSymbolTreeView->setSelectionMode( QAbstractItemView::NoSelection );
1616 mModel->setFilterString( qword );
1621 actnEditItem->setEnabled( index.isValid() && !mGroupingMode && !mReadOnly );
1626 Q_UNUSED( selected );
1627 Q_UNUSED( deselected );
1628 bool nothingSelected = listItems->selectionModel()->selectedIndexes().empty();
1629 actnRemoveItem->setDisabled( nothingSelected || mReadOnly );
1630 actnAddFavorite->setDisabled( nothingSelected || mReadOnly );
1631 actnRemoveFavorite->setDisabled( nothingSelected || mReadOnly );
1632 mGroupListMenu->setDisabled( nothingSelected || mReadOnly );
1633 actnDetag->setDisabled( nothingSelected || mReadOnly );
1634 actnExportAsPNG->setDisabled( nothingSelected );
1635 actnExportAsSVG->setDisabled( nothingSelected );
1636 if ( mActionCopyToDefault )
1637 mActionCopyToDefault->setDisabled( nothingSelected );
1638 mCopyToDefaultButton->setDisabled( nothingSelected );
1639 actnEditItem->setDisabled( nothingSelected || mReadOnly );
1644 groupTree->setEnabled( enable );
1645 btnAddTag->setEnabled( enable && !mReadOnly );
1646 btnAddSmartgroup->setEnabled( enable && !mReadOnly );
1647 actnAddTag->setEnabled( enable && !mReadOnly );
1648 actnAddSmartgroup->setEnabled( enable && !mReadOnly );
1649 actnRemoveGroup->setEnabled( enable && !mReadOnly );
1650 btnManageGroups->setEnabled( !mReadOnly && ( enable || mGroupingMode ) );
1651 searchBox->setEnabled( enable );
1656 actnRemoveGroup->setEnabled( enable && !mReadOnly );
1657 btnManageGroups->setEnabled( !mReadOnly && ( enable || mGroupingMode ) );
1662 QStandardItemModel *treeModel = qobject_cast<QStandardItemModel *>( groupTree->model() );
1663 for (
int i = 0; i < treeModel->rowCount(); i++ )
1665 treeModel->item( i )->setEnabled( enable );
1667 if ( treeModel->item( i )->data() ==
"smartgroups" )
1669 for (
int j = 0; j < treeModel->item( i )->rowCount(); j++ )
1671 treeModel->item( i )->child( j )->setEnabled( enable );
1678 for (
int i = 0; i < symbolBtnsLayout->count(); i++ )
1680 QWidget *w = symbolBtnsLayout->itemAt( i )->widget();
1682 w->setEnabled( enable );
1686 actnRemoveItem->setEnabled( enable );
1687 actnEditItem->setEnabled( enable );
1692 QPoint globalPos = groupTree->viewport()->mapToGlobal( point );
1694 QModelIndex index = groupTree->indexAt( point );
1695 if ( index.isValid() && !mGroupingMode )
1696 mGroupTreeContextMenu->popup( globalPos );
1701 QPoint globalPos = mSymbolViewStackedWidget->currentIndex() == 0
1702 ? listItems->viewport()->mapToGlobal( point )
1703 : mSymbolTreeView->viewport()->mapToGlobal( point );
1706 mGroupListMenu->clear();
1710 QAction *a =
nullptr;
1711 QStringList tags = mStyle->
tags();
1713 for (
const QString &tag : qgis::as_const( tags ) )
1715 a =
new QAction( tag, mGroupListMenu );
1719 mGroupListMenu->addAction( a );
1722 if ( tags.count() > 0 )
1724 mGroupListMenu->addSeparator();
1726 a =
new QAction( tr(
"Create New Tag…" ), mGroupListMenu );
1729 mGroupListMenu->addAction( a );
1732 mGroupMenu->popup( globalPos );
1737 const QList< ItemDetails > items = selectedItems();
1738 for (
const ItemDetails &details : items )
1740 mStyle->
addFavorite( details.entityType, details.name );
1746 const QList< ItemDetails > items = selectedItems();
1747 for (
const ItemDetails &details : items )
1755 QAction *selectedItem = qobject_cast<QAction *>( sender() );
1758 const QList< ItemDetails > items = selectedItems();
1768 tag = mStyle->
tag(
id );
1772 tag = selectedItem->data().toString();
1775 for (
const ItemDetails &details : items )
1777 mStyle->
tagSymbol( details.entityType, details.name, QStringList( tag ) );
1784 QAction *selectedItem = qobject_cast<QAction *>( sender() );
1788 const QList< ItemDetails > items = selectedItems();
1789 for (
const ItemDetails &details : items )
1791 mStyle->
detagSymbol( details.entityType, details.name );
1798 QStandardItemModel *treeModel = qobject_cast<QStandardItemModel *>( groupTree->model() );
1801 QModelIndex present = groupTree->currentIndex();
1802 if ( present.parent().data( Qt::UserRole + 1 ) !=
"smartgroups" )
1804 QMessageBox::critical(
this, tr(
"Edit Smart Group" ),
1805 tr(
"You have not selected a Smart Group. Kindly select a Smart Group to edit." ) );
1808 QStandardItem *item = treeModel->itemFromIndex( present );
1816 if ( dlg.exec() == QDialog::Rejected )
1819 mBlockGroupUpdates++;
1822 mBlockGroupUpdates--;
1825 QMessageBox::critical(
this, tr(
"Edit Smart Group" ),
1826 tr(
"There was some error while editing the smart group." ) );
1830 item->setData(
id );
1842 QgsHelp::openHelp( QStringLiteral(
"working_with_vector/style_library.html#the-style-manager" ) );
void setBaseStyleName(const QString &name)
Sets the base name for the style, which is used by the dialog to reflect the original style/XML file ...
void groupChanged(const QModelIndex &)
Trigerred when the current group (or tag) is changed.
void tagSymbolsAction()
Toggles the interactive item tagging mode.
void setSmartGroupsVisible(bool show)
Sets whether smart groups should be shown.
void editItem()
Triggers the dialog for editing the current item.
QString tags() const
returns the text value of the tags element
Temporarily sets a cursor override for the QApplication for the lifetime of the object.
bool addColorRamp(const QString &name, QgsColorRamp *colorRamp, bool update=false)
Adds a color ramp to the style.
void symbolSaved(const QString &name, QgsSymbol *symbol)
Emitted every time a new symbol has been added to the database.
Q_DECL_DEPRECATED void regrouped(QStandardItem *) SIP_DEPRECATED
void setBold(QStandardItem *)
sets the text of the item with bold font
bool save(QString filename=QString())
Saves style into a file (will use current filename if empty string is passed)
A dialog allowing users to customize and populate a QgsStyle.
QgsStyleManagerDialog(QgsStyle *style, QWidget *parent SIP_TRANSFERTHIS=nullptr, Qt::WindowFlags flags=Qt::WindowFlags(), bool readOnly=false)
Constructor for QgsStyleManagerDialog, with the specified parent widget and window flags...
Abstract base class for all rendered symbols.
a dialog for setting properties of a newly saved style.
static const double UI_SCALE_FACTOR
UI scaling factor.
This class is a composition of two QSettings instances:
QgsColorBrewerColorRamp * clone() const override
Creates a clone of the color ramp.
void populateList()
Refreshes the list of items.
void onFinished()
Called when the dialog is going to be closed.
QgsSmartConditionMap conditionMap()
returns the condition map
int addSmartgroup()
Triggers the dialog to add a new smart group.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
void selectedSymbolsChanged(const QItemSelection &selected, const QItemSelection &deselected)
Perform tasks when the selected symbols change.
QStringList tagsOfSymbol(StyleEntity type, const QString &symbol)
Returns the tags associated with the symbol.
QString name() const
returns the text value of the name element
Abstract base class for color ramps.
QMap< int, QString > QgsSymbolGroupMap
QString schemeName() const
static QString iconPath(const QString &iconFile)
Returns path to the desired icon file.
bool saveColorRamp(const QString &name, QgsColorRamp *ramp, bool favorite, const QStringList &tags)
Adds the colorramp to the DB.
void populateGroups()
populate the groups
bool tagSymbol(StyleEntity type, const QString &symbol, const QStringList &tags)
Tags the symbol with the tags in the list.
void importItems()
Triggers the dialog to import items.
bool addColorRamp()
add a new color ramp to style
Q_DECL_DEPRECATED void populateTypes() SIP_DEPRECATED
Populate combo box with known style items (symbols, color ramps).
A dialog which allows users to modify the properties of a QgsColorBrewerColorRamp.
QgsColorRamp * colorRamp(const QString &name) const
Returns a new copy of the specified color ramp.
Q_DECL_DEPRECATED void itemChanged(QStandardItem *item) SIP_DEPRECATED
QString smartgroupName()
returns the value from mNameLineEdit
bool removeColorRamp(const QString &name)
Removes color ramp from style (and delete it)
bool rename(StyleEntity type, int id, const QString &newName)
Renames the given entity with the specified id.
A dialog which allows users to modify the properties of a QgsGradientColorRamp.
A dialog which allows users to modify the properties of a QgsPresetSchemeColorRamp.
A marker symbol type, for rendering Point and MultiPoint geometries.
A line symbol type, for rendering LineString and MultiLineString geometries.
static QgsStyle * defaultStyle()
Returns default application-wide style.
A dialog which allows users to modify the properties of a QgsLimitedRandomColorRamp.
StyleEntity
Enum for Entities involved in a style.
void saveGeometry(QWidget *widget, const QString &keyName)
Save the wigget geometry into settings.
QString currentItemName()
SymbolType
Type of the symbol.
void tagSelectedSymbols(bool newTag=false)
Tag selected symbols using menu item selection.
bool restoreGeometry(QWidget *widget, const QString &keyName)
Restore the wigget geometry from settings.
QgsGradientColorRamp * clone() const override
Creates a clone of the color ramp.
bool addSymbol(int symbolType=-1)
add a new symbol to style
int colors() const
Returns the number of colors in the ramp.
Constrained random color ramp, which returns random colors based on preset parameters.
void filterSymbols(const QString &filter)
Sets the filter string to filter symbols by.
QString tag(int id) const
Returns the tag name for the given id.
Q_DECL_DEPRECATED bool removeColorRamp() SIP_DEPRECATED
void exportItemsSVG()
Triggers the dialog to export selected items as SVG files.
QStringList symbolNames()
Returns a list of names of symbols.
bool removeFavorite(StyleEntity type, const QString &name)
Removes the specified symbol from favorites.
QgsGradientColorRamp ramp
QgsPresetSchemeColorRamp * clone() const override
Creates a clone of the color ramp.
bool remove(StyleEntity type, int id)
Removes the specified entity from the db.
void groupsModified()
Is emitted every time a tag or smartgroup has been added, removed, or renamed.
void enableItemsForGroupingMode(bool)
Enables or disables the groupTree items for grouping mode.
void editSmartgroupAction()
Triggers the dialog for editing the selected smart group.
void exportSelectedItemsImages(const QString &dir, const QString &format, QSize size)
Triggers the dialog to export selected items as images of the specified format and size...
int addTag(const QString &tagName)
Adds a new tag and returns the tag's id.
Q_DECL_DEPRECATED void populateColorRamps(const QStringList &colorRamps, bool checkable=false) SIP_DEPRECATED
Populates the list view with color ramps of the current type with the given names.
void symbolSelected(const QModelIndex &)
Perform symbol specific tasks when selected.
QString smartgroupOperator(int id)
Returns the operator for the smartgroup clumsy implementation TODO create a class for smartgroups...
void grouptreeContextMenu(QPoint)
Context menu for the groupTree.
static QString addColorRampStatic(QWidget *parent, QgsStyle *style, QString RampType=QString())
Opens the add color ramp dialog, returning the new color ramp's name if the ramp has been added...
void removeFavoriteSelectedSymbols()
Remove selected symbols from favorites.
Export existing symbols mode.
A scheme based color ramp consisting of a list of predefined colors.
A QSortFilterProxyModel subclass for showing filtered symbol and color ramps entries from a QgsStyle ...
QgsGradientColorRamp * cloneGradientRamp() const
QgsSmartConditionMap smartgroup(int id)
Returns the QgsSmartConditionMap for the given id.
QStringList colorRampNames()
Returns a list of names of color ramps.
QgsLimitedRandomColorRamp * clone() const override
Creates a clone of the color ramp.
void enableSymbolInputs(bool)
Enables or disbables the symbol specific inputs.
Q_DECL_DEPRECATED void populateSymbols(const QStringList &symbolNames, bool checkable=false) SIP_DEPRECATED
Populates the list view with symbols of the current type with the given names.
void setFavoritesGroupVisible(bool show)
Sets whether the favorites group should be shown.
int tagId(const QString &tag)
Returns the DB id for the given tag name.
QString schemeName() const
Returns the name of the color brewer color scheme.
void groupRenamed(QStandardItem *item)
Triggered when a group item is renamed.
void addFavoriteSelectedSymbols()
Add selected symbols to favorites.
bool addSymbol(const QString &name, QgsSymbol *symbol, bool update=false)
Adds a symbol to style and takes symbol's ownership.
QStringList tags() const
Returns a list of all tags in the style database.
int addSmartgroup(const QString &name, const QString &op, const QgsSmartConditionMap &conditions)
Adds a new smartgroup to the database and returns the id.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
void setOperator(const QString &)
sets the operator AND/OR
QgsCptCityColorRamp * clone() const override
Creates a clone of the color ramp.
void activate()
Raises, unminimizes and activates this window.
QgsPresetSchemeColorRamp ramp
Q_DECL_DEPRECATED void setSymbolsChecked(const QStringList &) SIP_DEPRECATED
void removeGroup()
Removes the selected tag or smartgroup.
static void openHelp(const QString &key)
Opens help topic for the given help key using default system web browser.
void listitemsContextMenu(QPoint)
Context menu for the listItems ( symbols list )
Color ramp utilising "Color Brewer" preset color schemes.
bool isFavorite() const
returns whether the favorite element is checked
int addTag()
Triggers the dialog to add a new tag.
void setSmartgroupName(const QString &)
sets the smart group Name
void exportItemsPNG()
Triggers the dialog to export selected items as PNG files.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
void showHelp()
Opens the associated help.
QgsSymbol * symbol(const QString &name)
Returns a NEW copy of symbol.
void addItem()
Triggers the dialog for adding a new item, based on the currently selected item type tab...
void exportItems()
Triggers the dialog to export items.
bool saveSymbol(const QString &name, QgsSymbol *symbol, bool favorite, const QStringList &tags)
Adds the symbol to the DB with the tags.
void onClose()
Closes the dialog.
bool removeSymbol(const QString &name)
Removes symbol from style (and delete it)
A dialog which allows users to modify the properties of a QgsCptCityColorRamp.
Style entity type, see QgsStyle::StyleEntity.
QgsColorBrewerColorRamp ramp
bool addFavorite(StyleEntity type, const QString &name)
Adds the specified symbol to favorites.
Gradient color ramp, which smoothly interpolates between two colors and also supports optional extra ...
QgsLimitedRandomColorRamp ramp
void setConditionMap(const QgsSmartConditionMap &)
sets up the GUI for the given conditionmap
QString variantName() const
bool detagSymbol(StyleEntity type, const QString &symbol, const QStringList &tags)
Detags the symbol with the given list.
QStringList symbolsOfFavorite(StyleEntity type) const
Returns the symbol names which are flagged as favorite.
QMultiMap< QString, QString > QgsSmartConditionMap
A multimap to hold the smart group conditions as constraint and parameter pairs.
bool saveAsGradientRamp() const
Returns true if the ramp should be converted to a QgsGradientColorRamp.
void removeItem()
Removes the current selected item.
QgsSymbolGroupMap smartgroupsListMap()
Returns the smart groups map with id as key and name as value.
Q_DECL_DEPRECATED bool removeSymbol() SIP_DEPRECATED
void detagSelectedSymbols()
Remove all tags from selected symbols.
Symbol type (for symbol entities)
QString conditionOperator()
returns the AND/OR condition
void enableGroupInputs(bool)
Enables or disables the groupTree specific inputs.