diff options
Diffstat (limited to 'src/modules/theme/packthemedialog.cpp')
| -rw-r--r-- | src/modules/theme/packthemedialog.cpp | 60 |
1 files changed, 18 insertions, 42 deletions
diff --git a/src/modules/theme/packthemedialog.cpp b/src/modules/theme/packthemedialog.cpp index 036c95434..ec34c13a3 100644 --- a/src/modules/theme/packthemedialog.cpp +++ b/src/modules/theme/packthemedialog.cpp @@ -25,28 +25,6 @@ #include "packthemedialog.h" #include "themefunctions.h" -#include <qlayout.h> -#include <qpushbutton.h> -#include <qlineedit.h> -#include <qregexp.h> -#include <qmessagebox.h> -#include <qdir.h> -#include <qcombobox.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qimage.h> -#include <kvi_tal_textedit.h> -#ifdef COMPILE_USE_QT4 -#include <q3multilineedit.h> -#include <QDateTime> -#else -#include <qmultilineedit.h> -#endif -#include <qbuffer.h> -#include <qlabel.h> -#include <qregexp.h> - - #include "kvi_options.h" #include "kvi_locale.h" #include "kvi_config.h" @@ -62,7 +40,23 @@ #include "kvi_selectors.h" #include "kvi_miscutils.h" #include "kvi_sourcesdate.h" +#include <kvi_tal_textedit.h> +#include <QLayout> +#include <QPushButton> +#include <QLineEdit> +#include <QRegExp> +#include <QMessageBox> +#include <QDir> +#include <QComboBox> +#include <QPainter> +#include <QToolTip> +#include <QImage> +#include <QDateTime> +#include <QBuffer> +#include <QLabel> + +#include <q3multilineedit.h> KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviThemeInfo> * pThemeInfoList) @@ -333,11 +327,7 @@ void KviPackThemeDialog::imageSelectionChanged(const QString &szImagePath) { QPixmap out; if(pix.width() > 300 || pix.height() > 225) -#ifdef COMPILE_USE_QT4 out.convertFromImage(pix.scaled(300,225,Qt::KeepAspectRatio,Qt::SmoothTransformation)); -#else - out.convertFromImage(pix.smoothScale(300,225,QImage::ScaleMin)); -#endif else out.convertFromImage(pix); m_pImageLabel->setPixmap(out); @@ -351,14 +341,12 @@ void KviPackThemeDialog::imageSelectionChanged(const QString &szImagePath) m_pImageLabel->setPixmap(QPixmap()); } - void KviPackThemeDialog::accept() { if(!packTheme())return; KviTalWizard::accept(); } - bool KviPackThemeDialog::packTheme() { m_pImageSelector->commit(); @@ -374,11 +362,7 @@ bool KviPackThemeDialog::packTheme() if(!pix.isNull()) { if(pix.width() > 300 || pix.height() > 225) - #ifdef COMPILE_USE_QT4 out.convertFromImage(pix.scaled(300,225,Qt::KeepAspectRatio)); - #else - out.convertFromImage(pix.smoothScale(300,225,QImage::ScaleMin)); -#endif else out.convertFromImage(pix); } else { @@ -407,11 +391,7 @@ bool KviPackThemeDialog::packTheme() if(!out.isNull()) { QByteArray * pba = new QByteArray(); -#ifdef COMPILE_USE_QT4 - QBuffer buffer(pba,0); -#else - QBuffer buffer(*pba); -#endif + QBuffer buffer(pba,0); buffer.open(IO_WriteOnly); out.save(&buffer,"PNG"); buffer.close(); @@ -445,11 +425,8 @@ bool KviPackThemeDialog::packTheme() { KviQString::sprintf(szTmp,"Theme%dScreenshot",iIdx); QByteArray * pba = new QByteArray(); -#ifdef COMPILE_USE_QT4 + QBuffer bufferz(pba,0); -#else - QBuffer bufferz(*pba); -#endif bufferz.open(IO_WriteOnly); pixScreenshot.save(&bufferz,"PNG"); bufferz.close(); @@ -486,4 +463,3 @@ bool KviPackThemeDialog::packTheme() return true; } - |
