From d1c3670021d656795b08950c9d503e84e683ff1e Mon Sep 17 00:00:00 2001 From: dmacvicar Date: Fri, 7 Dec 2007 14:19:00 +0000 Subject: [PATCH] YQPkgPatchFilterView QT3_SUPPORT git-svn-id: http://svn.opensuse.org/svn/yast/trunk/qt4@42811 e0cc52ee-31ee-0310-8b87-e83c4596d67c --- src/pkg/YQPkgPatchFilterView.cc | 73 ++++++++++++++++++--------------- src/pkg/YQPkgPatchFilterView.h | 6 +-- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/src/pkg/YQPkgPatchFilterView.cc b/src/pkg/YQPkgPatchFilterView.cc index 4754e15..8a433b5 100644 --- a/src/pkg/YQPkgPatchFilterView.cc +++ b/src/pkg/YQPkgPatchFilterView.cc @@ -18,18 +18,16 @@ /-*/ -#define QT3_SUPPORT 1 - #define y2log_component "qt-pkg" #include -#include -#include -#include -#include -#include -//Added by qt3to4: -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -53,39 +51,47 @@ using std::set; YQPkgPatchFilterView::YQPkgPatchFilterView( QWidget * parent ) - : Q3VBox( parent ) + : QWidget( parent ) { - Q3VBox * vbox; + QVBoxLayout *layout = new QVBoxLayout(this); + _splitter = new QSplitter( Qt::Vertical, this ); Q_CHECK_PTR( _splitter ); - vbox = new Q3VBox( _splitter ); Q_CHECK_PTR( vbox ); - _patchList = new YQPkgPatchList( vbox ); Q_CHECK_PTR( _patchList ); - - addVSpacing( vbox, 4 ); + layout->addWidget(_splitter); + QVBoxLayout * vbox = new QVBoxLayout(_splitter); + Q_CHECK_PTR( vbox ); + layout->addLayout(vbox); + _patchList = new YQPkgPatchList( this ); Q_CHECK_PTR( _patchList ); + vbox->addWidget(_patchList); + + //addVSpacing( vbox, 4 ); - Q3HBox * hbox = new Q3HBox( vbox ); Q_CHECK_PTR( hbox ); + QHBoxLayout * hbox = new QHBoxLayout( this ); Q_CHECK_PTR( hbox ); + vbox->addLayout(hbox); hbox->setSpacing( SPACING ); - QLabel * label = new QLabel( _( "&Show Patch Category:" ), hbox ); + QLabel * label = new QLabel( _( "&Show Patch Category:" ), this ); + hbox->addWidget(label); - _patchFilter = new QComboBox( hbox ); + _patchFilter = new QComboBox( this ); Q_CHECK_PTR( _patchFilter ); + hbox->addWidget(_patchFilter); - _patchFilter->insertItem( _( "Installable Patches" ), 0 ); - _patchFilter->insertItem( _( "Installable and Installed Patches" ), 1 ); - _patchFilter->insertItem( _( "All Patches" ), 2 ); - _patchFilter->setCurrentItem( 0 ); + _patchFilter->addItem( _( "Installable Patches" )); + _patchFilter->addItem( _( "Installable and Installed Patches" )); + _patchFilter->addItem( _( "All Patches" ), 2 ); + _patchFilter->setCurrentIndex( 0 ); _patchFilter->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert label->setBuddy( _patchFilter ); connect( _patchFilter, SIGNAL( activated( int ) ), this, SLOT( fillPatchList() ) ); - addVSpacing( vbox, 4 ); + //addVSpacing( vbox, 4 ); - vbox = new Q3VBox( _splitter ); Q_CHECK_PTR( vbox ); - addVSpacing( vbox, 8 ); + vbox = new QVBoxLayout( _splitter ); Q_CHECK_PTR( vbox ); + //addVSpacing( vbox, 8 ); - _detailsViews = new QTabWidget( vbox ); Q_CHECK_PTR( _detailsViews ); - _detailsViews->setMargin( MARGIN ); + _detailsViews = new QTabWidget( this ); Q_CHECK_PTR( _detailsViews ); + vbox->addWidget(_detailsViews); _descriptionView = new YQPkgDescriptionView( _detailsViews ); Q_CHECK_PTR( _descriptionView ); @@ -98,12 +104,13 @@ YQPkgPatchFilterView::YQPkgPatchFilterView( QWidget * parent ) // HBox for total download size // - addVSpacing( vbox, 4 ); - hbox = new Q3HBox( vbox ); Q_CHECK_PTR( hbox ); - addHStretch( hbox ); + hbox = new QHBoxLayout( this ); Q_CHECK_PTR( hbox ); + vbox->addLayout(hbox); + //addHStretch( hbox ); - new QLabel( _( "Estimated Download Size:" ) + " ", hbox ); - _totalDownloadSize = new QLabel( FSize(0).asString().c_str(), hbox ); + hbox->addWidget(new QLabel( _( "Estimated Download Size:" ) + " ", this )); + _totalDownloadSize = new QLabel( FSize(0).asString().c_str(), this ); + hbox->addWidget(_totalDownloadSize); Q_CHECK_PTR( _totalDownloadSize ); @@ -213,7 +220,7 @@ YQPkgPatchFilterView::updateTotalDownloadSize() void YQPkgPatchFilterView::fillPatchList() { - switch ( _patchFilter->currentItem() ) + switch ( _patchFilter->currentIndex() ) { case 0: _patchList->setFilterCriteria( YQPkgPatchList::RelevantPatches ); break; case 1: _patchList->setFilterCriteria( YQPkgPatchList::RelevantAndInstalledPatches ); break; diff --git a/src/pkg/YQPkgPatchFilterView.h b/src/pkg/YQPkgPatchFilterView.h index e12816c..0318451 100644 --- a/src/pkg/YQPkgPatchFilterView.h +++ b/src/pkg/YQPkgPatchFilterView.h @@ -22,9 +22,7 @@ #include "YQZypp.h" #include "YQPkgSelMapper.h" -#include -//Added by qt3to4: -#include +#include class YQPkgPatchList; @@ -39,7 +37,7 @@ class QTabWidget; * @short Display a list of zypp::Patch objects and ( below ) details about the * currently selected patch. **/ -class YQPkgPatchFilterView : public Q3VBox +class YQPkgPatchFilterView : public QWidget { Q_OBJECT -- 2.39.2