Diffstat (limited to 'kaddressbook/imagewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/imagewidget.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/kaddressbook/imagewidget.cpp b/kaddressbook/imagewidget.cpp index eec5e08..6ecf66d 100644 --- a/kaddressbook/imagewidget.cpp +++ b/kaddressbook/imagewidget.cpp @@ -36,25 +36,29 @@ #include <kurlrequester.h> #include <kurl.h> #include <qcheckbox.h> -#include <qgroupbox.h> +#include <q3groupbox.h> #include <qlabel.h> #include <qlayout.h> #include <qpixmap.h> #include <qpushbutton.h> #include <qapplication.h> +#include <QDesktopWidget> +//Added by qt3to4: +#include <Q3GridLayout> +#include <Q3Frame> #include "imagewidget.h" ImageWidget::ImageWidget( QWidget *parent, const char *name ) : QWidget( parent, name ) { - QGridLayout *topLayout = new QGridLayout( this, 2, 1, KDialog::marginHint(), + Q3GridLayout *topLayout = new Q3GridLayout( this, 2, 1, KDialog::marginHint(), KDialog::spacingHint() ); - QGroupBox *photoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); - QGridLayout *boxLayout = new QGridLayout( photoBox->layout(), 3, 2, + Q3GroupBox *photoBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Photo" ), this ); + Q3GridLayout *boxLayout = new Q3GridLayout( photoBox->layout(), 3, 2, KDialog::spacingHint() ); boxLayout->setRowStretch( 2, 1 ); mPhotoLabel = new QLabel( photoBox ); @@ -62,9 +66,9 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) if ( QApplication::desktop()->width() > 320 ) fac = 6; mPhotoLabel->setFixedSize( 50*9/fac, 70*9/fac ); mPhotoLabel->setScaledContents( true ); - mPhotoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + mPhotoLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken ); boxLayout->addMultiCellWidget( mPhotoLabel, 0, 3, 0, 0 ); mPhotoUrl = new KURLRequester( photoBox ); #ifndef KAB_EMBEDDED @@ -74,9 +78,9 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) #endif //KAB_EMBEDDED boxLayout->addWidget( mPhotoUrl, 0, 1 ); - QHBox *hb1 = new QHBox ( photoBox ); + Q3HBox *hb1 = new Q3HBox ( photoBox ); mUsePhotoUrl = new QCheckBox( i18n( "Store as URL" ), hb1 ); mUsePhotoUrl->setEnabled( false ); boxLayout->addWidget( hb1, 1, 1 ); @@ -85,16 +89,16 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) boxLayout->addWidget( new QLabel( photoBox ), 2, 1 ); topLayout->addWidget( photoBox, 0, 0 ); - QGroupBox *logoBox = new QGroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); - boxLayout = new QGridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); + Q3GroupBox *logoBox = new Q3GroupBox( 0, Qt::Vertical, i18n( "Logo" ), this ); + boxLayout = new Q3GridLayout( logoBox->layout(), 3, 2, KDialog::spacingHint() ); boxLayout->setRowStretch( 2, 1 ); mLogoLabel = new QLabel( logoBox ); mLogoLabel->setFixedSize( 50*9/fac, 70*9/fac ); mLogoLabel->setScaledContents( true ); - mLogoLabel->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + mLogoLabel->setFrameStyle( Q3Frame::Panel | Q3Frame::Sunken ); boxLayout->addMultiCellWidget( mLogoLabel, 0, 3, 0, 0 ); mLogoUrl = new KURLRequester( logoBox ); #ifndef KAB_EMBEDDED @@ -103,9 +107,9 @@ ImageWidget::ImageWidget( QWidget *parent, const char *name ) //US qDebug("ImageWidget::ImageWidget KImageIO not defined 2"); #endif //KAB_EMBEDDED boxLayout->addWidget( mLogoUrl, 0, 1 ); - QHBox *hb2 = new QHBox ( logoBox ); + Q3HBox *hb2 = new Q3HBox ( logoBox ); mUseLogoUrl = new QCheckBox( i18n( "Store as URL" ), hb2 ); mUseLogoUrl->setEnabled( false ); boxLayout->addWidget( hb2, 1, 1 ); @@ -179,9 +183,9 @@ KABC::Picture ImageWidget::photo() const if ( mUsePhotoUrl->isChecked() ) photo.setUrl( mPhotoUrl->url() ); else { - QPixmap *px = mPhotoLabel->pixmap(); + const QPixmap *px = mPhotoLabel->pixmap(); if ( px ) { #ifndef KAB_EMBEDDED if ( px->height() > px->width() ) photo.setData( px->convertToImage().scaleHeight( 140 ) ); @@ -231,9 +235,9 @@ KABC::Picture ImageWidget::logo() const if ( mUseLogoUrl->isChecked() ) logo.setUrl( mLogoUrl->url() ); else { - QPixmap *px = mLogoLabel->pixmap(); + const QPixmap *px = mLogoLabel->pixmap(); if ( px ) { #ifndef KAB_EMBEDDED if ( px->height() > px->width() ) logo.setData( px->convertToImage().scaleHeight( 140 ) ); @@ -291,7 +295,7 @@ QPixmap ImageWidget::loadPixmap( const QString &url ) pixmap.load( url ); return pixmap; } -#ifndef KAB_EMBEDDED -#include "imagewidget.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_imagewidget.cpp" #endif //KAB_EMBEDDED |