summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2009-09-23 11:02:38 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-09-23 11:02:38 (GMT)
commita0b0a7b666714615109ae8698388e20966bb5e27 (patch)
tree6da7a469edf63767325088295e61d843d87ce4ff
parenta5f3e301a2026649704c71e0039fbddf0cda96fe (diff)
parentd1d65ed17d0f21e979a98ab695aa9e50c6ee078c (diff)
downloadQt-a0b0a7b666714615109ae8698388e20966bb5e27.zip
Qt-a0b0a7b666714615109ae8698388e20966bb5e27.tar.gz
Qt-a0b0a7b666714615109ae8698388e20966bb5e27.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r--src/gui/graphicsview/qgraphicslayout.cpp18
-rw-r--r--src/gui/graphicsview/qgraphicslayout.h1
-rw-r--r--src/gui/styles/gtksymbols.cpp3
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp2
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp6
-rw-r--r--tests/auto/q3table/tst_q3table.cpp2
-rw-r--r--tests/auto/qaudioinput/qaudioinput.pro12
-rw-r--r--tests/auto/qaudiooutput/qaudiooutput.pro12
-rw-r--r--tests/auto/qaudiooutput/tst_qaudiooutput.cpp24
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp11
-rw-r--r--tests/auto/qprogressbar/tst_qprogressbar.cpp2
-rw-r--r--tests/auto/qscriptengine/qscriptengine.pro1
-rw-r--r--tests/auto/qscriptextqobject/qscriptextqobject.pro4
-rw-r--r--tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro10
-rw-r--r--tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro2
15 files changed, 72 insertions, 38 deletions
diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp
index 0e4df71..f9800bc 100644
--- a/src/gui/graphicsview/qgraphicslayout.cpp
+++ b/src/gui/graphicsview/qgraphicslayout.cpp
@@ -419,6 +419,24 @@ void QGraphicsLayout::widgetEvent(QEvent *e)
\sa itemAt(), count()
*/
+/*!
+ This function is a convenience function provided for custom layouts, and will go through
+ all items in the layout and reparent their graphics items to the closest QGraphicsWidget
+ ancestor of the layout.
+
+ If \a layoutItem is already in a different layout, it will be removed from that layout.
+
+ If custom layouts want special behaviour they can ignore to use this function, and implement
+ their own behaviour.
+
+ \sa graphicsItem()
+ */
+void QGraphicsLayout::addChildLayoutItem(QGraphicsLayoutItem *layoutItem)
+{
+ Q_D(QGraphicsLayout);
+ d->addChildLayoutItem(layoutItem);
+}
+
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW
diff --git a/src/gui/graphicsview/qgraphicslayout.h b/src/gui/graphicsview/qgraphicslayout.h
index e872980..e214a62 100644
--- a/src/gui/graphicsview/qgraphicslayout.h
+++ b/src/gui/graphicsview/qgraphicslayout.h
@@ -78,6 +78,7 @@ public:
protected:
QGraphicsLayout(QGraphicsLayoutPrivate &, QGraphicsLayoutItem *);
+ void addChildLayoutItem(QGraphicsLayoutItem *layoutItem);
private:
Q_DISABLE_COPY(QGraphicsLayout)
diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp
index 23d25bd..1cb0ca4 100644
--- a/src/gui/styles/gtksymbols.cpp
+++ b/src/gui/styles/gtksymbols.cpp
@@ -211,7 +211,8 @@ static QString classPath(GtkWidget *widget)
static void resolveGtk()
{
- QLibrary libgtk(QLS("gtk-x11-2.0"));
+ // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
+ QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
QGtk::gtk_init = (Ptr_gtk_init)libgtk.resolve("gtk_init");
QGtk::gtk_window_new = (Ptr_gtk_window_new)libgtk.resolve("gtk_window_new");
QGtk::gtk_style_attach = (Ptr_gtk_style_attach)libgtk.resolve("gtk_style_attach");
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 25f4184..9db1de8 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -297,7 +297,7 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
for (int y = 0; y < maskHeight; ++y) {
uchar *src = (uchar *) mask.scanLine(y);
for (int x = 0; x < maskWidth; ++x)
- src[x] = -src[x];
+ src[x] = -src[x]; // convert 0 and 1 into 0 and 255
}
}
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index 5fcbb5f..3b23e56 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -895,7 +895,8 @@ static bool read_jpeg_image(QIODevice *device, QImage *outImage,
(void) jpeg_finish_decompress(&cinfo);
}
#ifndef QT_NO_IMAGE_SMOOTHSCALE
- } else if (scaledSize.isValid()) {
+ } else if (scaledSize.isValid() && scaledSize != QSize(cinfo.output_width, cinfo.output_height)
+ && quality >= HIGH_QUALITY_THRESHOLD) {
jpegSmoothScaler scaler(&cinfo, QString().sprintf("Scale( %d, %d, ScaleFree )",
scaledSize.width(),
@@ -946,6 +947,9 @@ static bool read_jpeg_image(QIODevice *device, QImage *outImage,
outImage->setDotsPerMeterX(int(100. * cinfo.X_density));
outImage->setDotsPerMeterY(int(100. * cinfo.Y_density));
}
+
+ if (scaledSize.isValid() && scaledSize != QSize(cinfo.output_width, cinfo.output_height))
+ *outImage = outImage->scaled(scaledSize, Qt::IgnoreAspectRatio, Qt::FastTransformation);
}
}
diff --git a/tests/auto/q3table/tst_q3table.cpp b/tests/auto/q3table/tst_q3table.cpp
index 1fe4412..ca65852 100644
--- a/tests/auto/q3table/tst_q3table.cpp
+++ b/tests/auto/q3table/tst_q3table.cpp
@@ -1379,7 +1379,7 @@ void tst_Q3Table::dateTimeEdit()
TimeTableItem *ti = new TimeTableItem(testWidget);
testWidget->setItem(0, 0, ti);
testWidget->show();
- QTest::qWaitForWindowShown(&testWidget);
+ QTest::qWaitForWindowShown(testWidget);
#ifdef WAITS
QTest::qWait(50);
#endif
diff --git a/tests/auto/qaudioinput/qaudioinput.pro b/tests/auto/qaudioinput/qaudioinput.pro
index 8a03749..f545a11 100644
--- a/tests/auto/qaudioinput/qaudioinput.pro
+++ b/tests/auto/qaudioinput/qaudioinput.pro
@@ -1,7 +1,15 @@
load(qttest_p4)
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
-
SOURCES += tst_qaudioinput.cpp
QT = core multimedia
+
+wince* {
+ deploy.sources += 4.wav
+ DEPLOYMENT = deploy
+ DEFINES += SRCDIR=\\\"\\\"
+ QT += gui
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
+}
+
diff --git a/tests/auto/qaudiooutput/qaudiooutput.pro b/tests/auto/qaudiooutput/qaudiooutput.pro
index 6c07c64..8657edb 100644
--- a/tests/auto/qaudiooutput/qaudiooutput.pro
+++ b/tests/auto/qaudiooutput/qaudiooutput.pro
@@ -1,12 +1,14 @@
load(qttest_p4)
-DEFINES += SRCDIR=\\\"$$PWD/\\\"
-
SOURCES += tst_qaudiooutput.cpp
QT = core multimedia
-wince*: {
- deploy.sources += 4.wav
- DEPLOYMENT = deploy
+wince* {
+ deploy.sources += 4.wav
+ DEPLOYMENT = deploy
+ DEFINES += SRCDIR=\\\"\\\"
+ QT += gui
+} else {
+ DEFINES += SRCDIR=\\\"$$PWD/\\\"
}
diff --git a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
index 6356fb3..db2444b 100644
--- a/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
+++ b/tests/auto/qaudiooutput/tst_qaudiooutput.cpp
@@ -117,37 +117,37 @@ void tst_QAudioOutput::notifyInterval()
void tst_QAudioOutput::pullFile()
{
if(available) {
- QFile filename(SRCDIR "4.wav");
- QVERIFY(filename.exists());
- filename.open(QIODevice::ReadOnly);
+ QFile file(SRCDIR "4.wav");
+ QVERIFY(file.exists());
+ file.open(QIODevice::ReadOnly);
QSignalSpy readSignal(audio, SIGNAL(notify()));
audio->setNotifyInterval(100);
- audio->start(&filename);
+ audio->start(&file);
QTestEventLoop::instance().enterLoop(1);
+ QCOMPARE(audio->totalTime(), qint64(692250));
// 4.wav is a little less than 700ms, so notify should fire 6 times!
QVERIFY(readSignal.count() >= 6);
- QVERIFY(audio->totalTime() == 692250);
audio->stop();
- filename.close();
+ file.close();
}
}
void tst_QAudioOutput::pushFile()
{
if(available) {
- QFile filename(SRCDIR "4.wav");
- QVERIFY(filename.exists());
- filename.open(QIODevice::ReadOnly);
+ QFile file(SRCDIR "4.wav");
+ QVERIFY(file.exists());
+ file.open(QIODevice::ReadOnly);
- const qint64 fileSize = filename.size();
+ const qint64 fileSize = file.size();
QIODevice* feed = audio->start(0);
char* buffer = new char[fileSize];
- filename.read(buffer, fileSize);
+ file.read(buffer, fileSize);
qint64 counter=0;
qint64 written=0;
@@ -162,7 +162,7 @@ void tst_QAudioOutput::pushFile()
QVERIFY(audio->totalTime() == 692250);
audio->stop();
- filename.close();
+ file.close();
delete [] buffer;
delete audio;
}
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index b549af6..8dfe836 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -77,6 +77,9 @@
#include <qabstractitemview.h>
#include "../../shared/util.h"
#include <qstyleditemdelegate.h>
+#ifndef QT_NO_STYLE_WINDOWS
+#include <qwindowsstyle.h>
+#endif
//TESTED_CLASS=
//TESTED_FILES=
@@ -2140,7 +2143,7 @@ void tst_QComboBox::task247863_keyBoardSelection()
combo.addItem( QLatin1String("222"));
combo.show();
QApplication::setActiveWindow(&combo);
- QTRY_COMPARE(QApplication::activeWindow(), &combo);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&combo));
QSignalSpy spy(&combo, SIGNAL(activated(const QString &)));
qApp->setEffectEnabled(Qt::UI_AnimateCombo, false);
@@ -2161,7 +2164,7 @@ void tst_QComboBox::task220195_keyBoardSelection2()
combo.addItem( QLatin1String("foo3"));
combo.show();
QApplication::setActiveWindow(&combo);
- QTRY_COMPARE(QApplication::activeWindow(), &combo);
+ QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&combo));
combo.setCurrentIndex(-1);
QVERIFY(combo.currentText().isNull());
@@ -2353,6 +2356,9 @@ void tst_QComboBox::subControlRectsWithOffset()
void tst_QComboBox::task260974_menuItemRectangleForComboBoxPopup()
{
+#ifdef QT_NO_STYLE_WINDOWS
+ QSKIP("test depends on windows style", QTest::SkipAll);
+#else
class TestStyle: public QWindowsStyle
{
public:
@@ -2385,6 +2391,7 @@ void tst_QComboBox::task260974_menuItemRectangleForComboBoxPopup()
QTRY_VERIFY(style.discoveredRect.width() <= comboBox.width());
}
+#endif
}
QTEST_MAIN(tst_QComboBox)
diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp
index ea9798b..d86094d 100644
--- a/tests/auto/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp
@@ -48,6 +48,8 @@
#include <qtimer.h>
#include <QStyleFactory>
+#include "../../shared/util.h"
+
//TESTED_CLASS=
//TESTED_FILES=
diff --git a/tests/auto/qscriptengine/qscriptengine.pro b/tests/auto/qscriptengine/qscriptengine.pro
index f72c070..d4c0f4c 100644
--- a/tests/auto/qscriptengine/qscriptengine.pro
+++ b/tests/auto/qscriptengine/qscriptengine.pro
@@ -12,5 +12,4 @@ wince*|symbian*: {
symbian: {
TARGET.UID3 = 0xE0340006
DEFINES += SYMBIAN_SRCDIR_UID=$$lower($$replace(TARGET.UID3,"0x",""))
- TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
}
diff --git a/tests/auto/qscriptextqobject/qscriptextqobject.pro b/tests/auto/qscriptextqobject/qscriptextqobject.pro
index 9da7f47..140a4e6 100644
--- a/tests/auto/qscriptextqobject/qscriptextqobject.pro
+++ b/tests/auto/qscriptextqobject/qscriptextqobject.pro
@@ -1,7 +1,3 @@
load(qttest_p4)
QT = core gui script
SOURCES += tst_qscriptextqobject.cpp
-
-symbian: {
- TARGET.EPOCHEAPSIZE="0x100000 0x1000000 // Min 1Mb, max 16Mb"
-}
diff --git a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
index 06b861e..07a4672 100644
--- a/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
+++ b/tests/auto/qscriptjstestsuite/qscriptjstestsuite.pro
@@ -1,12 +1,10 @@
load(qttest_p4)
QT = core script
SOURCES += tst_qscriptjstestsuite.cpp
-symbian {
- TARGET.EPOCHEAPSIZE = 0x020000 0xA00000
-} else {
- DEFINES += SRCDIR=\\\"$$PWD\\\"
-}
-wince*|symbian*: {
+
+!symbian: DEFINES += SRCDIR=\\\"$$PWD\\\"
+
+wince*|symbian: {
testFiles.sources = tests
testFiles.path = .
DEPLOYMENT += testFiles
diff --git a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
index 3f641b5..03e26bd 100644
--- a/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
+++ b/tests/auto/qscriptv8testsuite/qscriptv8testsuite.pro
@@ -8,5 +8,3 @@ testFiles.sources = tests
testFiles.path = .
DEPLOYMENT += testFiles
}
-
-symbian:TARGET.EPOCHEAPSIZE = 0x00020000 0x02000000