aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/theme/packthemedialog.cpp
diff options
context:
space:
mode:
authorGravatar Noldor2007-02-28 16:27:12 +0000
committerGravatar Noldor2007-02-28 16:27:12 +0000
commit2f5fc762ecde1b4c97006aa4343ccf447297cbfc (patch)
tree7288b13b904a6eea4d5ccaeab5dd9df33dca99f6 /src/modules/theme/packthemedialog.cpp
parentsmall fix (diff)
downloadKVIrc-2f5fc762ecde1b4c97006aa4343ccf447297cbfc.tar.gz
KVIrc-2f5fc762ecde1b4c97006aa4343ccf447297cbfc.tar.bz2
KVIrc-2f5fc762ecde1b4c97006aa4343ccf447297cbfc.zip
more qt4 port
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@387 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/theme/packthemedialog.cpp')
-rw-r--r--src/modules/theme/packthemedialog.cpp21
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();