[yast-commit] r42690 - in /branches/tmp/coolo/qt4-port/src: YQRadioButton.cc YQRadioButton.h YQRadioButtonGroup.cc
Author: coolo Date: Wed Dec 5 10:21:20 2007 New Revision: 42690 URL: http://svn.opensuse.org/viewcvs/yast?rev=42690&view=rev Log: I didn't get why RadioButton is a group, so I got rid of this and also of one more Qt3 class Modified: branches/tmp/coolo/qt4-port/src/YQRadioButton.cc branches/tmp/coolo/qt4-port/src/YQRadioButton.h branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.cc Modified: branches/tmp/coolo/qt4-port/src/YQRadioButton.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQRadioButton.cc?rev=42690&r1=42689&r2=42690&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/YQRadioButton.cc (original) +++ branches/tmp/coolo/qt4-port/src/YQRadioButton.cc Wed Dec 5 10:21:20 2007 @@ -44,34 +44,26 @@ YQRadioButton::YQRadioButton( YWidget * parent, const string & label, bool checked ) - : Q3GroupBox( (QWidget *) (parent->widgetRep() ) ) + : QRadioButton( fromUTF8( label ), ( QWidget *) (parent->widgetRep() ) ) , YRadioButton( parent, label ) { setWidgetRep( this ); - setFrameStyle( NoFrame ); - QBoxLayout * layout = new QBoxLayout( QBoxLayout::LeftToRight, this ); - - _qt_radioButton = new QRadioButton( fromUTF8( label ), this ); - - layout->addSpacing( SPACING ); - layout->addWidget( _qt_radioButton ); - layout->addSpacing( SPACING ); - _qt_radioButton->setChecked( checked ); + setChecked( checked ); installEventFilter(this); - connect ( _qt_radioButton, SIGNAL( toggled ( bool ) ), - this, SLOT ( changed ( bool ) ) ); + connect ( this, SIGNAL( toggled ( bool ) ), + this, SLOT ( changed ( bool ) ) ); } void YQRadioButton::setUseBoldFont( bool useBold ) { - _qt_radioButton->setFont( useBold ? - YQUI::yqApp()->boldFont() : - YQUI::yqApp()->currentFont() ); + setFont( useBold ? + YQUI::yqApp()->boldFont() : + YQUI::yqApp()->currentFont() ); YRadioButton::setUseBoldFont( useBold ); } @@ -79,34 +71,33 @@ int YQRadioButton::preferredWidth() { - return 2 * SPACING + _qt_radioButton->sizeHint().width(); + return sizeHint().width(); } int YQRadioButton::preferredHeight() { - return _qt_radioButton->sizeHint().height(); + return sizeHint().height(); } void YQRadioButton::setSize( int newWidth, int newHeight ) { - _qt_radioButton->resize( newWidth - 2*SPACING, newHeight ); resize( newWidth, newHeight ); } bool YQRadioButton::value() { - return _qt_radioButton->isChecked(); + return isChecked(); } void YQRadioButton::setValue( bool newValue ) { - YQSignalBlocker sigBlocker( _qt_radioButton ); + YQSignalBlocker sigBlocker( this ); - _qt_radioButton->setChecked( newValue ); + setChecked( newValue ); if ( newValue ) { @@ -120,27 +111,21 @@ void YQRadioButton::setLabel( const string & label ) { - _qt_radioButton->setText( fromUTF8( label ) ); + setText( fromUTF8( label ) ); YRadioButton::setLabel( label ); } void YQRadioButton::setEnabled( bool enabled ) { - _qt_radioButton->setEnabled( enabled ); + setEnabled( enabled ); YWidget::setEnabled( enabled ); } -QRadioButton * YQRadioButton::getQtButton() -{ - return _qt_radioButton; -} - - bool YQRadioButton::setKeyboardFocus() { - _qt_radioButton->setFocus(); + setFocus(); return true; } Modified: branches/tmp/coolo/qt4-port/src/YQRadioButton.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQRadioButton.h?rev=42690&r1=42689&r2=42690&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/YQRadioButton.h (original) +++ branches/tmp/coolo/qt4-port/src/YQRadioButton.h Wed Dec 5 10:21:20 2007 @@ -21,14 +21,12 @@ #define YQRadioButton_h #include "YRadioButton.h" -#include <Qt3Support/Q3GroupBox> +#include <QRadioButton> - -class QRadioButton; using std::string; -class YQRadioButton : public Q3GroupBox, public YRadioButton +class YQRadioButton : public QRadioButton, public YRadioButton { Q_OBJECT @@ -103,12 +101,6 @@ **/ virtual bool setKeyboardFocus(); - /** - * Return the actual qt button. Used by YQButtonGroup. - **/ - QRadioButton * getQtButton(); - - protected slots: /** * Triggered when the RadioButton is toggled. @@ -120,10 +112,6 @@ **/ bool eventFilter( QObject * obj, QEvent * event ); - -protected: - - QRadioButton * _qt_radioButton; }; #endif // YQRadioButton_h Modified: branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.cc?rev=42690&r1=42689&r2=42690&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.cc (original) +++ branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.cc Wed Dec 5 10:21:20 2007 @@ -50,7 +50,7 @@ uncheckOtherButtons( button ); // make it the only active } - QRadioButton * radio_button = ( ( YQRadioButton * ) button )->getQtButton(); + QRadioButton * radio_button = dynamic_cast<YQRadioButton *>( button ); connect ( radio_button, SIGNAL ( toggled ( bool ) ), this, SLOT ( radioButtonClicked( bool ) ) ); @@ -96,7 +96,7 @@ if ( radioButton ) { - if ( radioButton->getQtButton() == senderButton ) + if ( radioButton == senderButton ) { // If this button has been clicked, it is to be the RadioBox's // active button - regardless of newState. This is to avoid -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
coolo@svn.opensuse.org