Skip to content

Commit

Permalink
use QActionGroup to group style actions and make them radiobuttons (fix
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and nirvn committed Dec 18, 2019
1 parent e199159 commit fef798e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app/qgsmaplayerstyleguiutils.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit fef798e

Please sign in to comment.