From kde-commits Tue Mar 04 15:35:40 2003 From: Carsten Pfeiffer Date: Tue, 04 Mar 2003 15:35:40 +0000 To: kde-commits Subject: qt-copy/src/widgets X-MARC-Message: https://marc.info/?l=kde-commits&m=104679217514287 CVS commit by pfeiffer: re-applied click handling fix M +12 -0 qcheckbox.cpp 1.50 M +1 -1 qcheckbox.h 1.49 M +9 -1 qradiobutton.cpp 1.50 --- qt-copy/src/widgets/qcheckbox.cpp #1.49:1.50 @@ -346,3 +346,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.48:1.49 @@ -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.49:1.50 @@ -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 ); }