diff options
Diffstat (limited to 'src/modules/theme/packthemedialog.cpp')
| -rw-r--r-- | src/modules/theme/packthemedialog.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/modules/theme/packthemedialog.cpp b/src/modules/theme/packthemedialog.cpp index 43f80fa89..a9401f5c2 100644 --- a/src/modules/theme/packthemedialog.cpp +++ b/src/modules/theme/packthemedialog.cpp @@ -36,7 +36,12 @@ #include <qtooltip.h> #include <qimage.h> #include <kvi_tal_textedit.h> +#ifdef COMPILE_USE_QT4 +#include <Q3MultiLineEdit> +#include <QDateTime> +#else #include <qmultilineedit.h> +#endif #include <qbuffer.h> #include <qlabel.h> #include <qregexp.h> @@ -328,7 +333,11 @@ 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); @@ -365,7 +374,11 @@ 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 { @@ -394,7 +407,11 @@ bool KviPackThemeDialog::packTheme() if(!out.isNull()) { QByteArray * pba = new QByteArray(); +#ifdef COMPILE_USE_QT4 + QBuffer buffer(pba,0); +#else QBuffer buffer(*pba); +#endif buffer.open(IO_WriteOnly); out.save(&buffer,"PNG"); buffer.close(); @@ -428,7 +445,11 @@ 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(); |
