From 708a0e2ed1ee44fbdae476fde99c1271173b2bf9 Mon Sep 17 00:00:00 2001 From: dmacvicar Date: Fri, 7 Dec 2007 14:42:25 +0000 Subject: [PATCH] YQPkgDiskUsageWarningDialog QT3_SUPPORT git-svn-id: http://svn.opensuse.org/svn/yast/trunk/qt4@42813 e0cc52ee-31ee-0310-8b87-e83c4596d67c --- src/pkg/YQPkgDiskUsageWarningDialog.cc | 53 +++++++++++++------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/src/pkg/YQPkgDiskUsageWarningDialog.cc b/src/pkg/YQPkgDiskUsageWarningDialog.cc index 72aa528..bf7b7f3 100644 --- a/src/pkg/YQPkgDiskUsageWarningDialog.cc +++ b/src/pkg/YQPkgDiskUsageWarningDialog.cc @@ -18,19 +18,15 @@ /-*/ -#define QT3_SUPPORT 1 - #define y2log_component "qt-pkg" #include -#include -#include -#include -#include -#include -#include -//Added by qt3to4: -#include +#include +#include +#include +#include +#include +#include #include "YQPkgDiskUsageWarningDialog.h" #include "YQPkgDiskUsageList.h" @@ -51,39 +47,41 @@ YQPkgDiskUsageWarningDialog::YQPkgDiskUsageWarningDialog( QWidget * parent, : QDialog( parent ) { // Dialog title - setCaption( _( "Disk Space Warning" ) ); + setWindowTitle( _( "Disk Space Warning" ) ); // Enable dialog resizing even without window manager setSizeGripEnabled( true ); // Layout for the dialog ( can't simply insert a QVBox ) - Q3VBoxLayout * layout = new Q3VBoxLayout( this, MARGIN, SPACING ); + QVBoxLayout * layout = new QVBoxLayout( this ); + layout->setSpacing( SPACING ); + layout->setMargin ( MARGIN ); Q_CHECK_PTR( layout ); // HBox for icon and message - - Q3HBox * hbox = new Q3HBox( this ); + QHBoxLayout * hbox = new QHBoxLayout( this ); Q_CHECK_PTR( hbox ); - layout->addWidget( hbox ); + layout->addLayout( hbox ); // Icon - addHSpacing( hbox ); - QLabel * iconLabel = new QLabel( hbox ); + //addHSpacing( hbox ); + QLabel * iconLabel = new QLabel( this ); Q_CHECK_PTR( iconLabel ); + hbox->addWidget(iconLabel); #ifdef FIXME iconLabel->setPixmap( QApplication::style().stylePixmap( QStyle::SP_MessageBoxWarning ) ); #endif iconLabel->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); // hor/vert - addHSpacing( hbox ); // Label for the message - QLabel * label = new QLabel( message, hbox ); + QLabel * label = new QLabel( message, this); Q_CHECK_PTR( label ); + hbox->addWidget(label); label->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); // hor/vert @@ -97,38 +95,39 @@ YQPkgDiskUsageWarningDialog::YQPkgDiskUsageWarningDialog( QWidget * parent, // Button box - hbox = new Q3HBox( this ); + hbox = new QHBoxLayout( this ); Q_CHECK_PTR( hbox ); hbox->setSpacing( SPACING ); hbox->setMargin ( MARGIN ); - layout->addWidget( hbox ); + layout->addLayout( hbox ); - addHStretch( hbox ); + //addHStretch( hbox ); // Accept button - usually "OK" or "Continue" - QPushButton * button = new QPushButton( acceptButtonLabel, hbox ); + QPushButton * button = new QPushButton( acceptButtonLabel, this ); Q_CHECK_PTR( button ); - + hbox->addWidget(button); connect( button, SIGNAL( clicked() ), this, SLOT ( accept() ) ); - addHStretch( hbox ); + //addHStretch( hbox ); if ( ! rejectButtonLabel.isEmpty() ) { // Reject button ( if desired ) - usually "Cancel" - button = new QPushButton( rejectButtonLabel, hbox ); + button = new QPushButton( rejectButtonLabel, this ); Q_CHECK_PTR( button ); + hbox->addWidget(button); connect( button, SIGNAL( clicked() ), this, SLOT ( reject() ) ); - addHStretch( hbox ); + //addHStretch( hbox ); } // If there is only one button, it's safe to make that one ( the accept -- 2.39.2