15#include <swbuttongroup.h>
16#include <QAbstractButton>
19SWButtonGroup::SWButtonGroup( QWidget* parent )
20 : QButtonGroup( parent )
23 connect(
this, SIGNAL( buttonClicked(QAbstractButton*) ),
this, SLOT( onButtonClicked(QAbstractButton*) ) );
27SWButtonGroup::~SWButtonGroup()
32void SWButtonGroup::addKeyButton( QPushButton* button,
int ID,
const QString& key )
34 _buttonKeys[ ID ] = key;
35 addButton( button, ID );
39void SWButtonGroup::onButtonClicked( QAbstractButton* button )
42 qDebug() <<
"group: on button clicked: " << id( button );
67 qDebug() <<
"SWButtonGroup::onDialValueChanged: FIXME!" << value;
70 QList<QAbstractButton*> buttList = buttons();
71 int listSize = buttList.size();
73 int newID = value % listSize;
106 QList<QAbstractButton*> buttList = buttons();
107 int listSize = buttList.size();
111 int nxtHover = _curID - 1;
114 nxtHover = ( _curID + 1 ) % listSize;
116 else if( nxtHover < 0 )
118 nxtHover = listSize - 1;
120 QAbstractButton* butt = buttList.at( nxtHover );
123 QString newStyle(
":/images/radiyo.%1.hover.png" );
124 QString key = _buttonKeys[ id( butt ) ];
127 butt->setIcon( QIcon( newStyle.arg( key ) ) );
129 qDebug() << key <<
": " << newStyle.arg( key ) ;
150 if( buttonID > -1 && buttonID < buttons().size() )
153 buttons().at( buttonID )->setIcon( QIcon() );