[yast-commit] r42625 - in /branches/tmp/coolo/qt4-port/src: QY2ComboTabWidget.cc QY2ComboTabWidget.h pkg/YQPkgRepoFilterView.cc pkg/YQPkgRepoFilterView.h
![](https://seccdn.libravatar.org/avatar/d5900b51dba6d927d3feaf3b73360d4f.jpg?s=120&d=mm&r=g)
Author: dmacvicar Date: Mon Dec 3 17:30:42 2007 New Revision: 42625 URL: http://svn.opensuse.org/viewcvs/yast?rev=42625&view=rev Log: compile Modified: branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.h branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.cc branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.h Modified: branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2Comb... ============================================================================== --- branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc (original) +++ branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc Mon Dec 3 17:30:42 2007 @@ -19,12 +19,12 @@ /-*/ -#include <q3hbox.h> -#include <qcombobox.h> -#include <qlabel.h> -#include <q3widgetstack.h> -//Added by qt3to4: -#include <q3frame.h> +#include <QComboBox> +#include <QLabel> +#include <QStackedWidget> +#include <QHBoxLayout> + +#include <QFrame> #define y2log_component "qt-pkg" #include <ycp/y2log.h> @@ -40,33 +40,33 @@ QY2ComboTabWidget::QY2ComboTabWidget( const QString & label, QWidget * parent, const char * name ) - : Q3VBox( parent, name ) + : QWidget(parent) { - setFrameStyle( Q3Frame::Panel | Q3Frame::Raised ); - setLineWidth(2); - setMidLineWidth(2); - setSpacing( SPACING ); - setMargin ( MARGIN ); + QHBoxLayout *hbox = new QHBoxLayout(this); +// hbox->setFrameStyle( QFrame::Panel | QFrame::Raised ); +// hbox->setLineWidth(2); +// hbox->setMidLineWidth(2); + hbox->setSpacing( SPACING ); + hbox->setMargin ( MARGIN ); - - Q3HBox * hbox = new Q3HBox( this ); Q_CHECK_PTR( hbox ); - hbox->setSpacing( SPACING ); - hbox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert + //this->setSpacing( SPACING ); + this->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert - combo_label = new QLabel( label, hbox ); + combo_label = new QLabel(label); + hbox->addWidget(combo_label); Q_CHECK_PTR( combo_label ); - combo_box = new QComboBox( hbox ); + combo_box = new QComboBox( this ); Q_CHECK_PTR( combo_box ); - + hbox->addWidget(combo_box); combo_label->setBuddy( combo_box ); combo_box->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert connect( combo_box, SIGNAL( activated( int ) ), this, SLOT ( showPage ( int ) ) ); - widget_stack = new Q3WidgetStack( this ); + widget_stack = new QStackedWidget( this ); Q_CHECK_PTR( widget_stack ); } @@ -85,8 +85,8 @@ combo_box->addItem( page_label ); widget_stack->addWidget( new_page ); - if ( ! widget_stack->visibleWidget() ) - widget_stack->raiseWidget( new_page ); + if ( ! widget_stack->currentWidget() ) + widget_stack->setCurrentWidget( new_page ); } @@ -97,7 +97,7 @@ if ( page ) { - widget_stack->raiseWidget( page ); + widget_stack->setCurrentWidget( page ); // y2debug( "Changing current page" ); emit currentChanged( page ); } @@ -112,7 +112,7 @@ void QY2ComboTabWidget::showPage( QWidget * page ) { - widget_stack->raiseWidget( page ); + widget_stack->setCurrentWidget( page ); if ( page == pages[ combo_box->currentIndex() ] ) { @@ -125,17 +125,17 @@ // Search the dict for this page - Q3IntDictIterator<QWidget> it( pages ); + QHashIterator<int, QWidget *> it( pages ); - while ( it.current() ) + while ( it.hasNext() ) { - if ( page == it.current() ) + if ( page == it.value() ) { - combo_box->setCurrentIndex( it.currentKey() ); + combo_box->setCurrentIndex( it.key() ); return; } - ++it; + it.next(); } // If we come this far, that page isn't present in the dict. Modified: branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2Comb... ============================================================================== --- branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.h (original) +++ branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.h Mon Dec 3 17:30:42 2007 @@ -22,13 +22,12 @@ #ifndef QY2ComboTabWidget_h #define QY2ComboTabWidget_h -#include <q3vbox.h> -#include <qstring.h> -#include <q3intdict.h> +#include <QString> +#include <QHash> class QComboBox; class QLabel; -class Q3WidgetStack; +class QStackedWidget; class QWidget; @@ -36,7 +35,7 @@ * This widget is very much like a QTabWidget, but it uses a combo box above * the tab pages rather than a ( scrolled ) one-line row of tabs. **/ -class QY2ComboTabWidget : public Q3VBox +class QY2ComboTabWidget : public QWidget { Q_OBJECT @@ -95,8 +94,8 @@ QComboBox * combo_box; QLabel * combo_label; - Q3WidgetStack * widget_stack; - Q3IntDict<QWidget> pages; + QStackedWidget * widget_stack; + QHash<int, QWidget *> pages; }; #endif // QY2ComboTabWidget_h Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQP... ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.cc (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.cc Mon Dec 3 17:30:42 2007 @@ -26,8 +26,8 @@ #include "QY2ComboTabWidget.h" #include "QY2LayoutUtils.h" -//Added by qt3to4: -#include <q3frame.h> +#include <QVBoxLayout> +#include <QFrame> #include "YQPkgRepoFilterView.h" #include "YQPkgRepoList.h" #include "YQPkgRpmGroupTagsFilterView.h" @@ -39,17 +39,20 @@ YQPkgRepoFilterView::YQPkgRepoFilterView( QWidget * parent ) - : Q3VBox( parent ) + : QWidget( parent ) { QSplitter * splitter = new QSplitter( Qt::Vertical, this ); Q_CHECK_PTR( splitter ); - Q3VBox * upper_vbox = new Q3VBox( splitter ); - _repoList = new YQPkgRepoList( upper_vbox ); + QVBoxLayout * upper_vbox = new QVBoxLayout( splitter ); + + _repoList = new YQPkgRepoList( this ); + upper_vbox->addWidget(_repoList); + Q_CHECK_PTR( _repoList ); _repoList->setSizePolicy( QSizePolicy( QSizePolicy::Ignored, QSizePolicy::Expanding ) );// hor/vert - addVSpacing( upper_vbox, MARGIN ); + //addVSpacing( upper_vbox, MARGIN ); // Directly propagate signals filterStart() and filterFinished() @@ -91,9 +94,10 @@ QWidget * YQPkgRepoFilterView::layoutSecondaryFilters( QWidget * parent ) { - Q3VBox *vbox = new Q3VBox( parent ); + + QVBoxLayout *vbox = new QVBoxLayout( parent ); Q_CHECK_PTR( vbox ); - addVSpacing( vbox, MARGIN ); + //addVSpacing( vbox, MARGIN ); // Translators: This is a combo box where the user can apply a secondary filter // in addition to the primary filter by repository - one of @@ -102,20 +106,23 @@ // And yes, the colon really belongs there since this is one of the very // few cases where a combo box label is left to the combo box rather than // above it. - _secondaryFilters = new QY2ComboTabWidget( _( "&Secondary Filter:" ), vbox ); + _secondaryFilters = new QY2ComboTabWidget( _( "&Secondary Filter:" )); + vbox->addWidget(_secondaryFilters); + Q_CHECK_PTR( _secondaryFilters ); - _secondaryFilters->setFrameStyle( Q3Frame::Plain ); - _secondaryFilters->setLineWidth( 0 ); - _secondaryFilters->setMidLineWidth( 0 ); - _secondaryFilters->setMargin( 0 ); +// _secondaryFilters->setFrameStyle( Q3Frame::Plain ); +// _secondaryFilters->setLineWidth( 0 ); +// _secondaryFilters->setMidLineWidth( 0 ); +// _secondaryFilters->setMargin( 0 ); // // All Packages // - _allPackages = new QWidget( vbox ); + _allPackages = new QWidget( this ); + vbox->addWidget(_allPackages); Q_CHECK_PTR( _allPackages ); _secondaryFilters->addPage( _( "All Packages" ), _allPackages ); @@ -124,7 +131,9 @@ // RPM Groups // - _rpmGroupTagsFilterView = new YQPkgRpmGroupTagsFilterView( vbox ); + _rpmGroupTagsFilterView = new YQPkgRpmGroupTagsFilterView( this ); + vbox->addWidget(_rpmGroupTagsFilterView); + Q_CHECK_PTR( _rpmGroupTagsFilterView ); _secondaryFilters->addPage( _( "Package Groups" ), _rpmGroupTagsFilterView ); @@ -136,7 +145,8 @@ // Package search view // - _searchFilterView = new YQPkgSearchFilterView( vbox ); + _searchFilterView = new YQPkgSearchFilterView(this); + vbox->addWidget(_searchFilterView); Q_CHECK_PTR( _searchFilterView ); _secondaryFilters->addPage( _( "Search" ), _searchFilterView ); Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQP... ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.h (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.h Mon Dec 3 17:30:42 2007 @@ -21,7 +21,7 @@ #define YQPkgRepoFilterView_h #include "YQZypp.h" -#include <q3vbox.h> +#include <QWidget> class YQPkgRepoList; @@ -31,7 +31,7 @@ class YQPkgStatusFilterView; -class YQPkgRepoFilterView : public Q3VBox +class YQPkgRepoFilterView : public QWidget { Q_OBJECT -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
dmacvicar@svn.opensuse.org