[yast-commit] r47241 - in /trunk/qt: VERSION.cmake package/yast2-qt.changes src/YQRadioButton.cc src/YQRadioButtonGroup.cc src/YQRadioButtonGroup.h
Author: sh-sh-sh
Date: Wed Apr 30 17:43:52 2008
New Revision: 47241
URL: http://svn.opensuse.org/viewcvs/yast?rev=47241&view=rev
Log:
Fixed bnc #379904: More than one radio button checked
Modified:
trunk/qt/VERSION.cmake
trunk/qt/package/yast2-qt.changes
trunk/qt/src/YQRadioButton.cc
trunk/qt/src/YQRadioButtonGroup.cc
trunk/qt/src/YQRadioButtonGroup.h
Modified: trunk/qt/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/VERSION.cmake?rev=47241&r1=47240&r2=47241&view=diff
==============================================================================
--- trunk/qt/VERSION.cmake (original)
+++ trunk/qt/VERSION.cmake Wed Apr 30 17:43:52 2008
@@ -1,3 +1,3 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "16")
-SET(VERSION_PATCH "44")
+SET(VERSION_PATCH "45")
Modified: trunk/qt/package/yast2-qt.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/package/yast2-qt.changes?rev=47241&r1=47240&r2=47241&view=diff
==============================================================================
--- trunk/qt/package/yast2-qt.changes (original)
+++ trunk/qt/package/yast2-qt.changes Wed Apr 30 17:43:52 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Apr 30 17:43:03 CEST 2008 - sh@suse.de
+
+- Fixed bnc #379904: More than one radio button checked
+- V 2.16.45
+
+-------------------------------------------------------------------
Tue Apr 29 17:05:40 CEST 2008 - sh@suse.de
- Fixed bnc #383672 - Busy cursor in file dialogs
Modified: trunk/qt/src/YQRadioButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQRadioButton.cc?rev=47241&r1=47240&r2=47241&view=diff
==============================================================================
--- trunk/qt/src/YQRadioButton.cc (original)
+++ trunk/qt/src/YQRadioButton.cc Wed Apr 30 17:43:52 2008
@@ -50,6 +50,12 @@
{
setWidgetRep( this );
+ // QRadioButton uses its own logic by default to make sure that only one
+ // button of a radio box is checked at any time, but this interferes with
+ // YRadioButtonGroup. Let YRadioButtonGroup and YQRadioButton::changed()
+ // handle this.
+ setAutoExclusive( false );
+
setChecked( checked );
installEventFilter(this);
@@ -98,6 +104,7 @@
{
YQSignalBlocker sigBlocker( this );
+ // yuiDebug() << "Setting " << this << (newValue ? " on" : " off") << endl;
setChecked( newValue );
if ( newValue )
@@ -132,12 +139,19 @@
}
-// slots
-
void YQRadioButton::changed( bool newState )
{
- if ( notify() && newState )
- YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
+ if ( newState )
+ {
+ yuiDebug() << "User set " << this << ( newState ? " on" : " off" ) << endl;
+ YRadioButtonGroup * group = buttonGroup();
+
+ if ( group )
+ group->uncheckOtherButtons( this );
+
+ if ( notify() )
+ YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
+ }
}
Modified: trunk/qt/src/YQRadioButtonGroup.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQRadioButtonGroup.cc?rev=47241&r1=47240&r2=47241&view=diff
==============================================================================
--- trunk/qt/src/YQRadioButtonGroup.cc (original)
+++ trunk/qt/src/YQRadioButtonGroup.cc Wed Apr 30 17:43:52 2008
@@ -23,12 +23,12 @@
#include "YQRadioButtonGroup.h"
#include "YQRadioButton.h"
+#include "qstring.h"
YQRadioButtonGroup::YQRadioButtonGroup( YWidget * parent )
: QWidget( (QWidget *) parent->widgetRep() )
, YRadioButtonGroup( parent )
- , _recursive( false )
{
setWidgetRep( this );
}
@@ -47,13 +47,8 @@
if ( button->value() ) // if this new button is active
{
- uncheckOtherButtons( button ); // make it the only active
+ uncheckOtherButtons( button ); // make it the only active one
}
-
- QRadioButton * radio_button = dynamic_cast
participants (1)
-
sh-sh-sh@svn.opensuse.org