[yast-commit] r42683 - in /branches/tmp/coolo/qt4-port/src: QY2ComboTabWidget.cc pkg/YQPackageSelector.cc pkg/YQPackageSelector.h pkg/YQPackageSelectorBase.cc
Author: dmacvicar Date: Wed Dec 5 00:01:38 2007 New Revision: 42683 URL: http://svn.opensuse.org/viewcvs/yast?rev=42683&view=rev Log: now it starts to look like a package selector, QY2ComboTabWidget was the guilty one Modified: branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.cc branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.h branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc Modified: branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc?rev=42683&r1=42682&r2=42683&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc (original) +++ branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc Wed Dec 5 00:01:38 2007 @@ -42,14 +42,18 @@ const char * name ) : QWidget(parent) { + QVBoxLayout *vbox = new QVBoxLayout(this); + setLayout(vbox); + QHBoxLayout *hbox = new QHBoxLayout(this); + Q_CHECK_PTR( hbox ); // hbox->setFrameStyle( QFrame::Panel | QFrame::Raised ); // hbox->setLineWidth(2); // hbox->setMidLineWidth(2); hbox->setSpacing( SPACING ); hbox->setMargin ( MARGIN ); - Q_CHECK_PTR( hbox ); + vbox->addLayout(hbox); //this->setSpacing( SPACING ); this->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert @@ -68,6 +72,7 @@ widget_stack = new QStackedWidget( this ); Q_CHECK_PTR( widget_stack ); + vbox->addWidget(widget_stack); } Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.cc?rev=42683&r1=42682&r2=42683&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.cc (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.cc Wed Dec 5 00:01:38 2007 @@ -215,20 +215,18 @@ void YQPackageSelector::basicLayout() { - - layoutMenuBar(layout()); + QVBoxLayout *layout = new QVBoxLayout(this); + setLayout(layout); + layoutMenuBar(this); QSplitter * outer_splitter = new QSplitter( Qt::Horizontal, this ); - QVBoxLayout *layout = new QVBoxLayout(outer_splitter); - outer_splitter->setLayout(layout); - Q_CHECK_PTR( outer_splitter ); - QWidget * left_pane = layoutLeftPane ( outer_splitter->layout() ); - this->layout()->addWidget(left_pane); + layout->addWidget(outer_splitter); + + QWidget * left_pane = layoutLeftPane ( outer_splitter ); - QWidget * right_pane = layoutRightPane( outer_splitter->layout() ); - this->layout()->addWidget(right_pane); + QWidget * right_pane = layoutRightPane( outer_splitter ); outer_splitter->setResizeMode( left_pane, QSplitter::KeepSize ); outer_splitter->setResizeMode( right_pane, QSplitter::Stretch ); @@ -236,19 +234,18 @@ QWidget * -YQPackageSelector::layoutLeftPane( QLayout *parent_layout ) +YQPackageSelector::layoutLeftPane( QWidget *parent ) { - QSplitter * splitter = new QSplitter( Qt::Vertical, this ); + QSplitter * splitter = new QSplitter( Qt::Vertical, parent ); Q_CHECK_PTR( splitter ); splitter->setMargin( MARGIN ); - parent_layout->addWidget(splitter); QWidget * upper_vbox = new QWidget( splitter ); QVBoxLayout *layout = new QVBoxLayout(upper_vbox); upper_vbox->setLayout(layout); Q_CHECK_PTR( upper_vbox ); - layoutFilters( upper_vbox->layout() ); + layoutFilters( upper_vbox ); addVSpacing( upper_vbox, MARGIN ); QWidget * lower_vbox = new QWidget( splitter ); @@ -268,11 +265,11 @@ void -YQPackageSelector::layoutFilters( QLayout *parent_layout ) +YQPackageSelector::layoutFilters( QWidget *parent ) { - _filters = new QY2ComboTabWidget( _( "Fi<er:" ), this ); + _filters = new QY2ComboTabWidget( _( "Fi<er:" ), parent ); Q_CHECK_PTR( _filters ); - parent_layout->addWidget(_filters); + parent->layout()->addWidget(_filters); // // Update problem view @@ -283,7 +280,7 @@ if ( YQPkgUpdateProblemFilterView::haveProblematicPackages() || testMode() ) { - _updateProblemFilterView = new YQPkgUpdateProblemFilterView( this ); + _updateProblemFilterView = new YQPkgUpdateProblemFilterView( parent); Q_CHECK_PTR( _updateProblemFilterView ); _filters->addPage( _( "Update Problems" ), _updateProblemFilterView ); } @@ -308,7 +305,7 @@ if ( ! zyppPool().empty<zypp::Pattern>() || testMode() ) { - _patternList = new YQPkgPatternList( this, true ); + _patternList = new YQPkgPatternList( parent, true ); Q_CHECK_PTR( _patternList ); _filters->addPage( _( "Patterns" ), _patternList ); @@ -333,7 +330,7 @@ if ( ! zyppPool().empty<zypp::Selection>() || testMode() ) { - _selList = new YQPkgSelList( this, true ); + _selList = new YQPkgSelList( parent, true ); Q_CHECK_PTR( _selList ); _filters->addPage( _( "Selections" ), _selList ); @@ -355,7 +352,7 @@ // RPM group tags view // - _rpmGroupTagsFilterView = new YQPkgRpmGroupTagsFilterView( this ); + _rpmGroupTagsFilterView = new YQPkgRpmGroupTagsFilterView( parent ); Q_CHECK_PTR( _rpmGroupTagsFilterView ); _filters->addPage( _( "Package Groups" ), _rpmGroupTagsFilterView ); @@ -367,7 +364,7 @@ // Languages view // - _langList = new YQPkgLangList( this ); + _langList = new YQPkgLangList( parent ); Q_CHECK_PTR( _langList ); _filters->addPage( _( "Languages" ), _langList ); @@ -384,7 +381,7 @@ // Repository view // - _repoFilterView = new YQPkgRepoFilterView( this ); + _repoFilterView = new YQPkgRepoFilterView( parent ); Q_CHECK_PTR( _repoFilterView ); _filters->addPage( _( "Repositories" ), _repoFilterView ); @@ -393,7 +390,7 @@ // Package search view // - _searchFilterView = new YQPkgSearchFilterView( this ); + _searchFilterView = new YQPkgSearchFilterView( parent ); Q_CHECK_PTR( _searchFilterView ); _filters->addPage( _( "Search" ), _searchFilterView ); @@ -402,7 +399,7 @@ // Status change view // - _statusFilterView = new YQPkgStatusFilterView( this ); + _statusFilterView = new YQPkgStatusFilterView( parent ); Q_CHECK_PTR( _statusFilterView ); _filters->addPage( _( "Installation Summary" ), _statusFilterView ); @@ -418,15 +415,14 @@ QWidget * -YQPackageSelector::layoutRightPane( QLayout *parent_layout ) +YQPackageSelector::layoutRightPane( QWidget *parent ) { - QWidget * right_pane_vbox = new QWidget( this ); + QWidget * right_pane_vbox = new QWidget( parent ); QVBoxLayout *layout = new QVBoxLayout(right_pane_vbox); right_pane_vbox->setLayout(layout); Q_CHECK_PTR( right_pane_vbox ); - parent_layout->addWidget(right_pane_vbox); layout->setMargin( MARGIN ); @@ -435,27 +431,23 @@ Q_CHECK_PTR( splitter ); layout->addWidget(splitter); - QWidget * splitter_vbox = new QWidget( splitter ); - layout = new QVBoxLayout(splitter_vbox); - splitter_vbox->setLayout(layout); + Q_CHECK_PTR( splitter ); + layoutPkgList( splitter ); - Q_CHECK_PTR( splitter_vbox ); - layoutPkgList( right_pane_vbox->layout() ); - addVSpacing( splitter_vbox, MARGIN ); + addVSpacing( splitter, MARGIN ); - layoutDetailsViews( right_pane_vbox->layout() ); + layoutDetailsViews( splitter ); - layoutButtons( right_pane_vbox->layout() ); + layoutButtons( splitter ); return right_pane_vbox; } void -YQPackageSelector::layoutPkgList( QLayout *parent_layout ) +YQPackageSelector::layoutPkgList( QWidget *parent ) { - _pkgList= new YQPkgList( this ); - parent_layout->addWidget(_pkgList); + _pkgList= new YQPkgList( parent ); Q_CHECK_PTR( _pkgList ); connect( _pkgList, SIGNAL( statusChanged() ), @@ -464,13 +456,12 @@ void -YQPackageSelector::layoutDetailsViews( QLayout *parent_layout ) +YQPackageSelector::layoutDetailsViews( QWidget *parent ) { bool haveInstalledPkgs = YQPkgList::haveInstalledPkgs(); - QWidget * details_vbox = new QWidget( this ); + QWidget * details_vbox = new QWidget( parent ); Q_CHECK_PTR( details_vbox ); - parent_layout->addWidget(details_vbox); QVBoxLayout *layout = new QVBoxLayout(details_vbox); details_vbox->setLayout(layout); @@ -578,11 +569,10 @@ void -YQPackageSelector::layoutButtons( QLayout *parent_layout ) +YQPackageSelector::layoutButtons( QWidget *parent ) { - QWidget * button_box = new QWidget( this ); + QWidget * button_box = new QWidget( parent ); Q_CHECK_PTR( button_box ); - parent_layout->addWidget(button_box); QHBoxLayout *layout = new QHBoxLayout(button_box); button_box->setLayout(layout); @@ -635,12 +625,13 @@ void -YQPackageSelector::layoutMenuBar( QLayout *parent_layout ) +YQPackageSelector::layoutMenuBar( QWidget *parent ) { - _menuBar = new QMenuBar( this ); - parent_layout->addWidget(_menuBar); + _menuBar = new QMenuBar( parent ); Q_CHECK_PTR( _menuBar ); + parent->layout()->addWidget(_menuBar); + _fileMenu = 0; _viewMenu = 0; _pkgMenu = 0; Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.h?rev=42683&r1=42682&r2=42683&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.h (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.h Wed Dec 5 00:01:38 2007 @@ -202,13 +202,13 @@ void basicLayout(); - QWidget * layoutLeftPane ( QLayout *parent_layout ); - QWidget * layoutRightPane ( QLayout *parent_layout ); - void layoutFilters ( QLayout *parent_layout ); - void layoutPkgList ( QLayout *parent_layout ); - void layoutDetailsViews ( QLayout *parent_layout ); - void layoutButtons ( QLayout *parent_layout ); - void layoutMenuBar ( QLayout *parent_layout ); + QWidget * layoutLeftPane ( QWidget *parent ); + QWidget * layoutRightPane ( QWidget *parent ); + void layoutFilters ( QWidget *parent ); + void layoutPkgList ( QWidget *parent ); + void layoutDetailsViews ( QWidget *parent ); + void layoutButtons ( QWidget *parent ); + void layoutMenuBar ( QWidget *parent ); /** * Establish Qt signal / slot connections. Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc?rev=42683&r1=42682&r2=42683&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc Wed Dec 5 00:01:38 2007 @@ -26,6 +26,7 @@ #include <QAction> #include <QVBoxLayout> +#include <QHBoxLayout> #include "QY2LayoutUtils.h" #include "YQPackageSelectorBase.h" @@ -55,8 +56,8 @@ { setWidgetRep( this ); - QVBoxLayout *layout = new QVBoxLayout(this); - setLayout(layout); +// QHBoxLayout *layout = new QHBoxLayout(this); +// setLayout(layout); _showChangesDialog = false; _pkgConflictDialog = 0; -- 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