Commit 514a5944 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: SimplePreferences: Don't use QButtonGroup (fix #8609)

parent a42bb441
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <QString> #include <QString>
#include <QFont> #include <QFont>
#include <QToolButton> #include <QToolButton>
#include <QButtonGroup> #include <QSignalMapper>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QScrollArea> #include <QScrollArea>
...@@ -61,10 +61,11 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent, bool sma ...@@ -61,10 +61,11 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent, bool sma
{ {
QVBoxLayout *layout = new QVBoxLayout(); QVBoxLayout *layout = new QVBoxLayout();
QButtonGroup *buttonGroup = new QButtonGroup( this ); /* Use autoExclusive buttons and a mapper as QButtonGroup can't
buttonGroup->setExclusive ( true ); set focus (keys) when it manages the buttons's exclusivity.
CONNECT( buttonGroup, buttonClicked ( int ), See QT bugs 131 & 816 and QAbstractButton's source code. */
this, switchPanel( int ) ); QSignalMapper *mapper = new QSignalMapper( layout );
CONNECT( mapper, mapped(int), this, switchPanel(int) );
short icon_height = small ? ICON_HEIGHT /2 : ICON_HEIGHT; short icon_height = small ? ICON_HEIGHT /2 : ICON_HEIGHT;
...@@ -79,7 +80,9 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent, bool sma ...@@ -79,7 +80,9 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent, bool sma
button->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding) ; \ button->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding) ; \
button->setAutoRaise( true ); \ button->setAutoRaise( true ); \
button->setCheckable( true ); \ button->setCheckable( true ); \
buttonGroup->addButton( button, numb ); \ button->setAutoExclusive( true ); \
CONNECT( button, clicked(), mapper, map() ); \
mapper->setMapping( button, numb ); \
layout->addWidget( button ); layout->addWidget( button );
ADD_CATEGORY( SPrefsInterface, qtr("Interface"), qtr("Interface Settings"), ADD_CATEGORY( SPrefsInterface, qtr("Interface"), qtr("Interface Settings"),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment