25 #include <qradiobutton.h>
26 #include <QMouseEvent>
29 #define YUILogComponent "qt-ui"
30 #include <yui/YUILog.h>
34 #include "YQApplication.h"
35 #include <yui/YEvent.h>
36 #include "YQRadioButton.h"
37 #include <yui/YRadioButtonGroup.h>
38 #include "YQSignalBlocker.h"
52 const std::string & label,
54 : QRadioButton( fromUTF8( label ), ( QWidget *) (parent->widgetRep() ) )
55 , YRadioButton( parent, label )
63 setAutoExclusive(
false );
65 setChecked( checked );
67 installEventFilter(
this);
69 connect (
this, &pclass(
this)::toggled,
81 YRadioButton::setUseBoldFont( useBold );
87 return sizeHint().width();
93 return sizeHint().height();
99 resize( newWidth, newHeight );
114 setChecked( newValue );
118 YRadioButtonGroup * group = buttonGroup();
121 group->uncheckOtherButtons(
this );
128 setText( fromUTF8( label ) );
129 YRadioButton::setLabel( label );
135 QRadioButton::setEnabled( enabled );
136 YWidget::setEnabled( enabled );
152 yuiDebug() <<
"User set " <<
this << ( newState ?
" on" :
" off" ) << std::endl;
153 YRadioButtonGroup * group = buttonGroup();
156 group->uncheckOtherButtons(
this );
171 if ( event && event->type() == QEvent::MouseButtonRelease )
173 QMouseEvent * mouseEvent =
dynamic_cast<QMouseEvent *
> (event);
175 if ( mouseEvent && mouseEvent->button() == Qt::RightButton )
177 yuiMilestone() <<
"Right click on button detected" << std::endl;
182 return QObject::eventFilter( obj, event );
186 #include "YQRadioButton.moc"
Helper class to block Qt signals for QWidgets or QObjects as long as this object exists.
static YQApplication * yqApp()
Return the global YApplication object as YQApplication.
void maybeLeftHandedUser()
A mouse click with the wrong mouse button was detected - e.g., a right click on a push button...
void sendEvent(YEvent *event)
Widget event handlers (slots) call this when an event occured that should be the answer to a UserInpu...
static YQUI * ui()
Access the global Qt-UI.