mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
[needs-docs] Show current tags for symbol when right clicking a symbol
in style manager
This commit is contained in:
parent
644c002c8d
commit
d775061bc6
@ -2211,8 +2211,11 @@ void QgsStyleManagerDialog::listitemsContextMenu( QPoint point )
|
||||
// Clear all actions and create new actions for every group
|
||||
mGroupListMenu->clear();
|
||||
|
||||
const QModelIndexList indices = listItems->selectionModel()->selectedRows();
|
||||
|
||||
if ( !mReadOnly )
|
||||
{
|
||||
const QStringList currentTags = indices.count() == 1 ? indices.at( 0 ).data( QgsStyleModel::TagRole ).toStringList() : QStringList();
|
||||
QAction *a = nullptr;
|
||||
QStringList tags = mStyle->tags();
|
||||
tags.sort();
|
||||
@ -2220,6 +2223,11 @@ void QgsStyleManagerDialog::listitemsContextMenu( QPoint point )
|
||||
{
|
||||
a = new QAction( tag, mGroupListMenu );
|
||||
a->setData( tag );
|
||||
if ( indices.count() == 1 )
|
||||
{
|
||||
a->setCheckable( true );
|
||||
a->setChecked( currentTags.contains( tag ) );
|
||||
}
|
||||
connect( a, &QAction::triggered, this, [ = ]( bool ) { tagSelectedSymbols(); }
|
||||
);
|
||||
mGroupListMenu->addAction( a );
|
||||
|
Loading…
x
Reference in New Issue
Block a user