CVS commit by pfeiffer: apply Anders' patch (will be in 3.2): don't toggle checkboxes/radiobuttons when hitting empty label area M +12 -0 qcheckbox.cpp 1.48 M +1 -1 qcheckbox.h 1.47 M +9 -1 qradiobutton.cpp 1.48 --- qt-copy/src/widgets/qcheckbox.cpp #1.47:1.48 @@ -343,3 +343,15 @@ void QCheckBox::updateMask() setMask(bm); } + +bool QCheckBox::hitButton( const QPoint &pos ) const +{ + QRect r = QStyle::visualRect( style().subRect( QStyle::SR_CheckBoxFocusRect, this ), this ); + if ( qApp->reverseLayout() ) { + r.setRight( width() ); + } else { + r.setLeft( 0 ); + } + return r.contains( pos ); +} + #endif --- qt-copy/src/widgets/qcheckbox.h #1.46:1.47 @@ -73,5 +73,5 @@ protected: void drawButtonLabel( QPainter * ); void updateMask(); - + virtual bool hitButton( const QPoint &pos ) const; private: // Disabled copy constructor and operator= #if defined(Q_DISABLE_COPY) --- qt-copy/src/widgets/qradiobutton.cpp #1.47:1.48 @@ -175,5 +175,13 @@ QSize QRadioButton::sizeHint() const bool QRadioButton::hitButton( const QPoint &pos ) const { - return rect().contains( pos ); + QRect r = + QStyle::visualRect( style().subRect( QStyle::SR_RadioButtonFocusRect, + this ), this ); + if ( qApp->reverseLayout() ) { + r.setRight( width() ); + } else { + r.setLeft( 0 ); + } + return r.contains( pos ); }