Qt3 support is gone for the base UI
authorcoolo <coolo@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Wed, 5 Dec 2007 18:59:04 +0000 (18:59 +0000)
committercoolo <coolo@e0cc52ee-31ee-0310-8b87-e83c4596d67c>
Wed, 5 Dec 2007 18:59:04 +0000 (18:59 +0000)
git-svn-id: http://svn.opensuse.org/svn/yast/branches/tmp/coolo/qt4-port@42738 e0cc52ee-31ee-0310-8b87-e83c4596d67c

src/CMakeLists.txt
src/YQCheckBox.cc
src/YQCheckBox.h
src/YQDateField.cc
src/YQDateField.h

index 64d3a34..abbe0b1 100644 (file)
@@ -44,7 +44,6 @@ TARGET_LINK_LIBRARIES( py2qt4 ${YAST_YCP_LIBRARY} )
 TARGET_LINK_LIBRARIES( py2qt4 ${YAST_PLUGIN_WFM_LIBRARY} )
 TARGET_LINK_LIBRARIES( py2qt4 ${QT_QTCORE_LIBRARY} )
 TARGET_LINK_LIBRARIES( py2qt4 ${QT_QTGUI_LIBRARY} )
-TARGET_LINK_LIBRARIES( py2qt4 ${QT_QT3SUPPORT_LIBRARY} )
 TARGET_LINK_LIBRARIES( py2qt4 ${YAST_PLUGIN_UI_LIBRARY} )
 SET_TARGET_PROPERTIES( py2qt4 PROPERTIES SOVERSION 2 )
 
index eee97a5..c0aa3f8 100644 (file)
 YQCheckBox::YQCheckBox( YWidget *      parent,
                        const string &  label,
                        bool            checked )
-    : Q3GroupBox( (QWidget *) parent->widgetRep() )
+    : QCheckBox( fromUTF8( label ), (QWidget *) parent->widgetRep() )
     , YCheckBox( parent, label )
 {
     setWidgetRep( this );
-    setFrameStyle( NoFrame );
 
-    QBoxLayout * layout = new QBoxLayout( QBoxLayout::LeftToRight, this );
+    QCheckBox::setChecked( checked );
 
-    _qt_checkBox = new QCheckBox( fromUTF8( label ), this );
-    YUI_CHECK_NEW( _qt_checkBox );
-
-    layout->addSpacing( SPACING );
-    layout->addWidget( _qt_checkBox );
-    layout->addSpacing( SPACING );
-
-    _qt_checkBox->setChecked( checked );
-
-    connect( _qt_checkBox,     SIGNAL( stateChanged( int ) ),
+    connect( this,     SIGNAL( stateChanged( int ) ),
             this,              SLOT  ( stateChanged( int ) ) );
 }
 
@@ -66,7 +56,7 @@ YQCheckBox::~YQCheckBox()
 YCheckBoxState
 YQCheckBox::value()
 {
-    switch ( _qt_checkBox->checkState() )
+    switch ( checkState() )
     {
         case Qt::Checked:          return YCheckBox_on;
        case Qt::Unchecked:        return YCheckBox_off;
@@ -83,18 +73,18 @@ YQCheckBox::setValue( YCheckBoxState newValue )
     switch ( newValue )
     {
        case YCheckBox_on:
-           _qt_checkBox->setChecked( true );
-           _qt_checkBox->setTristate( false );
+            QCheckBox::setChecked( true );
+           setTristate( false );
            break;
 
        case YCheckBox_off:
-           _qt_checkBox->setChecked( false );
-           _qt_checkBox->setTristate( false );
+           QCheckBox::setChecked( false );
+           setTristate( false );
            break;
 
        case YCheckBox_dont_care:
-           _qt_checkBox->setTristate( true );
-           _qt_checkBox->setCheckState(Qt::PartiallyChecked);
+           QCheckBox::setTristate( true );
+           setCheckState(Qt::PartiallyChecked);
            break;
     }
 }
@@ -102,14 +92,14 @@ YQCheckBox::setValue( YCheckBoxState newValue )
 
 void YQCheckBox::setLabel( const string & label )
 {
-    _qt_checkBox->setText( fromUTF8( label ) );
+    setText( fromUTF8( label ) );
     YCheckBox::setLabel( label );
 }
 
 
 void YQCheckBox::setUseBoldFont( bool useBold )
 {
-    _qt_checkBox->setFont( useBold ?
+    setFont( useBold ?
                           YQUI::yqApp()->boldFont() :
                           YQUI::yqApp()->currentFont() );
 
@@ -119,33 +109,32 @@ void YQCheckBox::setUseBoldFont( bool useBold )
 
 void YQCheckBox::setEnabled( bool enabled )
 {
-    _qt_checkBox->setEnabled( enabled );
+    setEnabled( enabled );
     YWidget::setEnabled( enabled );
 }
 
 
 int YQCheckBox::preferredWidth()
 {
-    return 2*SPACING + _qt_checkBox->sizeHint().width();
+    return 2*SPACING + sizeHint().width();
 }
 
 
 int YQCheckBox::preferredHeight()
 {
-    return _qt_checkBox->sizeHint().height();
+    return sizeHint().height();
 }
 
 
 void YQCheckBox::setSize( int newWidth, int newHeight )
 {
-    _qt_checkBox->resize( newWidth - 2*SPACING, newHeight );
     resize( newWidth, newHeight );
 }
 
 
 bool YQCheckBox::setKeyboardFocus()
 {
-    _qt_checkBox->setFocus();
+    setFocus();
 
     return true;
 }
index ad01d44..8bdd471 100644 (file)
 #ifndef YQCheckBox_h
 #define YQCheckBox_h
 
-#include <Q3GroupBox>
+#include <QCheckBox>
 #include "YCheckBox.h"
 
-
-class QCheckBox;
-
-class YQCheckBox : public Q3GroupBox, public YCheckBox
+class YQCheckBox : public QCheckBox, public YCheckBox
 {
     Q_OBJECT
 
@@ -121,10 +118,6 @@ private slots:
      **/
     void stateChanged ( int newState );
 
-
-protected:
-
-    QCheckBox * _qt_checkBox;
 };
 
 #endif // YQCheckBox_h
index b08045c..55ee52f 100644 (file)
@@ -44,12 +44,12 @@ YQDateField::YQDateField( YWidget * parent, const string & label )
     YUI_CHECK_NEW( _caption );
     layout->addWidget( _caption );
 
-    _qt_dateEdit = new Q3DateEdit( this );
+    _qt_dateEdit = new QDateEdit( this );
     YUI_CHECK_NEW( _qt_dateEdit );
     layout->addWidget( _qt_dateEdit );
 
     //_qt_dateEdit->setAutoAdvance( true );
-    _qt_dateEdit->setOrder( Q3DateEdit::DMY );
+    _qt_dateEdit->setDisplayFormat( "dd.MM.yyyy" );
     _caption->setBuddy( _qt_dateEdit );
 }
 
index 2d975d0..2dbc9ca 100644 (file)
@@ -21,7 +21,7 @@
 #define YQDateField_h
 
 #include <QFrame>
-#include <Qt3Support/Q3DateEdit>
+#include <QDateEdit>
 
 #include "YDateField.h"
 
@@ -107,7 +107,7 @@ public:
 protected:
 
     YQWidgetCaption *  _caption;
-    Q3DateEdit *               _qt_dateEdit;
+    QDateEdit *                _qt_dateEdit;
 };