Skip to content
Permalink
Browse files

use QActionGroup to group style actions and make them radiobuttons (fix

  • Loading branch information
github-actions authored and nirvn committed Dec 17, 2019
1 parent e199159 commit fef798e5f34b7ec49ea701d5fbe4671101247406
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/app/qgsmaplayerstyleguiutils.cpp
@@ -62,11 +62,12 @@ QList<QAction *> QgsMapLayerStyleGuiUtils::actionsUseStyle( QgsMapLayer *layer,
bool onlyOneStyle = mgr->styles().count() == 1;

QList<QAction *> actions;
QActionGroup *styleGroup = new QActionGroup( parent );
const auto constStyles = mgr->styles();
for ( const QString &name : constStyles )
{
bool active = name == mgr->currentStyle();
QAction *actionUse = new QAction( name, parent );
QAction *actionUse = new QAction( name, styleGroup );
connect( actionUse, &QAction::triggered, this, &QgsMapLayerStyleGuiUtils::useStyle );
actionUse->setCheckable( true );
actionUse->setChecked( active );

0 comments on commit fef798e

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