diff options
Diffstat (limited to 'tests/auto')
292 files changed, 1117 insertions, 2951 deletions
diff --git a/tests/auto/corelib.pro b/tests/auto/corelib.pro index 7a655d6208..f9434d58bd 100644 --- a/tests/auto/corelib.pro +++ b/tests/auto/corelib.pro @@ -1,13 +1,9 @@ -# The tests in this .pro file _MUST_ use QtCore only (i.e. QT=core). -# The test system is allowed to run these tests before the test of Qt has -# been compiled. - TEMPLATE=subdirs SUBDIRS=\ + corelib \ collections \ exceptionsafety \ q_func_info \ - qanimationgroup \ qatomicint \ qatomicpointer \ qbitarray \ @@ -62,7 +58,6 @@ SUBDIRS=\ qscopedpointer \ qscopedvaluerollback \ qsemaphore \ - qsequentialanimationgroup \ qset \ qsharedpointer \ qsignalspy \ diff --git a/tests/auto/corelib/animation/animation.pro b/tests/auto/corelib/animation/animation.pro new file mode 100644 index 0000000000..0d852acc60 --- /dev/null +++ b/tests/auto/corelib/animation/animation.pro @@ -0,0 +1,9 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qabstractanimation \ + qanimationgroup \ + qparallelanimationgroup \ + qpauseanimation \ + qpropertyanimation \ + qsequentialanimationgroup \ + qvariantanimation diff --git a/tests/auto/corelib/animation/qabstractanimation/qabstractanimation.pro b/tests/auto/corelib/animation/qabstractanimation/qabstractanimation.pro new file mode 100644 index 0000000000..f518423765 --- /dev/null +++ b/tests/auto/corelib/animation/qabstractanimation/qabstractanimation.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +QT = core +SOURCES += tst_qabstractanimation.cpp \ + + +CONFIG += parallel_test diff --git a/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp b/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp new file mode 100644 index 0000000000..f9dad9154a --- /dev/null +++ b/tests/auto/corelib/animation/qabstractanimation/tst_qabstractanimation.cpp @@ -0,0 +1,171 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QtCore/qabstractanimation.h> +#include <QtCore/qanimationgroup.h> +#include <QtTest> + +class tst_QAbstractAnimation : public QObject +{ + Q_OBJECT +public: + tst_QAbstractAnimation() {}; + virtual ~tst_QAbstractAnimation() {}; + +public Q_SLOTS: + void init(); + void cleanup(); + +private slots: + void construction(); + void destruction(); + void currentLoop(); + void currentLoopTime(); + void currentTime(); + void direction(); + void group(); + void loopCount(); + void state(); + void totalDuration(); +}; + +class TestableQAbstractAnimation : public QAbstractAnimation +{ + Q_OBJECT + +public: + virtual ~TestableQAbstractAnimation() {}; + + int duration() const { return 10; } + virtual void updateCurrentTime(int) {} +}; + +class DummyQAnimationGroup : public QAnimationGroup +{ + Q_OBJECT +public: + int duration() const { return 10; } + virtual void updateCurrentTime(int) {} +}; + +void tst_QAbstractAnimation::init() +{ +} + +void tst_QAbstractAnimation::cleanup() +{ +} + +void tst_QAbstractAnimation::construction() +{ + TestableQAbstractAnimation anim; +} + +void tst_QAbstractAnimation::destruction() +{ + TestableQAbstractAnimation *anim = new TestableQAbstractAnimation; + delete anim; +} + +void tst_QAbstractAnimation::currentLoop() +{ + TestableQAbstractAnimation anim; + QCOMPARE(anim.currentLoop(), 0); +} + +void tst_QAbstractAnimation::currentLoopTime() +{ + TestableQAbstractAnimation anim; + QCOMPARE(anim.currentLoopTime(), 0); +} + +void tst_QAbstractAnimation::currentTime() +{ + TestableQAbstractAnimation anim; + QCOMPARE(anim.currentTime(), 0); + anim.setCurrentTime(10); + QCOMPARE(anim.currentTime(), 10); +} + +void tst_QAbstractAnimation::direction() +{ + TestableQAbstractAnimation anim; + QCOMPARE(anim.direction(), QAbstractAnimation::Forward); + anim.setDirection(QAbstractAnimation::Backward); + QCOMPARE(anim.direction(), QAbstractAnimation::Backward); + anim.setDirection(QAbstractAnimation::Forward); + QCOMPARE(anim.direction(), QAbstractAnimation::Forward); +} + +void tst_QAbstractAnimation::group() +{ + TestableQAbstractAnimation *anim = new TestableQAbstractAnimation; + DummyQAnimationGroup group; + group.addAnimation(anim); + QCOMPARE(anim->group(), &group); +} + +void tst_QAbstractAnimation::loopCount() +{ + TestableQAbstractAnimation anim; + QCOMPARE(anim.loopCount(), 1); + anim.setLoopCount(10); + QCOMPARE(anim.loopCount(), 10); +} + +void tst_QAbstractAnimation::state() +{ + TestableQAbstractAnimation anim; + QCOMPARE(anim.state(), QAbstractAnimation::Stopped); +} + +void tst_QAbstractAnimation::totalDuration() +{ + TestableQAbstractAnimation anim; + QCOMPARE(anim.duration(), 10); + anim.setLoopCount(5); + QCOMPARE(anim.totalDuration(), 50); +} + +QTEST_MAIN(tst_QAbstractAnimation) + +#include "tst_qabstractanimation.moc" diff --git a/tests/auto/qanimationgroup/qanimationgroup.pro b/tests/auto/corelib/animation/qanimationgroup/qanimationgroup.pro index 5e1be0cb10..5e1be0cb10 100644 --- a/tests/auto/qanimationgroup/qanimationgroup.pro +++ b/tests/auto/corelib/animation/qanimationgroup/qanimationgroup.pro diff --git a/tests/auto/qanimationgroup/tst_qanimationgroup.cpp b/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp index 26e2f2f4d8..26e2f2f4d8 100644 --- a/tests/auto/qanimationgroup/tst_qanimationgroup.cpp +++ b/tests/auto/corelib/animation/qanimationgroup/tst_qanimationgroup.cpp diff --git a/tests/auto/qparallelanimationgroup/qparallelanimationgroup.pro b/tests/auto/corelib/animation/qparallelanimationgroup/qparallelanimationgroup.pro index f2cacd3452..f2cacd3452 100644 --- a/tests/auto/qparallelanimationgroup/qparallelanimationgroup.pro +++ b/tests/auto/corelib/animation/qparallelanimationgroup/qparallelanimationgroup.pro diff --git a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp index d1d2860369..d1d2860369 100644 --- a/tests/auto/qparallelanimationgroup/tst_qparallelanimationgroup.cpp +++ b/tests/auto/corelib/animation/qparallelanimationgroup/tst_qparallelanimationgroup.cpp diff --git a/tests/auto/qpauseanimation/qpauseanimation.pro b/tests/auto/corelib/animation/qpauseanimation/qpauseanimation.pro index 7f612b69fe..7f612b69fe 100644 --- a/tests/auto/qpauseanimation/qpauseanimation.pro +++ b/tests/auto/corelib/animation/qpauseanimation/qpauseanimation.pro diff --git a/tests/auto/qpauseanimation/tst_qpauseanimation.cpp b/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp index ea99e19fb3..ea99e19fb3 100644 --- a/tests/auto/qpauseanimation/tst_qpauseanimation.cpp +++ b/tests/auto/corelib/animation/qpauseanimation/tst_qpauseanimation.cpp diff --git a/tests/auto/qpropertyanimation/qpropertyanimation.pro b/tests/auto/corelib/animation/qpropertyanimation/qpropertyanimation.pro index 6d6ddbf65b..4dfd558610 100644 --- a/tests/auto/qpropertyanimation/qpropertyanimation.pro +++ b/tests/auto/corelib/animation/qpropertyanimation/qpropertyanimation.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT = core gui +QT = core gui widgets SOURCES += tst_qpropertyanimation.cpp diff --git a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp index f08879e1ce..e5feab4aa6 100644 --- a/tests/auto/qpropertyanimation/tst_qpropertyanimation.cpp +++ b/tests/auto/corelib/animation/qpropertyanimation/tst_qpropertyanimation.cpp @@ -40,12 +40,12 @@ ****************************************************************************/ #include <QtTest/QtTest> -#include "../../shared/util.h" +#include "../../../../shared/util.h" #include <QtCore/qpropertyanimation.h> #include <QtCore/qvariantanimation.h> -#include <QtGui/qwidget.h> -#include "../../shared/util.h" +#include <QtWidgets/qwidget.h> +#include "../../../../shared/util.h" //TESTED_CLASS=QPropertyAnimation //TESTED_FILES= diff --git a/tests/auto/qsequentialanimationgroup/qsequentialanimationgroup.pro b/tests/auto/corelib/animation/qsequentialanimationgroup/qsequentialanimationgroup.pro index c0c10c054d..c0c10c054d 100644 --- a/tests/auto/qsequentialanimationgroup/qsequentialanimationgroup.pro +++ b/tests/auto/corelib/animation/qsequentialanimationgroup/qsequentialanimationgroup.pro diff --git a/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp index eaebe3e14e..00c038b948 100644 --- a/tests/auto/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp +++ b/tests/auto/corelib/animation/qsequentialanimationgroup/tst_qsequentialanimationgroup.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtTest/QtTest> -#include "../../shared/util.h" +#include "../../../../shared/util.h" #include <QtCore/qanimationgroup.h> #include <QtCore/qsequentialanimationgroup.h> diff --git a/tests/auto/corelib/animation/qvariantanimation/qvariantanimation.pro b/tests/auto/corelib/animation/qvariantanimation/qvariantanimation.pro new file mode 100644 index 0000000000..6c463051e8 --- /dev/null +++ b/tests/auto/corelib/animation/qvariantanimation/qvariantanimation.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +QT = core +SOURCES += tst_qvariantanimation.cpp \ + + +CONFIG += parallel_test diff --git a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp new file mode 100644 index 0000000000..7dcfd1d4f5 --- /dev/null +++ b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp @@ -0,0 +1,164 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QtCore/qvariantanimation.h> +#include <QtTest> + +class tst_QVariantAnimation : public QObject +{ + Q_OBJECT + +public: + tst_QVariantAnimation() {} + virtual ~tst_QVariantAnimation() {} + +public slots: + void init(); + void cleanup(); + +private slots: + void construction(); + void destruction(); + void currentValue(); + void easingCurve(); + void startValue(); + void endValue(); + void keyValueAt(); + void keyValues(); + void duration(); +}; + +class TestableQVariantAnimation : public QVariantAnimation +{ + Q_OBJECT +public: + void updateCurrentValue(const QVariant&) {} +}; + +void tst_QVariantAnimation::init() +{ +} + +void tst_QVariantAnimation::cleanup() +{ +} + +void tst_QVariantAnimation::construction() +{ + TestableQVariantAnimation anim; +} + +void tst_QVariantAnimation::destruction() +{ + TestableQVariantAnimation *anim = new TestableQVariantAnimation; + delete anim; +} + +void tst_QVariantAnimation::currentValue() +{ + TestableQVariantAnimation anim; + QVERIFY(!anim.currentValue().isValid()); +} + +void tst_QVariantAnimation::easingCurve() +{ + TestableQVariantAnimation anim; + QVERIFY(anim.easingCurve() == QEasingCurve::Linear); + anim.setEasingCurve(QEasingCurve::InQuad); + QVERIFY(anim.easingCurve() == QEasingCurve::InQuad); +} + +void tst_QVariantAnimation::endValue() +{ + TestableQVariantAnimation anim; + anim.setEndValue(QVariant(1)); + QCOMPARE(anim.endValue().toInt(), 1); +} + +void tst_QVariantAnimation::startValue() +{ + TestableQVariantAnimation anim; + anim.setStartValue(QVariant(1)); + QCOMPARE(anim.startValue().toInt(), 1); + anim.setStartValue(QVariant(-1)); + QCOMPARE(anim.startValue().toInt(), -1); +} + +void tst_QVariantAnimation::keyValueAt() +{ + TestableQVariantAnimation anim; + + int i=0; + for (qreal r=0.0; r<1.0; r+=0.1) { + anim.setKeyValueAt(0.1, ++i); + QCOMPARE(anim.keyValueAt(0.1).toInt(), i); + } +} + +void tst_QVariantAnimation::keyValues() +{ + TestableQVariantAnimation anim; + + QVariantAnimation::KeyValues values; + int i=0; + for (qreal r=0.0; r<1.0; r+=0.1) { + values.append(QVariantAnimation::KeyValue(r, i)); + } + + anim.setKeyValues(values); + QCOMPARE(anim.keyValues(), values); +} + +void tst_QVariantAnimation::duration() +{ + TestableQVariantAnimation anim; + QCOMPARE(anim.duration(), 250); + anim.setDuration(500); + QCOMPARE(anim.duration(), 500); + QTest::ignoreMessage(QtWarningMsg, "QVariantAnimation::setDuration: cannot set a negative duration"); + anim.setDuration(-1); + QCOMPARE(anim.duration(), 500); +} + +QTEST_MAIN(tst_QVariantAnimation) + +#include "tst_qvariantanimation.moc" diff --git a/tests/auto/corelib/codecs/codecs.pro b/tests/auto/corelib/codecs/codecs.pro new file mode 100644 index 0000000000..41c5d8e46d --- /dev/null +++ b/tests/auto/corelib/codecs/codecs.pro @@ -0,0 +1,3 @@ +TEMPLATE=subdirs +SUBDIRS=\ + qtextcodec diff --git a/tests/auto/qtextcodec/.gitattributes b/tests/auto/corelib/codecs/qtextcodec/.gitattributes index a27a4d9153..a27a4d9153 100644 --- a/tests/auto/qtextcodec/.gitattributes +++ b/tests/auto/corelib/codecs/qtextcodec/.gitattributes diff --git a/tests/auto/qtextcodec/.gitignore b/tests/auto/corelib/codecs/qtextcodec/.gitignore index bdbd16ad43..bdbd16ad43 100644 --- a/tests/auto/qtextcodec/.gitignore +++ b/tests/auto/corelib/codecs/qtextcodec/.gitignore diff --git a/tests/auto/qtextcodec/QT4-crashtest.txt b/tests/auto/corelib/codecs/qtextcodec/QT4-crashtest.txt Binary files differindex d64a06e206..d64a06e206 100644 --- a/tests/auto/qtextcodec/QT4-crashtest.txt +++ b/tests/auto/corelib/codecs/qtextcodec/QT4-crashtest.txt diff --git a/tests/auto/qtextcodec/echo/echo.pro b/tests/auto/corelib/codecs/qtextcodec/echo/echo.pro index bf791ffc61..bf791ffc61 100644 --- a/tests/auto/qtextcodec/echo/echo.pro +++ b/tests/auto/corelib/codecs/qtextcodec/echo/echo.pro diff --git a/tests/auto/qtextcodec/echo/main.cpp b/tests/auto/corelib/codecs/qtextcodec/echo/main.cpp index 774cab1a9b..774cab1a9b 100644 --- a/tests/auto/qtextcodec/echo/main.cpp +++ b/tests/auto/corelib/codecs/qtextcodec/echo/main.cpp diff --git a/tests/auto/qtextcodec/korean.txt b/tests/auto/corelib/codecs/qtextcodec/korean.txt index 07e1b07f76..07e1b07f76 100644 --- a/tests/auto/qtextcodec/korean.txt +++ b/tests/auto/corelib/codecs/qtextcodec/korean.txt diff --git a/tests/auto/qtextcodec/qtextcodec.pro b/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro index 6cb13a9e06..6cb13a9e06 100644 --- a/tests/auto/qtextcodec/qtextcodec.pro +++ b/tests/auto/corelib/codecs/qtextcodec/qtextcodec.pro diff --git a/tests/auto/qtextcodec/test/test.pro b/tests/auto/corelib/codecs/qtextcodec/test/test.pro index 2188d2f22f..2188d2f22f 100644 --- a/tests/auto/qtextcodec/test/test.pro +++ b/tests/auto/corelib/codecs/qtextcodec/test/test.pro diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp index 4813f90652..4813f90652 100644 --- a/tests/auto/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp diff --git a/tests/auto/qtextcodec/utf8.txt b/tests/auto/corelib/codecs/qtextcodec/utf8.txt index f5ab44c8f4..f5ab44c8f4 100644 --- a/tests/auto/qtextcodec/utf8.txt +++ b/tests/auto/corelib/codecs/qtextcodec/utf8.txt diff --git a/tests/auto/corelib/corelib.pro b/tests/auto/corelib/corelib.pro new file mode 100644 index 0000000000..4c84fbbbcb --- /dev/null +++ b/tests/auto/corelib/corelib.pro @@ -0,0 +1,4 @@ +TEMPLATE=subdirs +SUBDIRS=\ + animation \ + codecs diff --git a/tests/auto/exceptionsafety_objects/exceptionsafety_objects.pro b/tests/auto/exceptionsafety_objects/exceptionsafety_objects.pro index 3f773c76f8..d09c349215 100644 --- a/tests/auto/exceptionsafety_objects/exceptionsafety_objects.pro +++ b/tests/auto/exceptionsafety_objects/exceptionsafety_objects.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets HEADERS += oomsimulator.h 3rdparty/valgrind.h 3rdparty/memcheck.h SOURCES += tst_exceptionsafety_objects.cpp diff --git a/tests/auto/gestures/gestures.pro b/tests/auto/gestures/gestures.pro index da5610f2f6..538e4f5d68 100644 --- a/tests/auto/gestures/gestures.pro +++ b/tests/auto/gestures/gestures.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_gestures.cpp diff --git a/tests/auto/gui.pro b/tests/auto/gui.pro index cf7db60c6d..4228c0b89a 100644 --- a/tests/auto/gui.pro +++ b/tests/auto/gui.pro @@ -115,13 +115,12 @@ SUBDIRS=\ qmovie \ qvolatileimage \ qnetworkaccessmanager_and_qprogressdialog \ + qopengl \ qpaintengine \ qpainterpath \ qpainterpathstroker \ qpalette \ - qparallelanimationgroup \ qpathclipper \ - qpauseanimation \ qpen \ qpicture \ qpixmapcache \ @@ -133,7 +132,6 @@ SUBDIRS=\ qprocess \ qprogressbar \ qprogressdialog \ - qpropertyanimation \ qpushbutton \ qquaternion \ qradiobutton \ @@ -169,9 +167,7 @@ SUBDIRS=\ qtableview \ qtablewidget \ qtcpsocket \ - qtessellator \ qtextblock \ - qtextcodec \ qtextcursor \ qtextdocumentfragment \ qtextdocumentlayout \ diff --git a/tests/auto/headersclean/headersclean.pro b/tests/auto/headersclean/headersclean.pro index 0f976ffb95..d18dc1c0a2 100644 --- a/tests/auto/headersclean/headersclean.pro +++ b/tests/auto/headersclean/headersclean.pro @@ -5,5 +5,3 @@ CONFIG += uitools contains(QT_CONFIG,dbus): QT += dbus contains(QT_CONFIG,opengl): QT += opengl -contains(QT_CONFIG,openvg): QT += openvg - diff --git a/tests/auto/headersclean/tst_headersclean.cpp b/tests/auto/headersclean/tst_headersclean.cpp index 41537776a7..831e7fe50a 100644 --- a/tests/auto/headersclean/tst_headersclean.cpp +++ b/tests/auto/headersclean/tst_headersclean.cpp @@ -64,10 +64,6 @@ #include <QtDBus/QtDBus> #endif -#ifndef QT_NO_OPENVG -#include <QtOpenVG/QtOpenVG> -#endif - class tst_HeadersClean: public QObject { Q_OBJECT diff --git a/tests/auto/lancelot/lancelot.pro b/tests/auto/lancelot/lancelot.pro index 67fff1b411..0b3901f7c4 100644 --- a/tests/auto/lancelot/lancelot.pro +++ b/tests/auto/lancelot/lancelot.pro @@ -1,5 +1,5 @@ load(qttest_p4) -QT += xml +QT += xml widgets contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl SOURCES += tst_lancelot.cpp \ diff --git a/tests/auto/languagechange/languagechange.pro b/tests/auto/languagechange/languagechange.pro index f161c50864..cc91fc2d55 100644 --- a/tests/auto/languagechange/languagechange.pro +++ b/tests/auto/languagechange/languagechange.pro @@ -1,4 +1,4 @@ load(qttest_p4) -QT += core-private +QT += widgets core-private SOURCES += tst_languagechange.cpp diff --git a/tests/auto/languagechange/tst_languagechange.cpp b/tests/auto/languagechange/tst_languagechange.cpp index 3a93209ccd..e1663a5830 100644 --- a/tests/auto/languagechange/tst_languagechange.cpp +++ b/tests/auto/languagechange/tst_languagechange.cpp @@ -46,10 +46,10 @@ #include <QtCore/QSet> #include <QtCore/QTranslator> #include <private/qthread_p.h> -#include <QtGui/QInputDialog> -#include <QtGui/QColorDialog> -#include <QtGui/QFileDialog> -#include <QtGui/QDesktopWidget> +#include <QtWidgets/QInputDialog> +#include <QtWidgets/QColorDialog> +#include <QtWidgets/QFileDialog> +#include <QtWidgets/QDesktopWidget> //TESTED_CLASS= diff --git a/tests/auto/macgui/macgui.pro b/tests/auto/macgui/macgui.pro index 8a57a8c54b..3fbe74f7c8 100644 --- a/tests/auto/macgui/macgui.pro +++ b/tests/auto/macgui/macgui.pro @@ -7,7 +7,7 @@ INCLUDEPATH += . SOURCES += tst_macgui.cpp guitest.cpp HEADERS += guitest.h -QT = core-private gui-private +QT = core-private gui-private widgets requires(mac) diff --git a/tests/auto/macnativeevents/macnativeevents.pro b/tests/auto/macnativeevents/macnativeevents.pro index af34942b12..0a0f6c8743 100644 --- a/tests/auto/macnativeevents/macnativeevents.pro +++ b/tests/auto/macnativeevents/macnativeevents.pro @@ -7,7 +7,7 @@ TEMPLATE = app DEPENDPATH += . INCLUDEPATH += . LIBS += -framework Carbon - +QT += widgets HEADERS += qnativeevents.h nativeeventlist.h expectedeventlist.h SOURCES += qnativeevents.cpp qnativeevents_mac.cpp SOURCES += expectedeventlist.cpp nativeeventlist.cpp diff --git a/tests/auto/maketestselftest/tst_maketestselftest.cpp b/tests/auto/maketestselftest/tst_maketestselftest.cpp index 07c68ac7ec..59dd43cb40 100644 --- a/tests/auto/maketestselftest/tst_maketestselftest.cpp +++ b/tests/auto/maketestselftest/tst_maketestselftest.cpp @@ -58,8 +58,6 @@ class tst_MakeTestSelfTest: public QObject Q_OBJECT private slots: - void tests_auto_pro(); - void tests_pro_files(); void tests_pro_files_data(); @@ -78,30 +76,6 @@ bool looks_like_testcase(QString const&,QString*); bool looks_like_subdirs(QString const&); QStringList find_test_class(QString const&); -/* - Verify that auto.pro only contains other .pro files (and not directories). - We enforce this so that we can process every .pro file other than auto.pro - independently and get all the tests. - If tests were allowed to appear directly in auto.pro, we'd have the problem - that we need to somehow run these tests from auto.pro while preventing - recursion into the other .pro files. -*/ -void tst_MakeTestSelfTest::tests_auto_pro() -{ - QStringList subdirsList = find_subdirs(SRCDIR "/../auto.pro", Flat); - if (QTest::currentTestFailed()) { - return; - } - - foreach (QString const& subdir, subdirsList) { - QVERIFY2(subdir.endsWith(".pro"), qPrintable(QString( - "auto.pro contains a subdir `%1'.\n" - "auto.pro must _only_ contain other .pro files, not actual subdirs.\n" - "Please move `%1' into some other .pro file referenced by auto.pro." - ).arg(subdir))); - } -} - /* Verify that all tests are listed somewhere in one of the autotest .pro files */ void tst_MakeTestSelfTest::tests_pro_files() { diff --git a/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro b/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro deleted file mode 100644 index 70ea53c369..0000000000 --- a/tests/auto/nativeimagehandleprovider/nativeimagehandleprovider.pro +++ /dev/null @@ -1,9 +0,0 @@ -load(qttest_p4) - -QT += gui-private - -SOURCES += tst_nativeimagehandleprovider.cpp -symbian { - LIBS += -lfbscli -lbitgdi - contains(QT_CONFIG, openvg): QT *= openvg -} diff --git a/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp b/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp deleted file mode 100644 index 3d198c7b12..0000000000 --- a/tests/auto/nativeimagehandleprovider/tst_nativeimagehandleprovider.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include <QtTest/QtTest> -#include <QtGui/private/qpixmapdata_p.h> -#include <QtGui/private/qnativeimagehandleprovider_p.h> -#include <QScopedPointer> -#include <QPixmap> -#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG) -#include <fbs.h> -#include <bitdev.h> -#include <QtOpenVG/private/qpixmapdata_vg_p.h> -#endif - -QPixmap pixmapFromNativeImageHandleProvider(QNativeImageHandleProvider *source) -{ -#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG) - if (!source) - return QPixmap(); - QScopedPointer<QPixmapData> pd(QPixmapData::create(0, 0, QPixmapData::PixmapType)); - pd->fromNativeType(source, QPixmapData::NativeImageHandleProvider); - return QPixmap(pd.take()); -#else - Q_UNUSED(source); - return QPixmap(); -#endif -} - -class DummyProvider : public QNativeImageHandleProvider -{ -public: - void get(void **handle, QString *type); - void release(void *handle, const QString &type); -}; - -void DummyProvider::get(void **handle, QString *type) -{ - *handle = (void *) 0x12345678; - *type = "some dummy type"; -} - -void DummyProvider::release(void *handle, const QString &type) -{ - Q_UNUSED(handle); - Q_UNUSED(type); -} - -#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG) -class BitmapProvider : public QNativeImageHandleProvider -{ -public: - BitmapProvider() : bmp(0), refCount(0), w(50), h(60) { } - void get(void **handle, QString *type); - void release(void *handle, const QString &type); - - CFbsBitmap *bmp; - int refCount, w, h; - void *returnedHandle; - QString returnedType; -}; - -void BitmapProvider::get(void **handle, QString *type) -{ - // There may not be a release() if the get() fails so don't bother with - // refcounting in such cases. - if (bmp) - ++refCount; - returnedType = QLatin1String("CFbsBitmap"); - returnedHandle = bmp; - *handle = returnedHandle; - *type = returnedType; -} - -void BitmapProvider::release(void *handle, const QString &type) -{ - if (handle == returnedHandle && type == returnedType && returnedHandle) { - --refCount; - } -} -#endif // symbian & openvg - -class tst_NativeImageHandleProvider : public QObject -{ - Q_OBJECT - -public: - tst_NativeImageHandleProvider() { } - -private slots: - void create(); - void bitmap(); - void hibernate(); -}; - -void tst_NativeImageHandleProvider::create() -{ - QPixmap pm = pixmapFromNativeImageHandleProvider(0); - QVERIFY(pm.isNull()); - QPixmap tmp(10, 20); - if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) { - // Verify that null pixmap is properly returned when get() provides bogus results. - DummyProvider prov; - pm = pixmapFromNativeImageHandleProvider(&prov); - QVERIFY(pm.isNull()); - pm = QPixmap(); - } else { - QSKIP("Not openvg, skipping non-trivial tests", SkipSingle); - } -} - -void tst_NativeImageHandleProvider::bitmap() -{ -#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG) - QPixmap tmp(10, 20); - if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) { - BitmapProvider prov; - - // This should fail because of null ptr. - QPixmap pm = pixmapFromNativeImageHandleProvider(&prov); - QVERIFY(pm.isNull()); - pm = QPixmap(); - QCOMPARE(prov.refCount, 0); - - prov.bmp = new CFbsBitmap; - QCOMPARE(prov.bmp->Create(TSize(prov.w, prov.h), EColor16MAP), KErrNone); - CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL(prov.bmp); - CBitmapContext *bitmapContext = 0; - QCOMPARE(bitmapDevice->CreateBitmapContext(bitmapContext), KErrNone); - TRgb symbianColor = TRgb(255, 200, 100); - bitmapContext->SetBrushColor(symbianColor); - bitmapContext->Clear(); - delete bitmapContext; - delete bitmapDevice; - - pm = pixmapFromNativeImageHandleProvider(&prov); - QVERIFY(!pm.isNull()); - QCOMPARE(pm.width(), prov.w); - QCOMPARE(pm.height(), prov.h); - QVERIFY(prov.refCount == 1); - QImage img = pm.toImage(); - QVERIFY(prov.refCount == 1); - QRgb pix = img.pixel(QPoint(1, 2)); - QCOMPARE(qRed(pix), symbianColor.Red()); - QCOMPARE(qGreen(pix), symbianColor.Green()); - QCOMPARE(qBlue(pix), symbianColor.Blue()); - - pm = QPixmap(); // should result in calling release - QCOMPARE(prov.refCount, 0); - delete prov.bmp; - } else { - QSKIP("Not openvg", SkipSingle); - } -#else - QSKIP("Not applicable", SkipSingle); -#endif -} - -void tst_NativeImageHandleProvider::hibernate() -{ -#if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG) - QPixmap tmp(10, 20); - if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) { - BitmapProvider prov; - prov.bmp = new CFbsBitmap; - QCOMPARE(prov.bmp->Create(TSize(prov.w, prov.h), EColor16MAP), KErrNone); - - QPixmap pm = pixmapFromNativeImageHandleProvider(&prov); - QCOMPARE(prov.refCount, 1); - - QVGPixmapData *vgpd = static_cast<QVGPixmapData *>(pm.pixmapData()); - vgpd->hibernate(); - QCOMPARE(prov.refCount, 0); - - // Calling toVGImage() may cause some warnings as we don't have a gui initialized, - // but the only thing we care about here is get() being called. - vgpd->toVGImage(); - QCOMPARE(prov.refCount, 1); - - pm = QPixmap(); - QCOMPARE(prov.refCount, 0); - delete prov.bmp; - } else { - QSKIP("Not openvg", SkipSingle); - } -#else - QSKIP("Not applicable", SkipSingle); -#endif -} - -int main(int argc, char *argv[]) -{ - QApplication::setGraphicsSystem("openvg"); - QApplication app(argc, argv); - tst_NativeImageHandleProvider tc; - return QTest::qExec(&tc, argc, argv); -} - -#include "tst_nativeimagehandleprovider.moc" diff --git a/tests/auto/other.pro b/tests/auto/other.pro index c4ddc83cdf..b942920563 100644 --- a/tests/auto/other.pro +++ b/tests/auto/other.pro @@ -32,8 +32,7 @@ SUBDIRS=\ qvariant \ qwidget \ qworkspace \ - windowsmobile \ - nativeimagehandleprovider + windowsmobile contains(QT_CONFIG, accessibility):SUBDIRS += qaccessibility diff --git a/tests/auto/qabstractbutton/qabstractbutton.pro b/tests/auto/qabstractbutton/qabstractbutton.pro index 2e52585700..15d90ed4e1 100644 --- a/tests/auto/qabstractbutton/qabstractbutton.pro +++ b/tests/auto/qabstractbutton/qabstractbutton.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qabstractbutton.cpp diff --git a/tests/auto/qabstractitemmodel/qabstractitemmodel.pro b/tests/auto/qabstractitemmodel/qabstractitemmodel.pro index 52c4e96f99..543065a4c0 100644 --- a/tests/auto/qabstractitemmodel/qabstractitemmodel.pro +++ b/tests/auto/qabstractitemmodel/qabstractitemmodel.pro @@ -1,7 +1,7 @@ load(qttest_p4) INCLUDEPATH += $$PWD/../modeltest - +QT += widgets SOURCES += tst_qabstractitemmodel.cpp ../modeltest/dynamictreemodel.cpp ../modeltest/modeltest.cpp HEADERS += ../modeltest/dynamictreemodel.h ../modeltest/modeltest.h diff --git a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp index cf4cfd76ec..6a7a16eae8 100644 --- a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp +++ b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp @@ -43,7 +43,7 @@ #include <QtTest/QtTest> #include <QtCore/QtCore> -#include <QtGui/QSortFilterProxyModel> +#include <QtWidgets/QSortFilterProxyModel> //TESTED_CLASS=QAbstractListModel QAbstractTableModel //TESTED_FILES= diff --git a/tests/auto/qabstractitemview/qabstractitemview.pro b/tests/auto/qabstractitemview/qabstractitemview.pro index 0d0d51c38a..e6c2d84b5f 100644 --- a/tests/auto/qabstractitemview/qabstractitemview.pro +++ b/tests/auto/qabstractitemview/qabstractitemview.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qabstractitemview.cpp diff --git a/tests/auto/qabstractprintdialog/qabstractprintdialog.pro b/tests/auto/qabstractprintdialog/qabstractprintdialog.pro index 8d9b142290..faf0961b97 100644 --- a/tests/auto/qabstractprintdialog/qabstractprintdialog.pro +++ b/tests/auto/qabstractprintdialog/qabstractprintdialog.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets printsupport SOURCES += tst_qabstractprintdialog.cpp diff --git a/tests/auto/qabstractproxymodel/qabstractproxymodel.pro b/tests/auto/qabstractproxymodel/qabstractproxymodel.pro index d1bff92543..7a6a841796 100644 --- a/tests/auto/qabstractproxymodel/qabstractproxymodel.pro +++ b/tests/auto/qabstractproxymodel/qabstractproxymodel.pro @@ -1,2 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qabstractproxymodel.cpp diff --git a/tests/auto/qabstractscrollarea/qabstractscrollarea.pro b/tests/auto/qabstractscrollarea/qabstractscrollarea.pro index 9e7b6e0f95..e4bc3f6495 100644 --- a/tests/auto/qabstractscrollarea/qabstractscrollarea.pro +++ b/tests/auto/qabstractscrollarea/qabstractscrollarea.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qabstractscrollarea.cpp diff --git a/tests/auto/qabstractslider/qabstractslider.pro b/tests/auto/qabstractslider/qabstractslider.pro index 13a2e873a9..4507859ace 100644 --- a/tests/auto/qabstractslider/qabstractslider.pro +++ b/tests/auto/qabstractslider/qabstractslider.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qabstractslider.cpp diff --git a/tests/auto/qabstractspinbox/qabstractspinbox.pro b/tests/auto/qabstractspinbox/qabstractspinbox.pro index 293eff3c0f..e156b2493d 100644 --- a/tests/auto/qabstractspinbox/qabstractspinbox.pro +++ b/tests/auto/qabstractspinbox/qabstractspinbox.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qabstractspinbox.cpp diff --git a/tests/auto/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro b/tests/auto/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro index 701b24b5b3..22b013e37e 100644 --- a/tests/auto/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro +++ b/tests/auto/qabstracttextdocumentlayout/qabstracttextdocumentlayout.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qabstracttextdocumentlayout.cpp diff --git a/tests/auto/qaccessibility/qaccessibility.pro b/tests/auto/qaccessibility/qaccessibility.pro index 75fd1e9793..ae046cc3c3 100644 --- a/tests/auto/qaccessibility/qaccessibility.pro +++ b/tests/auto/qaccessibility/qaccessibility.pro @@ -1,5 +1,6 @@ load(qttest_p4) requires(contains(QT_CONFIG,accessibility)) +QT += widgets SOURCES += tst_qaccessibility.cpp unix:!mac:LIBS+=-lm diff --git a/tests/auto/qaccessibility_mac/qaccessibility_mac.pro b/tests/auto/qaccessibility_mac/qaccessibility_mac.pro index 47f72d1cdb..21b6225865 100644 --- a/tests/auto/qaccessibility_mac/qaccessibility_mac.pro +++ b/tests/auto/qaccessibility_mac/qaccessibility_mac.pro @@ -18,6 +18,6 @@ exists($$(QTDIR)/tools/designer/src/lib/uilib/uilib.pri) { } else { CONFIG += uitools } -QT += xml +QT += xml widgets LIBS += -framework ApplicationServices -framework Carbon diff --git a/tests/auto/qaction/qaction.pro b/tests/auto/qaction/qaction.pro index a129cd66ac..9c3648d52f 100644 --- a/tests/auto/qaction/qaction.pro +++ b/tests/auto/qaction/qaction.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qaction.cpp diff --git a/tests/auto/qactiongroup/qactiongroup.pro b/tests/auto/qactiongroup/qactiongroup.pro index d468815674..9b8636968b 100644 --- a/tests/auto/qactiongroup/qactiongroup.pro +++ b/tests/auto/qactiongroup/qactiongroup.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qactiongroup.cpp diff --git a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro index 3193764709..3e00e08295 100644 --- a/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro +++ b/tests/auto/qapplication/desktopsettingsaware/desktopsettingsaware.pro @@ -11,6 +11,7 @@ wince*:TARGET = ../desktopsettingsaware symbian:TARGET = desktopsettingsaware # Input +QT += widgets SOURCES += main.cpp CONFIG += qt warn_on create_prl link_prl CONFIG -= app_bundle diff --git a/tests/auto/qapplication/modal/modal.pro b/tests/auto/qapplication/modal/modal.pro index 836f6ffab0..9ed69769bb 100644 --- a/tests/auto/qapplication/modal/modal.pro +++ b/tests/auto/qapplication/modal/modal.pro @@ -1,4 +1,5 @@ TEMPLATE = app +QT += widgets TARGET = DEPENDPATH += . INCLUDEPATH += . diff --git a/tests/auto/qapplication/test/test.pro b/tests/auto/qapplication/test/test.pro index de11e88683..bb9e0ec406 100644 --- a/tests/auto/qapplication/test/test.pro +++ b/tests/auto/qapplication/test/test.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += ../tst_qapplication.cpp diff --git a/tests/auto/qapplication/wincmdline/wincmdline.pro b/tests/auto/qapplication/wincmdline/wincmdline.pro index 8a8ca3d6b3..3ba8f48167 100644 --- a/tests/auto/qapplication/wincmdline/wincmdline.pro +++ b/tests/auto/qapplication/wincmdline/wincmdline.pro @@ -2,6 +2,7 @@ TEMPLATE = app TARGET = DEPENDPATH += . INCLUDEPATH += . +QT += widgets SOURCES += main.cpp diff --git a/tests/auto/qboxlayout/qboxlayout.pro b/tests/auto/qboxlayout/qboxlayout.pro index 3195f4dc9b..c37f12f74f 100644 --- a/tests/auto/qboxlayout/qboxlayout.pro +++ b/tests/auto/qboxlayout/qboxlayout.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qboxlayout.cpp diff --git a/tests/auto/qbrush/qbrush.pro b/tests/auto/qbrush/qbrush.pro index c17784cbec..1c3efd46be 100644 --- a/tests/auto/qbrush/qbrush.pro +++ b/tests/auto/qbrush/qbrush.pro @@ -1,5 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qbrush.cpp - - - diff --git a/tests/auto/qbuttongroup/qbuttongroup.pro b/tests/auto/qbuttongroup/qbuttongroup.pro index 4f8b2113b1..6f506e8f06 100644 --- a/tests/auto/qbuttongroup/qbuttongroup.pro +++ b/tests/auto/qbuttongroup/qbuttongroup.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qbuttongroup.cpp diff --git a/tests/auto/qcalendarwidget/qcalendarwidget.pro b/tests/auto/qcalendarwidget/qcalendarwidget.pro index 62b137b347..d250b83537 100644 --- a/tests/auto/qcalendarwidget/qcalendarwidget.pro +++ b/tests/auto/qcalendarwidget/qcalendarwidget.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qcalendarwidget.cpp diff --git a/tests/auto/qcheckbox/qcheckbox.pro b/tests/auto/qcheckbox/qcheckbox.pro index c2fee48133..aa1f35b3c9 100644 --- a/tests/auto/qcheckbox/qcheckbox.pro +++ b/tests/auto/qcheckbox/qcheckbox.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qcheckbox.cpp diff --git a/tests/auto/qclipboard/copier/copier.pro b/tests/auto/qclipboard/copier/copier.pro index 1c188ca7de..d345d33eb5 100644 --- a/tests/auto/qclipboard/copier/copier.pro +++ b/tests/auto/qclipboard/copier/copier.pro @@ -3,6 +3,7 @@ TARGET = DEPENDPATH += . INCLUDEPATH += . CONFIG -= app_bundle +QT += widgets win32: DESTDIR = ../copier # Input SOURCES += main.cpp diff --git a/tests/auto/qclipboard/paster/paster.pro b/tests/auto/qclipboard/paster/paster.pro index 8580644b1e..d214c9e90a 100644 --- a/tests/auto/qclipboard/paster/paster.pro +++ b/tests/auto/qclipboard/paster/paster.pro @@ -4,7 +4,7 @@ DEPENDPATH += . INCLUDEPATH += . win32: DESTDIR = ../paster CONFIG -= app_bundle - +QT += widgets # Input SOURCES += main.cpp diff --git a/tests/auto/qclipboard/tst_qclipboard.cpp b/tests/auto/qclipboard/tst_qclipboard.cpp index 94981cf8e5..4d3bb29e13 100644 --- a/tests/auto/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/qclipboard/tst_qclipboard.cpp @@ -42,7 +42,7 @@ #include <QtTest/QtTest> #include <QtCore/QDebug> -#include <QtGui/QApplication> +#include <QtWidgets/QApplication> #include <QtGui/QClipboard> #ifdef Q_WS_MAC #include <Carbon/Carbon.h> diff --git a/tests/auto/qcolordialog/qcolordialog.pro b/tests/auto/qcolordialog/qcolordialog.pro index 830f9fafe2..4f195dac2b 100644 --- a/tests/auto/qcolordialog/qcolordialog.pro +++ b/tests/auto/qcolordialog/qcolordialog.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qcolordialog.cpp diff --git a/tests/auto/qcolumnview/qcolumnview.pro b/tests/auto/qcolumnview/qcolumnview.pro index e36df030c2..bca9e75ba5 100644 --- a/tests/auto/qcolumnview/qcolumnview.pro +++ b/tests/auto/qcolumnview/qcolumnview.pro @@ -1,4 +1,5 @@ CONFIG += qttest_p4 +QT += widgets widgets-private QT += gui-private core-private SOURCES += tst_qcolumnview.cpp diff --git a/tests/auto/qcolumnview/tst_qcolumnview.cpp b/tests/auto/qcolumnview/tst_qcolumnview.cpp index 7f6d43a45b..493e920262 100644 --- a/tests/auto/qcolumnview/tst_qcolumnview.cpp +++ b/tests/auto/qcolumnview/tst_qcolumnview.cpp @@ -44,9 +44,9 @@ #include <qstandarditemmodel.h> #include <qitemdelegate.h> #include <qcolumnview.h> -#include "../../../src/gui/itemviews/qcolumnviewgrip_p.h" +#include "../../../src/widgets/itemviews/qcolumnviewgrip_p.h" #ifndef Q_OS_SYMBIAN -#include "../../../src/gui/dialogs/qfilesystemmodel_p.h" +#include "../../../src/widgets/dialogs/qfilesystemmodel_p.h" #endif #include <qdirmodel.h> #include <qstringlistmodel.h> diff --git a/tests/auto/qcombobox/qcombobox.pro b/tests/auto/qcombobox/qcombobox.pro index a8f0e6ad23..c3da909437 100644 --- a/tests/auto/qcombobox/qcombobox.pro +++ b/tests/auto/qcombobox/qcombobox.pro @@ -1,4 +1,4 @@ load(qttest_p4) -QT += gui-private core-private +QT += widgets widgets-private gui-private core-private SOURCES += tst_qcombobox.cpp diff --git a/tests/auto/qcommandlinkbutton/qcommandlinkbutton.pro b/tests/auto/qcommandlinkbutton/qcommandlinkbutton.pro index db3a336c36..497b8298a2 100644 --- a/tests/auto/qcommandlinkbutton/qcommandlinkbutton.pro +++ b/tests/auto/qcommandlinkbutton/qcommandlinkbutton.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qcommandlinkbutton.cpp diff --git a/tests/auto/qcompleter/qcompleter.pro b/tests/auto/qcompleter/qcompleter.pro index bd352d819c..cde64ec672 100644 --- a/tests/auto/qcompleter/qcompleter.pro +++ b/tests/auto/qcompleter/qcompleter.pro @@ -1,6 +1,7 @@ load(qttest_p4) TEMPLATE = app TARGET = tst_qcompleter +QT += widgets DEPENDPATH += . INCLUDEPATH += . .. diff --git a/tests/auto/qcomplextext/qcomplextext.pro b/tests/auto/qcomplextext/qcomplextext.pro index bd85daa6b4..725594cdd6 100644 --- a/tests/auto/qcomplextext/qcomplextext.pro +++ b/tests/auto/qcomplextext/qcomplextext.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qcomplextext.cpp INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/harfbuzz/src diff --git a/tests/auto/qdatawidgetmapper/qdatawidgetmapper.pro b/tests/auto/qdatawidgetmapper/qdatawidgetmapper.pro index d8e0cd043c..64e3b57291 100644 --- a/tests/auto/qdatawidgetmapper/qdatawidgetmapper.pro +++ b/tests/auto/qdatawidgetmapper/qdatawidgetmapper.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qdatawidgetmapper.cpp diff --git a/tests/auto/qdatetimeedit/qdatetimeedit.pro b/tests/auto/qdatetimeedit/qdatetimeedit.pro index 19e92d0155..47356d448c 100644 --- a/tests/auto/qdatetimeedit/qdatetimeedit.pro +++ b/tests/auto/qdatetimeedit/qdatetimeedit.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qdatetimeedit.cpp wincewm50smart-msvc2005: DEFINES += WINCE_NO_MODIFIER_KEYS diff --git a/tests/auto/qdesktopservices/qdesktopservices.pro b/tests/auto/qdesktopservices/qdesktopservices.pro index 43f6cba267..0e51ed0459 100644 --- a/tests/auto/qdesktopservices/qdesktopservices.pro +++ b/tests/auto/qdesktopservices/qdesktopservices.pro @@ -1,4 +1,5 @@ CONFIG += qttest_p4 +QT += widgets SOURCES += tst_qdesktopservices.cpp TARGET = tst_qdesktopservices diff --git a/tests/auto/qdesktopwidget/qdesktopwidget.pro b/tests/auto/qdesktopwidget/qdesktopwidget.pro index bc287c09b0..730b273c4f 100644 --- a/tests/auto/qdesktopwidget/qdesktopwidget.pro +++ b/tests/auto/qdesktopwidget/qdesktopwidget.pro @@ -1,5 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qdesktopwidget.cpp - - - diff --git a/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp b/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp index e11fbf09c3..fc696443a1 100644 --- a/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp +++ b/tests/auto/qdesktopwidget/tst_qdesktopwidget.cpp @@ -41,7 +41,7 @@ #include <QtTest/QtTest> -#include <QtGui/QDesktopWidget> +#include <QtWidgets/QDesktopWidget> #include <QDebug> //TESTED_CLASS= diff --git a/tests/auto/qdial/qdial.pro b/tests/auto/qdial/qdial.pro index 7cd245e6a9..acf66de430 100644 --- a/tests/auto/qdial/qdial.pro +++ b/tests/auto/qdial/qdial.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qdial.cpp diff --git a/tests/auto/qdialog/qdialog.pro b/tests/auto/qdialog/qdialog.pro index 161a6b47f1..7c4defacd9 100644 --- a/tests/auto/qdialog/qdialog.pro +++ b/tests/auto/qdialog/qdialog.pro @@ -1,2 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qdialog.cpp diff --git a/tests/auto/qdialogbuttonbox/qdialogbuttonbox.pro b/tests/auto/qdialogbuttonbox/qdialogbuttonbox.pro index 70b65f644e..efbeca0c1b 100644 --- a/tests/auto/qdialogbuttonbox/qdialogbuttonbox.pro +++ b/tests/auto/qdialogbuttonbox/qdialogbuttonbox.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qdialogbuttonbox.cpp TARGET = tst_qdialogbuttonbox diff --git a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp index 13ecd90bd3..def5e60549 100644 --- a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp +++ b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ #include <QtTest/QtTest> -#include <QtGui/QPushButton> -#include <QtGui/QStyle> -#include <QtGui/QLayout> -#include <QtGui/QDialog> -#include <QtGui/QAction> +#include <QtWidgets/QPushButton> +#include <QtWidgets/QStyle> +#include <QtWidgets/QLayout> +#include <QtWidgets/QDialog> +#include <QtWidgets/QAction> #include <qdialogbuttonbox.h> #include <limits.h> diff --git a/tests/auto/qdirectpainter/test/test.pro b/tests/auto/qdirectpainter/test/test.pro index 6d820b1585..3621e11fa9 100644 --- a/tests/auto/qdirectpainter/test/test.pro +++ b/tests/auto/qdirectpainter/test/test.pro @@ -1,5 +1,5 @@ load(qttest_p4) - +QT += widgets SOURCES += ../tst_qdirectpainter.cpp TARGET = ../tst_qdirectpainter diff --git a/tests/auto/qdirmodel/qdirmodel.pro b/tests/auto/qdirmodel/qdirmodel.pro index 7037a79934..7c0409334c 100644 --- a/tests/auto/qdirmodel/qdirmodel.pro +++ b/tests/auto/qdirmodel/qdirmodel.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qdirmodel.cpp wince*|symbian { diff --git a/tests/auto/qdockwidget/qdockwidget.pro b/tests/auto/qdockwidget/qdockwidget.pro index 5f92e5db19..6409ac6efb 100644 --- a/tests/auto/qdockwidget/qdockwidget.pro +++ b/tests/auto/qdockwidget/qdockwidget.pro @@ -1,5 +1,5 @@ load(qttest_p4) - +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qdockwidget.cpp diff --git a/tests/auto/qdoublespinbox/qdoublespinbox.pro b/tests/auto/qdoublespinbox/qdoublespinbox.pro index 3aec0de68e..6f2b8b2d74 100644 --- a/tests/auto/qdoublespinbox/qdoublespinbox.pro +++ b/tests/auto/qdoublespinbox/qdoublespinbox.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qdoublespinbox.cpp diff --git a/tests/auto/qdoublevalidator/qdoublevalidator.pro b/tests/auto/qdoublevalidator/qdoublevalidator.pro index 1fe3f7b838..7fbb72bb7f 100644 --- a/tests/auto/qdoublevalidator/qdoublevalidator.pro +++ b/tests/auto/qdoublevalidator/qdoublevalidator.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qdoublevalidator.cpp diff --git a/tests/auto/qdrag/qdrag.pro b/tests/auto/qdrag/qdrag.pro index ad36fa5ada..d9d645559b 100644 --- a/tests/auto/qdrag/qdrag.pro +++ b/tests/auto/qdrag/qdrag.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qdrag.cpp diff --git a/tests/auto/qerrormessage/qerrormessage.pro b/tests/auto/qerrormessage/qerrormessage.pro index 1c24aa83cb..363d085cbf 100644 --- a/tests/auto/qerrormessage/qerrormessage.pro +++ b/tests/auto/qerrormessage/qerrormessage.pro @@ -4,5 +4,7 @@ TARGET = tst_qerrormessage DEPENDPATH += . INCLUDEPATH += . +QT += widgets + # Input SOURCES += tst_qerrormessage.cpp diff --git a/tests/auto/qfiledialog/qfiledialog.pro b/tests/auto/qfiledialog/qfiledialog.pro index ec93f12a95..2bf215bbba 100644 --- a/tests/auto/qfiledialog/qfiledialog.pro +++ b/tests/auto/qfiledialog/qfiledialog.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qfiledialog.cpp diff --git a/tests/auto/qfiledialog/tst_qfiledialog.cpp b/tests/auto/qfiledialog/tst_qfiledialog.cpp index 81da8a3f62..d9fd736e09 100644 --- a/tests/auto/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/qfiledialog/tst_qfiledialog.cpp @@ -62,9 +62,9 @@ #include <qlayout.h> #include "../../shared/util.h" #if defined QT_BUILD_INTERNAL -#include "../../../src/gui/dialogs/qsidebar_p.h" -#include "../../../src/gui/dialogs/qfilesystemmodel_p.h" -#include "../../../src/gui/dialogs/qfiledialog_p.h" +#include "../../../src/widgets/dialogs/qsidebar_p.h" +#include "../../../src/widgets/dialogs/qfilesystemmodel_p.h" +#include "../../../src/widgets/dialogs/qfiledialog_p.h" #endif #include <QFileDialog> #include <QFileSystemModel> diff --git a/tests/auto/qfiledialog2/qfiledialog2.pro b/tests/auto/qfiledialog2/qfiledialog2.pro index 5d1d72195d..14de040ec5 100644 --- a/tests/auto/qfiledialog2/qfiledialog2.pro +++ b/tests/auto/qfiledialog2/qfiledialog2.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qfiledialog2.cpp diff --git a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp index afa2e8f64a..085bdbc80e 100644 --- a/tests/auto/qfiledialog2/tst_qfiledialog2.cpp +++ b/tests/auto/qfiledialog2/tst_qfiledialog2.cpp @@ -61,9 +61,9 @@ #include <qlineedit.h> #include <qlayout.h> #include "../../shared/util.h" -#include "../../../src/gui/dialogs/qsidebar_p.h" -#include "../../../src/gui/dialogs/qfilesystemmodel_p.h" -#include "../../../src/gui/dialogs/qfiledialog_p.h" +#include "../../../src/widgets/dialogs/qsidebar_p.h" +#include "../../../src/widgets/dialogs/qfilesystemmodel_p.h" +#include "../../../src/widgets/dialogs/qfiledialog_p.h" #include "../network-settings.h" diff --git a/tests/auto/qfileiconprovider/qfileiconprovider.pro b/tests/auto/qfileiconprovider/qfileiconprovider.pro index 3bf83ae5da..1e3d26de00 100644 --- a/tests/auto/qfileiconprovider/qfileiconprovider.pro +++ b/tests/auto/qfileiconprovider/qfileiconprovider.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qfileiconprovider.cpp diff --git a/tests/auto/qfileopenevent/qfileopenevent.pro b/tests/auto/qfileopenevent/qfileopenevent.pro index 45978d7b7e..73724828db 100644 --- a/tests/auto/qfileopenevent/qfileopenevent.pro +++ b/tests/auto/qfileopenevent/qfileopenevent.pro @@ -1,2 +1,3 @@ TEMPLATE = subdirs +QT += widgets SUBDIRS = test qfileopeneventexternal diff --git a/tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.pro b/tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.pro index b95ed45edd..cb61b82e38 100644 --- a/tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.pro +++ b/tests/auto/qfileopenevent/qfileopeneventexternal/qfileopeneventexternal.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = qfileopeneventexternal -QT += core gui +QT += core gui widgets SOURCES += qfileopeneventexternal.cpp symbian: { RSS_RULES += "embeddability=KAppEmbeddable;" diff --git a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro index ab121306e3..b0b6d7a18d 100644 --- a/tests/auto/qfilesystemmodel/qfilesystemmodel.pro +++ b/tests/auto/qfilesystemmodel/qfilesystemmodel.pro @@ -1,6 +1,7 @@ CONFIG += qttest_p4 -QT = core-private gui +QT += widgets widgets-private +QT += core-private gui SOURCES += tst_qfilesystemmodel.cpp TARGET = tst_qfilesystemmodel diff --git a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp index 5afcf40800..a9a4fc7fc3 100644 --- a/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -42,7 +42,7 @@ #include <QtTest/QtTest> #ifdef QT_BUILD_INTERNAL -#include "../../../src/gui/dialogs/qfilesystemmodel_p.h" +#include "../../../src/widgets/dialogs/qfilesystemmodel_p.h" #endif #include <QFileSystemModel> #include <QFileIconProvider> diff --git a/tests/auto/qfocusevent/qfocusevent.pro b/tests/auto/qfocusevent/qfocusevent.pro index 851d616173..e709a547ec 100644 --- a/tests/auto/qfocusevent/qfocusevent.pro +++ b/tests/auto/qfocusevent/qfocusevent.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qfocusevent.cpp CONFIG+=insignificant_test diff --git a/tests/auto/qfocusframe/qfocusframe.pro b/tests/auto/qfocusframe/qfocusframe.pro index afb7206b00..0fcc9bf23d 100644 --- a/tests/auto/qfocusframe/qfocusframe.pro +++ b/tests/auto/qfocusframe/qfocusframe.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qfocusframe.cpp diff --git a/tests/auto/qfont/qfont.pro b/tests/auto/qfont/qfont.pro index b071d88dce..891cb0a093 100644 --- a/tests/auto/qfont/qfont.pro +++ b/tests/auto/qfont/qfont.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qfont.cpp diff --git a/tests/auto/qfontcombobox/qfontcombobox.pro b/tests/auto/qfontcombobox/qfontcombobox.pro index b7d32f5484..9e984e0d99 100644 --- a/tests/auto/qfontcombobox/qfontcombobox.pro +++ b/tests/auto/qfontcombobox/qfontcombobox.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qfontcombobox.cpp diff --git a/tests/auto/qfontdialog/qfontdialog.pro b/tests/auto/qfontdialog/qfontdialog.pro index 656c4d12f8..e4ad2f1a41 100644 --- a/tests/auto/qfontdialog/qfontdialog.pro +++ b/tests/auto/qfontdialog/qfontdialog.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qfontdialog.cpp diff --git a/tests/auto/qformlayout/qformlayout.pro b/tests/auto/qformlayout/qformlayout.pro index baeb6741ca..24c452af9f 100644 --- a/tests/auto/qformlayout/qformlayout.pro +++ b/tests/auto/qformlayout/qformlayout.pro @@ -1,2 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qformlayout.cpp diff --git a/tests/auto/qformlayout/tst_qformlayout.cpp b/tests/auto/qformlayout/tst_qformlayout.cpp index 8da79ef60a..f35933d0dc 100644 --- a/tests/auto/qformlayout/tst_qformlayout.cpp +++ b/tests/auto/qformlayout/tst_qformlayout.cpp @@ -46,9 +46,8 @@ #include <qwidget.h> #include <qwindowsstyle.h> #include <qsizepolicy.h> -#include <QtGui> -#include <QtGui/QWindowsStyle> +#include <QtWidgets/QWindowsStyle> #include <QStyleFactory> #include <qformlayout.h> diff --git a/tests/auto/qgl/qgl.pro b/tests/auto/qgl/qgl.pro index cec7f23f07..c5e26451ed 100644 --- a/tests/auto/qgl/qgl.pro +++ b/tests/auto/qgl/qgl.pro @@ -4,7 +4,7 @@ load(qttest_p4) requires(contains(QT_CONFIG,opengl)) -QT += opengl-private gui-private core-private +QT += widgets widgets-private opengl-private gui-private core-private contains(QT_CONFIG,egl):DEFINES += QGL_EGL win32:!wince*: DEFINES += QT_NO_EGL diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 7d46ada820..e3a8500bda 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -55,8 +55,8 @@ #include <QVBoxLayout> #ifdef QT_BUILD_INTERNAL +#include <qplatformpixmap_qpa.h> #include <QtOpenGL/private/qgl_p.h> -#include <QtGui/private/qpixmapdata_p.h> #include <QtGui/private/qimage_p.h> #include <QtGui/private/qimagepixmapcleanuphooks_p.h> #endif @@ -1868,12 +1868,14 @@ public: int tst_QGLResource::deletions = 0; -Q_GLOBAL_STATIC(QGLContextGroupResource<tst_QGLResource>, qt_shared_test) - +#ifdef TODO +Q_GLOBAL_STATIC(QOpenGLContextGroupResource<tst_QGLResource>, qt_shared_test) +#endif //TODO #endif void tst_QGL::shareRegister() { +#ifdef TODO #ifdef QT_BUILD_INTERNAL // Create a context. QGLWidget *glw1 = new QGLWidget(); @@ -1883,15 +1885,15 @@ void tst_QGL::shareRegister() QVERIFY(!glw1->isSharing()); // Create a guard for the first context. - QGLSharedResourceGuard guard(glw1->context()); + QOpenGLSharedResourceGuard guard(glw1->context()->contextHandle()); QVERIFY(guard.id() == 0); guard.setId(3); QVERIFY(guard.id() == 3); // Request a tst_QGLResource object for the first context. - tst_QGLResource *res1 = qt_shared_test()->value(glw1->context()); + tst_QGLResource *res1 = qt_shared_test()->value(glw1->context()->contextHandle()); QVERIFY(res1); - QVERIFY(qt_shared_test()->value(glw1->context()) == res1); + QVERIFY(qt_shared_test()->value(glw1->context()->contextHandle()) == res1); // Create another context that shares with the first. QVERIFY(!glw1->isSharing()); @@ -1985,6 +1987,7 @@ void tst_QGL::shareRegister() QVERIFY(guard3.context() == 0); QVERIFY(guard3.id() == 0); #endif +#endif //TODO } // Tests QGLContext::bindTexture with default options diff --git a/tests/auto/qglbuffer/qglbuffer.pro b/tests/auto/qglbuffer/qglbuffer.pro index 5627d2d6cb..48bd966797 100644 --- a/tests/auto/qglbuffer/qglbuffer.pro +++ b/tests/auto/qglbuffer/qglbuffer.pro @@ -4,7 +4,7 @@ load(qttest_p4) requires(contains(QT_CONFIG,opengl)) -QT += opengl +QT += opengl widgets win32:!wince*: DEFINES += QT_NO_EGL diff --git a/tests/auto/qglfunctions/qglfunctions.pro b/tests/auto/qglfunctions/qglfunctions.pro index aa81547de5..9fe8de2b23 100644 --- a/tests/auto/qglfunctions/qglfunctions.pro +++ b/tests/auto/qglfunctions/qglfunctions.pro @@ -1,6 +1,6 @@ load(qttest_p4) requires(contains(QT_CONFIG,opengl)) -QT += opengl +QT += opengl widgets win32:!wince*: DEFINES += QT_NO_EGL diff --git a/tests/auto/qglthreads/qglthreads.pro b/tests/auto/qglthreads/qglthreads.pro index bd27ce8e68..d2fd31411f 100644 --- a/tests/auto/qglthreads/qglthreads.pro +++ b/tests/auto/qglthreads/qglthreads.pro @@ -1,6 +1,6 @@ load(qttest_p4) requires(contains(QT_CONFIG,opengl)) -QT += opengl +QT += opengl widgets win32:!wince*: DEFINES += QT_NO_EGL diff --git a/tests/auto/qglthreads/tst_qglthreads.cpp b/tests/auto/qglthreads/tst_qglthreads.cpp index 472379ab7a..ee05e406c8 100644 --- a/tests/auto/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/qglthreads/tst_qglthreads.cpp @@ -42,6 +42,7 @@ #include <QtTest/QtTest> #include <QtCore/QtCore> #include <QtGui/QtGui> +#include <QtWidgets/QApplication> #include <QtOpenGL/QtOpenGL> #include "tst_qglthreads.h" diff --git a/tests/auto/qgraphicsanchorlayout/qgraphicsanchorlayout.pro b/tests/auto/qgraphicsanchorlayout/qgraphicsanchorlayout.pro index e1829b0b6b..5aa2936e3e 100644 --- a/tests/auto/qgraphicsanchorlayout/qgraphicsanchorlayout.pro +++ b/tests/auto/qgraphicsanchorlayout/qgraphicsanchorlayout.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgraphicsanchorlayout.cpp CONFIG += parallel_test diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp index 5987f4a8a3..f496146165 100644 --- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp +++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp @@ -40,12 +40,12 @@ ****************************************************************************/ #include <QtTest/QtTest> -#include <QtGui/qgraphicsanchorlayout.h> +#include <QtWidgets/qgraphicsanchorlayout.h> #include <private/qgraphicsanchorlayout_p.h> -#include <QtGui/qgraphicswidget.h> -#include <QtGui/qgraphicsproxywidget.h> -#include <QtGui/qgraphicsview.h> -#include <QtGui/qwindowsstyle.h> +#include <QtWidgets/qgraphicswidget.h> +#include <QtWidgets/qgraphicsproxywidget.h> +#include <QtWidgets/qgraphicsview.h> +#include <QtWidgets/qwindowsstyle.h> class tst_QGraphicsAnchorLayout : public QObject { Q_OBJECT diff --git a/tests/auto/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro b/tests/auto/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro index 535de0c07e..bcad43fc12 100644 --- a/tests/auto/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro +++ b/tests/auto/qgraphicsanchorlayout1/qgraphicsanchorlayout1.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgraphicsanchorlayout1.cpp CONFIG += parallel_test diff --git a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp index 4329f1350b..05f08e8719 100644 --- a/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp +++ b/tests/auto/qgraphicsanchorlayout1/tst_qgraphicsanchorlayout1.cpp @@ -43,7 +43,7 @@ #include <QtTest/QtTest> #include <QTest> #include <QMetaType> -#include <QtGui/qgraphicsanchorlayout.h> +#include <QtWidgets/qgraphicsanchorlayout.h> #include <private/qgraphicsanchorlayout_p.h> #define TEST_COMPLEX_CASES diff --git a/tests/auto/qgraphicseffect/qgraphicseffect.pro b/tests/auto/qgraphicseffect/qgraphicseffect.pro index db69e19cac..d0d1f11d0c 100644 --- a/tests/auto/qgraphicseffect/qgraphicseffect.pro +++ b/tests/auto/qgraphicseffect/qgraphicseffect.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgraphicseffect.cpp diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp index 1f5563c6b7..b4b09fc6db 100644 --- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp +++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp @@ -41,13 +41,13 @@ #include <QtTest/QtTest> -#include <QtGui/qdesktopwidget.h> -#include <QtGui/qgraphicseffect.h> -#include <QtGui/qgraphicsview.h> -#include <QtGui/qgraphicsscene.h> -#include <QtGui/qgraphicsitem.h> -#include <QtGui/qgraphicswidget.h> -#include <QtGui/qstyleoption.h> +#include <QtWidgets/qdesktopwidget.h> +#include <QtWidgets/qgraphicseffect.h> +#include <QtWidgets/qgraphicsview.h> +#include <QtWidgets/qgraphicsscene.h> +#include <QtWidgets/qgraphicsitem.h> +#include <QtWidgets/qgraphicswidget.h> +#include <QtWidgets/qstyleoption.h> #include "../../shared/util.h" #include <private/qgraphicseffect_p.h> @@ -533,8 +533,8 @@ public: void draw(QPainter *painter) { - QVERIFY(sourcePixmap(Qt::LogicalCoordinates).pixmapData() == pixmap.pixmapData()); - QVERIFY((painter->worldTransform().type() <= QTransform::TxTranslate) == (sourcePixmap(Qt::DeviceCoordinates).pixmapData() == pixmap.pixmapData())); + QVERIFY(sourcePixmap(Qt::LogicalCoordinates).handle() == pixmap.handle()); + QVERIFY((painter->worldTransform().type() <= QTransform::TxTranslate) == (sourcePixmap(Qt::DeviceCoordinates).handle() == pixmap.handle())); ++repaints; } diff --git a/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro b/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro index da437e959c..44ec70eef3 100644 --- a/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro +++ b/tests/auto/qgraphicseffectsource/qgraphicseffectsource.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgraphicseffectsource.cpp diff --git a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp index 5d684c5beb..a5dcf738e7 100644 --- a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp +++ b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp @@ -40,11 +40,11 @@ ****************************************************************************/ #include <QtTest/QtTest> -#include <QtGui/qgraphicseffect.h> -#include <QtGui/qgraphicsview.h> -#include <QtGui/qgraphicsscene.h> -#include <QtGui/qgraphicsitem.h> -#include <QtGui/qstyleoption.h> +#include <QtWidgets/qgraphicseffect.h> +#include <QtWidgets/qgraphicsview.h> +#include <QtWidgets/qgraphicsscene.h> +#include <QtWidgets/qgraphicsitem.h> +#include <QtWidgets/qstyleoption.h> #include <private/qgraphicseffect_p.h> diff --git a/tests/auto/qgraphicsgridlayout/qgraphicsgridlayout.pro b/tests/auto/qgraphicsgridlayout/qgraphicsgridlayout.pro index bde005fcf6..7db7c1ae6f 100644 --- a/tests/auto/qgraphicsgridlayout/qgraphicsgridlayout.pro +++ b/tests/auto/qgraphicsgridlayout/qgraphicsgridlayout.pro @@ -1,4 +1,6 @@ load(qttest_p4) + +QT += widgets SOURCES += tst_qgraphicsgridlayout.cpp CONFIG += parallel_test contains(QT_CONFIG,xcb):qpa:CONFIG+=insignificant_test # QTBUG-20756 crashes on qpa, xcb diff --git a/tests/auto/qgraphicsitem/qgraphicsitem.pro b/tests/auto/qgraphicsitem/qgraphicsitem.pro index 77fd00fe5d..51a4426680 100644 --- a/tests/auto/qgraphicsitem/qgraphicsitem.pro +++ b/tests/auto/qgraphicsitem/qgraphicsitem.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgraphicsitem.cpp DEFINES += QT_NO_CAST_TO_ASCII diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index a8cc3b0e62..79dd2bdd7d 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -42,7 +42,6 @@ #include <QtTest/QtTest> -#include <private/qtextcontrol_p.h> #include <private/qgraphicsitem_p.h> #include <private/qgraphicsview_p.h> #include <private/qgraphicsscene_p.h> diff --git a/tests/auto/qgraphicsitemanimation/qgraphicsitemanimation.pro b/tests/auto/qgraphicsitemanimation/qgraphicsitemanimation.pro index 01875c7b50..5d723da32e 100644 --- a/tests/auto/qgraphicsitemanimation/qgraphicsitemanimation.pro +++ b/tests/auto/qgraphicsitemanimation/qgraphicsitemanimation.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qgraphicsitemanimation.cpp DEFINES += QT_NO_CAST_TO_ASCII CONFIG += parallel_test diff --git a/tests/auto/qgraphicslayout/qgraphicslayout.pro b/tests/auto/qgraphicslayout/qgraphicslayout.pro index eafd21310a..ea176c98fe 100644 --- a/tests/auto/qgraphicslayout/qgraphicslayout.pro +++ b/tests/auto/qgraphicslayout/qgraphicslayout.pro @@ -3,6 +3,7 @@ ############################################################ load(qttest_p4) +QT += widgets SOURCES += tst_qgraphicslayout.cpp DEFINES += QT_USE_USING_NAMESPACE CONFIG += parallel_test diff --git a/tests/auto/qgraphicslayoutitem/qgraphicslayoutitem.pro b/tests/auto/qgraphicslayoutitem/qgraphicslayoutitem.pro index 816224bd8b..ed9adf87fd 100644 --- a/tests/auto/qgraphicslayoutitem/qgraphicslayoutitem.pro +++ b/tests/auto/qgraphicslayoutitem/qgraphicslayoutitem.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qgraphicslayoutitem.cpp CONFIG += parallel_test diff --git a/tests/auto/qgraphicslinearlayout/qgraphicslinearlayout.pro b/tests/auto/qgraphicslinearlayout/qgraphicslinearlayout.pro index df5a827787..1f7ff0cc6e 100644 --- a/tests/auto/qgraphicslinearlayout/qgraphicslinearlayout.pro +++ b/tests/auto/qgraphicslinearlayout/qgraphicslinearlayout.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qgraphicslinearlayout.cpp CONFIG += parallel_test diff --git a/tests/auto/qgraphicsobject/qgraphicsobject.pro b/tests/auto/qgraphicsobject/qgraphicsobject.pro index 648a81f6c6..5232ec8372 100644 --- a/tests/auto/qgraphicsobject/qgraphicsobject.pro +++ b/tests/auto/qgraphicsobject/qgraphicsobject.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets QT += core-private SOURCES += tst_qgraphicsobject.cpp diff --git a/tests/auto/qgraphicspixmapitem/qgraphicspixmapitem.pro b/tests/auto/qgraphicspixmapitem/qgraphicspixmapitem.pro index 6b4db95ebe..6b1ad34057 100644 --- a/tests/auto/qgraphicspixmapitem/qgraphicspixmapitem.pro +++ b/tests/auto/qgraphicspixmapitem/qgraphicspixmapitem.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qgraphicspixmapitem.cpp CONFIG += parallel_test diff --git a/tests/auto/qgraphicspolygonitem/qgraphicspolygonitem.pro b/tests/auto/qgraphicspolygonitem/qgraphicspolygonitem.pro index 4da949b71a..2aa16751e6 100644 --- a/tests/auto/qgraphicspolygonitem/qgraphicspolygonitem.pro +++ b/tests/auto/qgraphicspolygonitem/qgraphicspolygonitem.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qgraphicspolygonitem.cpp CONFIG += parallel_test diff --git a/tests/auto/qgraphicsproxywidget/qgraphicsproxywidget.pro b/tests/auto/qgraphicsproxywidget/qgraphicsproxywidget.pro index 9f63a48998..a649ae1a3c 100644 --- a/tests/auto/qgraphicsproxywidget/qgraphicsproxywidget.pro +++ b/tests/auto/qgraphicsproxywidget/qgraphicsproxywidget.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgraphicsproxywidget.cpp diff --git a/tests/auto/qgraphicsscene/qgraphicsscene.pro b/tests/auto/qgraphicsscene/qgraphicsscene.pro index 7dfb30a2c6..9f961a11b8 100644 --- a/tests/auto/qgraphicsscene/qgraphicsscene.pro +++ b/tests/auto/qgraphicsscene/qgraphicsscene.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgraphicsscene.cpp RESOURCES += images.qrc diff --git a/tests/auto/qgraphicssceneindex/qgraphicssceneindex.pro b/tests/auto/qgraphicssceneindex/qgraphicssceneindex.pro index 0d0fd0db1a..5e61034d7c 100644 --- a/tests/auto/qgraphicssceneindex/qgraphicssceneindex.pro +++ b/tests/auto/qgraphicssceneindex/qgraphicssceneindex.pro @@ -1,5 +1,6 @@ load(qttest_p4) requires(contains(QT_CONFIG,private_tests)) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgraphicssceneindex.cpp CONFIG += parallel_test diff --git a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp index 09b16d7200..0b223c62eb 100644 --- a/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp +++ b/tests/auto/qgraphicssceneindex/tst_qgraphicssceneindex.cpp @@ -41,7 +41,7 @@ #include <QtTest/QtTest> -#include <QtGui/qgraphicsscene.h> +#include <QtWidgets/qgraphicsscene.h> #include <private/qgraphicsscenebsptreeindex_p.h> #include <private/qgraphicssceneindex_p.h> #include <private/qgraphicsscenelinearindex_p.h> diff --git a/tests/auto/qgraphicstransform/qgraphicstransform.pro b/tests/auto/qgraphicstransform/qgraphicstransform.pro index 3da3408d29..de7f01f36f 100644 --- a/tests/auto/qgraphicstransform/qgraphicstransform.pro +++ b/tests/auto/qgraphicstransform/qgraphicstransform.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qgraphicstransform.cpp CONFIG += parallel_test diff --git a/tests/auto/qgraphicsview/qgraphicsview.pro b/tests/auto/qgraphicsview/qgraphicsview.pro index 9e603af4f9..053093f9bd 100644 --- a/tests/auto/qgraphicsview/qgraphicsview.pro +++ b/tests/auto/qgraphicsview/qgraphicsview.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index cdb87b57d7..d6bc8ff3e8 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -51,25 +51,25 @@ #include <math.h> -#include <QtGui/QLabel> +#include <QtWidgets/QLabel> #if !defined(QT_NO_STYLE_MOTIF) -#include <QtGui/QMotifStyle> +#include <QtWidgets/QMotifStyle> #endif #if !defined(QT_NO_STYLE_WINDOWS) -#include <QtGui/QWindowsStyle> +#include <QtWidgets/QWindowsStyle> #endif #if !defined(QT_NO_STYLE_PLASTIQUE) -#include <QtGui/QPlastiqueStyle> +#include <QtWidgets/QPlastiqueStyle> #endif #include <QtGui/QPainterPath> -#include <QtGui/QRubberBand> -#include <QtGui/QScrollBar> -#include <QtGui/QStyleOption> -#include <QtGui/QBoxLayout> -#include <QtGui/QStyle> -#include <QtGui/QPushButton> -#include <QtGui/QInputContext> -#include <QtGui/QDesktopWidget> +#include <QtWidgets/QRubberBand> +#include <QtWidgets/QScrollBar> +#include <QtWidgets/QStyleOption> +#include <QtWidgets/QBoxLayout> +#include <QtWidgets/QStyle> +#include <QtWidgets/QPushButton> +#include <QtWidgets/QInputContext> +#include <QtWidgets/QDesktopWidget> #include <private/qgraphicsview_p.h> #include "../../shared/util.h" #include "../platformquirks.h" diff --git a/tests/auto/qgraphicswidget/qgraphicswidget.pro b/tests/auto/qgraphicswidget/qgraphicswidget.pro index 64de1fc739..330076eafc 100644 --- a/tests/auto/qgraphicswidget/qgraphicswidget.pro +++ b/tests/auto/qgraphicswidget/qgraphicswidget.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgraphicswidget.cpp diff --git a/tests/auto/qgridlayout/qgridlayout.pro b/tests/auto/qgridlayout/qgridlayout.pro index d034f1d031..6bd42fe432 100644 --- a/tests/auto/qgridlayout/qgridlayout.pro +++ b/tests/auto/qgridlayout/qgridlayout.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qgridlayout.cpp diff --git a/tests/auto/qgridlayout/tst_qgridlayout.cpp b/tests/auto/qgridlayout/tst_qgridlayout.cpp index 921168da8e..d52729a273 100644 --- a/tests/auto/qgridlayout/tst_qgridlayout.cpp +++ b/tests/auto/qgridlayout/tst_qgridlayout.cpp @@ -46,9 +46,9 @@ #include <qwidget.h> #include <qwindowsstyle.h> #include <qsizepolicy.h> -#include <QtGui> +//#include <QtGui> -#include <QtGui/QWindowsStyle> +#include <QtWidgets/QWindowsStyle> #include <QStyleFactory> #include "../../shared/util.h" diff --git a/tests/auto/qgroupbox/qgroupbox.pro b/tests/auto/qgroupbox/qgroupbox.pro index 5f5370f0cb..f4181a33ed 100644 --- a/tests/auto/qgroupbox/qgroupbox.pro +++ b/tests/auto/qgroupbox/qgroupbox.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qgroupbox.cpp diff --git a/tests/auto/qheaderview/qheaderview.pro b/tests/auto/qheaderview/qheaderview.pro index 9910e4e89d..3b3afa7e49 100644 --- a/tests/auto/qheaderview/qheaderview.pro +++ b/tests/auto/qheaderview/qheaderview.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qheaderview.cpp diff --git a/tests/auto/qicon/qicon.pro b/tests/auto/qicon/qicon.pro index 77a9b91032..cc87fae539 100644 --- a/tests/auto/qicon/qicon.pro +++ b/tests/auto/qicon/qicon.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qicon.cpp RESOURCES = tst_qicon.qrc diff --git a/tests/auto/qidentityproxymodel/qidentityproxymodel.pro b/tests/auto/qidentityproxymodel/qidentityproxymodel.pro index f529e20c7f..7df0e65d03 100644 --- a/tests/auto/qidentityproxymodel/qidentityproxymodel.pro +++ b/tests/auto/qidentityproxymodel/qidentityproxymodel.pro @@ -2,5 +2,6 @@ load(qttest_p4) INCLUDEPATH += $$PWD/../modeltest +QT += widgets SOURCES += tst_qidentityproxymodel.cpp ../modeltest/dynamictreemodel.cpp ../modeltest/modeltest.cpp HEADERS += ../modeltest/dynamictreemodel.h ../modeltest/modeltest.h diff --git a/tests/auto/qimage/tst_qimage.cpp b/tests/auto/qimage/tst_qimage.cpp index 4336feba7a..dce2957ae4 100644 --- a/tests/auto/qimage/tst_qimage.cpp +++ b/tests/auto/qimage/tst_qimage.cpp @@ -1986,7 +1986,7 @@ void tst_QImage::rgbSwapped() QCOMPARE(image, imageSwappedTwice); - QCOMPARE(memcmp(image.constBits(), imageSwappedTwice.constBits(), image.numBytes()), 0); + QCOMPARE(memcmp(image.constBits(), imageSwappedTwice.constBits(), image.byteCount()), 0); } void tst_QImage::deepCopyWhenPaintingActive() diff --git a/tests/auto/qimagereader/qimagereader.pro b/tests/auto/qimagereader/qimagereader.pro index 5c939b3a3c..43d587ea48 100644 --- a/tests/auto/qimagereader/qimagereader.pro +++ b/tests/auto/qimagereader/qimagereader.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qimagereader.cpp MOC_DIR=tmp -QT += core-private gui-private network +QT += widgets widgets-private core-private gui-private network RESOURCES += qimagereader.qrc !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/qimagewriter/qimagewriter.pro b/tests/auto/qimagewriter/qimagewriter.pro index bab241977b..0fc40d0f0a 100644 --- a/tests/auto/qimagewriter/qimagewriter.pro +++ b/tests/auto/qimagewriter/qimagewriter.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qimagewriter.cpp MOC_DIR=tmp !contains(QT_CONFIG, no-tiff):DEFINES += QTEST_HAVE_TIFF diff --git a/tests/auto/qinputcontext/qinputcontext.pro b/tests/auto/qinputcontext/qinputcontext.pro index cd9fa0e423..7d85446b4f 100644 --- a/tests/auto/qinputcontext/qinputcontext.pro +++ b/tests/auto/qinputcontext/qinputcontext.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qinputcontext.cpp symbian { diff --git a/tests/auto/qinputdialog/qinputdialog.pro b/tests/auto/qinputdialog/qinputdialog.pro index 2f68a40d91..f7e56bd783 100644 --- a/tests/auto/qinputdialog/qinputdialog.pro +++ b/tests/auto/qinputdialog/qinputdialog.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qinputdialog.cpp diff --git a/tests/auto/qitemdelegate/qitemdelegate.pro b/tests/auto/qitemdelegate/qitemdelegate.pro index 1206976868..9a1a3b5e94 100644 --- a/tests/auto/qitemdelegate/qitemdelegate.pro +++ b/tests/auto/qitemdelegate/qitemdelegate.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qitemdelegate.cpp win32:!wince*: LIBS += -lUser32 diff --git a/tests/auto/qitemeditorfactory/qitemeditorfactory.pro b/tests/auto/qitemeditorfactory/qitemeditorfactory.pro index d589f4e01b..89bc944c51 100644 --- a/tests/auto/qitemeditorfactory/qitemeditorfactory.pro +++ b/tests/auto/qitemeditorfactory/qitemeditorfactory.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qitemeditorfactory.cpp diff --git a/tests/auto/qitemmodel/modelstotest.cpp b/tests/auto/qitemmodel/modelstotest.cpp index 772f72b973..82c28b5303 100644 --- a/tests/auto/qitemmodel/modelstotest.cpp +++ b/tests/auto/qitemmodel/modelstotest.cpp @@ -43,7 +43,6 @@ #include <QtTest/QtTest> #include <QtCore/QtCore> #include <QtSql/QtSql> -#include <QtGui/QtGui> #include <QSortFilterProxyModel> /* diff --git a/tests/auto/qitemmodel/qitemmodel.pro b/tests/auto/qitemmodel/qitemmodel.pro index b348a183f8..97d55fcd4d 100644 --- a/tests/auto/qitemmodel/qitemmodel.pro +++ b/tests/auto/qitemmodel/qitemmodel.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qitemmodel.cpp -QT += sql +QT += widgets sql # NOTE: The deployment of the sqldrivers is disabled on purpose. # If we deploy the plugins, they are loaded twice when running diff --git a/tests/auto/qitemselectionmodel/qitemselectionmodel.pro b/tests/auto/qitemselectionmodel/qitemselectionmodel.pro index afc859e5ef..c675a6eb9d 100644 --- a/tests/auto/qitemselectionmodel/qitemselectionmodel.pro +++ b/tests/auto/qitemselectionmodel/qitemselectionmodel.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qitemselectionmodel.cpp diff --git a/tests/auto/qitemview/qitemview.pro b/tests/auto/qitemview/qitemview.pro index de2c328493..dbdd4612d5 100644 --- a/tests/auto/qitemview/qitemview.pro +++ b/tests/auto/qitemview/qitemview.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qitemview.cpp diff --git a/tests/auto/qkeysequence/qkeysequence.pro b/tests/auto/qkeysequence/qkeysequence.pro index 720c53d627..6cfbe459ea 100644 --- a/tests/auto/qkeysequence/qkeysequence.pro +++ b/tests/auto/qkeysequence/qkeysequence.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qkeysequence.cpp diff --git a/tests/auto/qlabel/qlabel.pro b/tests/auto/qlabel/qlabel.pro index 4b510cca52..6e9229f83a 100644 --- a/tests/auto/qlabel/qlabel.pro +++ b/tests/auto/qlabel/qlabel.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qlabel.cpp diff --git a/tests/auto/qlayout/qlayout.pro b/tests/auto/qlayout/qlayout.pro index 919eba2003..c4803ec2db 100644 --- a/tests/auto/qlayout/qlayout.pro +++ b/tests/auto/qlayout/qlayout.pro @@ -1,6 +1,6 @@ load(qttest_p4) -QT += gui-private +QT += widgets widgets-private SOURCES += tst_qlayout.cpp wince*|symbian: { diff --git a/tests/auto/qlayout/tst_qlayout.cpp b/tests/auto/qlayout/tst_qlayout.cpp index 81b92cadec..ea25700568 100644 --- a/tests/auto/qlayout/tst_qlayout.cpp +++ b/tests/auto/qlayout/tst_qlayout.cpp @@ -49,9 +49,9 @@ #include <qdialog.h> #include <qsizegrip.h> #include <qlabel.h> -#include <QtGui/QFrame> -#include <QtGui/QWindowsStyle> -#include <QtGui/QSizePolicy> +#include <QtWidgets/QFrame> +#include <QtWidgets/QWindowsStyle> +#include <QtWidgets/QSizePolicy> #include <QPushButton> #include <QRadioButton> #include <private/qlayoutengine_p.h> diff --git a/tests/auto/qlcdnumber/qlcdnumber.pro b/tests/auto/qlcdnumber/qlcdnumber.pro index 4f1b0091ba..cd909de5be 100644 --- a/tests/auto/qlcdnumber/qlcdnumber.pro +++ b/tests/auto/qlcdnumber/qlcdnumber.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qlcdnumber.cpp diff --git a/tests/auto/qlineedit/qlineedit.pro b/tests/auto/qlineedit/qlineedit.pro index bb6d95027b..9a9cb2bfe1 100644 --- a/tests/auto/qlineedit/qlineedit.pro +++ b/tests/auto/qlineedit/qlineedit.pro @@ -1,2 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qlineedit.cpp diff --git a/tests/auto/qlistview/qlistview.pro b/tests/auto/qlistview/qlistview.pro index 21dfe57606..cba2ef1170 100644 --- a/tests/auto/qlistview/qlistview.pro +++ b/tests/auto/qlistview/qlistview.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qlistview.cpp win32:!wince*: LIBS += -luser32 diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp index 3c4b05bc0f..1c35098152 100644 --- a/tests/auto/qlistview/tst_qlistview.cpp +++ b/tests/auto/qlistview/tst_qlistview.cpp @@ -53,9 +53,9 @@ #include <cmath> #endif #include <math.h> -#include <QtGui/QScrollBar> -#include <QtGui/QDialog> -#include <QtGui/QStyledItemDelegate> +#include <QtWidgets/QScrollBar> +#include <QtWidgets/QDialog> +#include <QtWidgets/QStyledItemDelegate> #if defined(Q_OS_WIN) || defined(Q_OS_WINCE) #include <windows.h> #endif diff --git a/tests/auto/qlistwidget/qlistwidget.pro b/tests/auto/qlistwidget/qlistwidget.pro index 30305e1c8d..7343415e4c 100644 --- a/tests/auto/qlistwidget/qlistwidget.pro +++ b/tests/auto/qlistwidget/qlistwidget.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qlistwidget.cpp diff --git a/tests/auto/qmacstyle/qmacstyle.pro b/tests/auto/qmacstyle/qmacstyle.pro index fb23a52c0f..5aad7368c6 100644 --- a/tests/auto/qmacstyle/qmacstyle.pro +++ b/tests/auto/qmacstyle/qmacstyle.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qmacstyle.cpp diff --git a/tests/auto/qmacstyle/tst_qmacstyle.cpp b/tests/auto/qmacstyle/tst_qmacstyle.cpp index 6e03afd575..3c2f71184d 100644 --- a/tests/auto/qmacstyle/tst_qmacstyle.cpp +++ b/tests/auto/qmacstyle/tst_qmacstyle.cpp @@ -41,7 +41,7 @@ #include <QtTest/QtTest> -#include <QtGui> +#include <QtWidgets> #include <qmacstyle_mac.h> diff --git a/tests/auto/qmainwindow/qmainwindow.pro b/tests/auto/qmainwindow/qmainwindow.pro index 038686e18c..09633d0e32 100644 --- a/tests/auto/qmainwindow/qmainwindow.pro +++ b/tests/auto/qmainwindow/qmainwindow.pro @@ -1,6 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private SOURCES += tst_qmainwindow.cpp -QT += core-private gui-private # Symbian toolchain does not support correct include semantics symbian:INCPATH+=..\\..\\..\\include\\QtGui\\private diff --git a/tests/auto/qmdiarea/qmdiarea.pro b/tests/auto/qmdiarea/qmdiarea.pro index e16c679b3a..6a12152fcc 100644 --- a/tests/auto/qmdiarea/qmdiarea.pro +++ b/tests/auto/qmdiarea/qmdiarea.pro @@ -1,6 +1,6 @@ load(qttest_p4) -QT += gui-private +QT += gui-private widgets INCLUDEPATH += . SOURCES += tst_qmdiarea.cpp diff --git a/tests/auto/qmdisubwindow/qmdisubwindow.pro b/tests/auto/qmdisubwindow/qmdisubwindow.pro index 00a1e51fbe..5c5bd525df 100644 --- a/tests/auto/qmdisubwindow/qmdisubwindow.pro +++ b/tests/auto/qmdisubwindow/qmdisubwindow.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets INCLUDEPATH += . SOURCES += tst_qmdisubwindow.cpp DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII diff --git a/tests/auto/qmenu/qmenu.pro b/tests/auto/qmenu/qmenu.pro index 63451a11b6..1fc1a7ff9d 100644 --- a/tests/auto/qmenu/qmenu.pro +++ b/tests/auto/qmenu/qmenu.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qmenu.cpp qpa:contains(QT_CONFIG,xcb):CONFIG+=insignificant_test # QTBUG-21100, unstably fails diff --git a/tests/auto/qmenubar/qmenubar.pro b/tests/auto/qmenubar/qmenubar.pro index ba2dea8eb7..73c2545710 100644 --- a/tests/auto/qmenubar/qmenubar.pro +++ b/tests/auto/qmenubar/qmenubar.pro @@ -1,2 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qmenubar.cpp diff --git a/tests/auto/qmessagebox/qmessagebox.pro b/tests/auto/qmessagebox/qmessagebox.pro index 1893c42a64..e3f6ddb1f6 100644 --- a/tests/auto/qmessagebox/qmessagebox.pro +++ b/tests/auto/qmessagebox/qmessagebox.pro @@ -1,6 +1,7 @@ load(qttest_p4) TEMPLATE = app TARGET = tst_qmessagebox +QT += widgets DEPENDPATH += . INCLUDEPATH += . diff --git a/tests/auto/qmetaobject/qmetaobject.pro b/tests/auto/qmetaobject/qmetaobject.pro index 1df54f73bf..7a4cf94e47 100644 --- a/tests/auto/qmetaobject/qmetaobject.pro +++ b/tests/auto/qmetaobject/qmetaobject.pro @@ -1,6 +1,6 @@ load(qttest_p4) -QT = core gui +QT = core gui widgets SOURCES += tst_qmetaobject.cpp diff --git a/tests/auto/qmetatype/tst_qmetatype.cpp b/tests/auto/qmetatype/tst_qmetatype.cpp index 897664ea9a..3fb60acf57 100644 --- a/tests/auto/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/qmetatype/tst_qmetatype.cpp @@ -255,7 +255,6 @@ void tst_QMetaType::typeName_data() QTest::newRow("double") << QMetaType::Double << "double"; QTest::newRow("qlonglong") << QMetaType::LongLong << "qlonglong"; QTest::newRow("QRegExp") << QMetaType::QRegExp << "QRegExp"; - QTest::newRow("QColorGroup") << QMetaType::Type(63) << "QColorGroup"; QTest::newRow("void*") << QMetaType::VoidStar << "void*"; QTest::newRow("ulong") << QMetaType::ULong << "ulong"; QTest::newRow("QWidget*") << QMetaType::QWidgetStar << "QWidget*"; diff --git a/tests/auto/qmouseevent/qmouseevent.pro b/tests/auto/qmouseevent/qmouseevent.pro index 0e5ddadc1f..58cebd3d06 100644 --- a/tests/auto/qmouseevent/qmouseevent.pro +++ b/tests/auto/qmouseevent/qmouseevent.pro @@ -1,2 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qmouseevent.cpp diff --git a/tests/auto/qmouseevent_modal/qmouseevent_modal.pro b/tests/auto/qmouseevent_modal/qmouseevent_modal.pro index 33b8eb6954..2f28de2675 100644 --- a/tests/auto/qmouseevent_modal/qmouseevent_modal.pro +++ b/tests/auto/qmouseevent_modal/qmouseevent_modal.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qmouseevent_modal.cpp diff --git a/tests/auto/qmovie/qmovie.pro b/tests/auto/qmovie/qmovie.pro index 855eb9e17a..3e085ceeaf 100644 --- a/tests/auto/qmovie/qmovie.pro +++ b/tests/auto/qmovie/qmovie.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qmovie.cpp MOC_DIR=tmp diff --git a/tests/auto/qmultiscreen/qmultiscreen.pro b/tests/auto/qmultiscreen/qmultiscreen.pro index 30666d72da..c4a983c5be 100644 --- a/tests/auto/qmultiscreen/qmultiscreen.pro +++ b/tests/auto/qmultiscreen/qmultiscreen.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qmultiscreen.cpp requires(embedded) diff --git a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro index 378deba11e..e5afc353c8 100644 --- a/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro +++ b/tests/auto/qnetworkaccessmanager_and_qprogressdialog/qnetworkaccessmanager_and_qprogressdialog.pro @@ -1,6 +1,6 @@ load(qttest_p4) SOURCES += tst_qnetworkaccessmanager_and_qprogressdialog.cpp -QT += network +QT += network widgets symbian: TARGET.CAPABILITY = NetworkServices diff --git a/tests/auto/qopengl/qopengl.pro b/tests/auto/qopengl/qopengl.pro new file mode 100644 index 0000000000..b049518f7a --- /dev/null +++ b/tests/auto/qopengl/qopengl.pro @@ -0,0 +1,10 @@ +############################################################ +# Project file for autotest for gui/opengl functionality +############################################################ + +load(qttest_p4) +QT += gui gui-private core-private + +SOURCES += tst_qopengl.cpp + +CONFIG += insignificant_test diff --git a/tests/auto/qopengl/tst_qopengl.cpp b/tests/auto/qopengl/tst_qopengl.cpp new file mode 100644 index 0000000000..1df7985df9 --- /dev/null +++ b/tests/auto/qopengl/tst_qopengl.cpp @@ -0,0 +1,345 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + + +#include <QtGui/private/qopenglcontext_p.h> +#include <QtGui/QWindow> + +#include <QtTest/QtTest> + +class tst_QOpenGL : public QObject +{ +Q_OBJECT + +private slots: + void sharedResourceCleanup(); + void fboSimpleRendering(); + void fboRendering(); +}; + +struct SharedResourceTracker +{ + SharedResourceTracker() + { + reset(); + } + + void reset() + { + invalidateResourceCalls = 0; + freeResourceCalls = 0; + destructorCalls = 0; + } + + int invalidateResourceCalls; + int freeResourceCalls; + int destructorCalls; +}; + +struct SharedResource : public QOpenGLSharedResource +{ + SharedResource(SharedResourceTracker *t) + : QOpenGLSharedResource(QOpenGLContextGroup::currentContextGroup()) + , resource(1) + , tracker(t) + { + } + + ~SharedResource() + { + tracker->destructorCalls++; + } + + void invalidateResource() + { + resource = 0; + tracker->invalidateResourceCalls++; + } + + void freeResource(QOpenGLContext *context) + { + Q_ASSERT(context == QOpenGLContext::currentContext()); + resource = 0; + tracker->freeResourceCalls++; + } + + int resource; + SharedResourceTracker *tracker; +}; + +void tst_QOpenGL::sharedResourceCleanup() +{ + QWindow window; + window.setGeometry(0, 0, 10, 10); + window.create(); + + QOpenGLContext *ctx = new QOpenGLContext; + ctx->create(); + ctx->makeCurrent(&window); + + SharedResourceTracker tracker; + SharedResource *resource = new SharedResource(&tracker); + resource->free(); + + QCOMPARE(tracker.invalidateResourceCalls, 0); + QCOMPARE(tracker.freeResourceCalls, 1); + QCOMPARE(tracker.destructorCalls, 1); + + tracker.reset(); + + resource = new SharedResource(&tracker); + + QOpenGLContext *ctx2 = new QOpenGLContext; + ctx2->setShareContext(ctx); + ctx2->create(); + delete ctx; + + resource->free(); + + // no current context, freeResource() delayed + QCOMPARE(tracker.invalidateResourceCalls, 0); + QCOMPARE(tracker.freeResourceCalls, 0); + QCOMPARE(tracker.destructorCalls, 0); + + ctx2->makeCurrent(&window); + + // freeResource() should now have been called + QCOMPARE(tracker.invalidateResourceCalls, 0); + QCOMPARE(tracker.freeResourceCalls, 1); + QCOMPARE(tracker.destructorCalls, 1); + + delete ctx2; +} + +static bool fuzzyComparePixels(const QRgb testPixel, const QRgb refPixel, const char* file, int line, int x = -1, int y = -1) +{ + static int maxFuzz = 1; + static bool maxFuzzSet = false; + + // On 16 bpp systems, we need to allow for more fuzz: + if (!maxFuzzSet) { + maxFuzzSet = true; + if (QGuiApplication::primaryScreen()->depth() < 24) + maxFuzz = 32; + } + + int redFuzz = qAbs(qRed(testPixel) - qRed(refPixel)); + int greenFuzz = qAbs(qGreen(testPixel) - qGreen(refPixel)); + int blueFuzz = qAbs(qBlue(testPixel) - qBlue(refPixel)); + int alphaFuzz = qAbs(qAlpha(testPixel) - qAlpha(refPixel)); + + if (refPixel != 0 && testPixel == 0) { + QString msg; + if (x >= 0) { + msg = QString("Test pixel [%1, %2] is null (black) when it should be (%3,%4,%5,%6)") + .arg(x).arg(y) + .arg(qRed(refPixel)).arg(qGreen(refPixel)).arg(qBlue(refPixel)).arg(qAlpha(refPixel)); + } else { + msg = QString("Test pixel is null (black) when it should be (%2,%3,%4,%5)") + .arg(qRed(refPixel)).arg(qGreen(refPixel)).arg(qBlue(refPixel)).arg(qAlpha(refPixel)); + } + + QTest::qFail(msg.toLatin1(), file, line); + return false; + } + + if (redFuzz > maxFuzz || greenFuzz > maxFuzz || blueFuzz > maxFuzz || alphaFuzz > maxFuzz) { + QString msg; + + if (x >= 0) + msg = QString("Pixel [%1,%2]: ").arg(x).arg(y); + else + msg = QString("Pixel "); + + msg += QString("Max fuzz (%1) exceeded: (%2,%3,%4,%5) vs (%6,%7,%8,%9)") + .arg(maxFuzz) + .arg(qRed(testPixel)).arg(qGreen(testPixel)).arg(qBlue(testPixel)).arg(qAlpha(testPixel)) + .arg(qRed(refPixel)).arg(qGreen(refPixel)).arg(qBlue(refPixel)).arg(qAlpha(refPixel)); + QTest::qFail(msg.toLatin1(), file, line); + return false; + } + return true; +} + +static void fuzzyCompareImages(const QImage &testImage, const QImage &referenceImage, const char* file, int line) +{ + QCOMPARE(testImage.width(), referenceImage.width()); + QCOMPARE(testImage.height(), referenceImage.height()); + + for (int y = 0; y < testImage.height(); y++) { + for (int x = 0; x < testImage.width(); x++) { + if (!fuzzyComparePixels(testImage.pixel(x, y), referenceImage.pixel(x, y), file, line, x, y)) { + // Might as well save the images for easier debugging: + referenceImage.save("referenceImage.png"); + testImage.save("testImage.png"); + return; + } + } + } +} + +#define QFUZZY_COMPARE_IMAGES(A,B) \ + fuzzyCompareImages(A, B, __FILE__, __LINE__) + +#define QFUZZY_COMPARE_PIXELS(A,B) \ + fuzzyComparePixels(A, B, __FILE__, __LINE__) + +void qt_opengl_draw_test_pattern(QPainter* painter, int width, int height) +{ + QPainterPath intersectingPath; + intersectingPath.moveTo(0, 0); + intersectingPath.lineTo(100, 0); + intersectingPath.lineTo(0, 100); + intersectingPath.lineTo(100, 100); + intersectingPath.closeSubpath(); + + QPainterPath trianglePath; + trianglePath.moveTo(50, 0); + trianglePath.lineTo(100, 100); + trianglePath.lineTo(0, 100); + trianglePath.closeSubpath(); + + painter->setTransform(QTransform()); // reset xform + painter->fillRect(-1, -1, width+2, height+2, Qt::red); // Background + painter->translate(14, 14); + painter->fillPath(intersectingPath, Qt::blue); // Test stencil buffer works + painter->translate(128, 0); + painter->setClipPath(trianglePath); // Test depth buffer works + painter->setTransform(QTransform()); // reset xform ready for fill + painter->fillRect(-1, -1, width+2, height+2, Qt::green); +} + +void qt_opengl_check_test_pattern(const QImage& img) +{ + // As we're doing more than trivial painting, we can't just compare to + // an image rendered with raster. Instead, we sample at well-defined + // test-points: + QFUZZY_COMPARE_PIXELS(img.pixel(39, 64), QColor(Qt::red).rgb()); + QFUZZY_COMPARE_PIXELS(img.pixel(89, 64), QColor(Qt::red).rgb()); + QFUZZY_COMPARE_PIXELS(img.pixel(64, 39), QColor(Qt::blue).rgb()); + QFUZZY_COMPARE_PIXELS(img.pixel(64, 89), QColor(Qt::blue).rgb()); + + QFUZZY_COMPARE_PIXELS(img.pixel(167, 39), QColor(Qt::red).rgb()); + QFUZZY_COMPARE_PIXELS(img.pixel(217, 39), QColor(Qt::red).rgb()); + QFUZZY_COMPARE_PIXELS(img.pixel(192, 64), QColor(Qt::green).rgb()); +} + + +void tst_QOpenGL::fboSimpleRendering() +{ + QWindow window; + window.setGeometry(0, 0, 10, 10); + window.create(); + QOpenGLContext ctx; + ctx.create(); + + ctx.makeCurrent(&window); + + if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects()) + QSKIP("QOpenGLFramebufferObject not supported on this platform", SkipSingle); + + // No multisample with combined depth/stencil attachment: + QOpenGLFramebufferObjectFormat fboFormat; + fboFormat.setAttachment(QOpenGLFramebufferObject::NoAttachment); + + QOpenGLFramebufferObject *fbo = new QOpenGLFramebufferObject(200, 100, fboFormat); + + fbo->bind(); + + glClearColor(1.0, 0.0, 0.0, 1.0); + glClear(GL_COLOR_BUFFER_BIT); + glFinish(); + + QImage fb = fbo->toImage().convertToFormat(QImage::Format_RGB32); + QImage reference(fb.size(), QImage::Format_RGB32); + reference.fill(0xffff0000); + + QFUZZY_COMPARE_IMAGES(fb, reference); + + delete fbo; +} + +// NOTE: This tests that CombinedDepthStencil attachment works by assuming the +// GL2 engine is being used and is implemented the same way as it was when +// this autotest was written. If this is not the case, there may be some +// false-positives: I.e. The test passes when either the depth or stencil +// buffer is actually missing. But that's probably ok anyway. +void tst_QOpenGL::fboRendering() +{ + QWindow window; + window.setGeometry(0, 0, 10, 10); + window.create(); + QOpenGLContext ctx; + ctx.create(); + + ctx.makeCurrent(&window); + + if (!QOpenGLFramebufferObject::hasOpenGLFramebufferObjects()) + QSKIP("QOpenGLFramebufferObject not supported on this platform", SkipSingle); + + // No multisample with combined depth/stencil attachment: + QOpenGLFramebufferObjectFormat fboFormat; + fboFormat.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); + + // Uncomplicate things by using NPOT: + QOpenGLFramebufferObject *fbo = new QOpenGLFramebufferObject(256, 128, fboFormat); + + if (fbo->attachment() != QOpenGLFramebufferObject::CombinedDepthStencil) { + delete fbo; + QSKIP("FBOs missing combined depth~stencil support", SkipSingle); + } + + QPainter fboPainter; + bool painterBegun = fboPainter.begin(fbo); + QVERIFY(painterBegun); + + qt_opengl_draw_test_pattern(&fboPainter, fbo->width(), fbo->height()); + + fboPainter.end(); + + QImage fb = fbo->toImage().convertToFormat(QImage::Format_RGB32); + delete fbo; + + qt_opengl_check_test_pattern(fb); +} + +QTEST_MAIN(tst_QOpenGL) +#include "tst_qopengl.moc" diff --git a/tests/auto/qpainter/qpainter.pro b/tests/auto/qpainter/qpainter.pro index f29e39afec..00307d3e58 100644 --- a/tests/auto/qpainter/qpainter.pro +++ b/tests/auto/qpainter/qpainter.pro @@ -1,6 +1,6 @@ load(qttest_p4) -QT += gui-private +QT += widgets widgets-private printsupport SOURCES += tst_qpainter.cpp wince*|symbian: { diff --git a/tests/auto/qpalette/qpalette.pro b/tests/auto/qpalette/qpalette.pro index 4ec7876f6a..4b240e5f9c 100644 --- a/tests/auto/qpalette/qpalette.pro +++ b/tests/auto/qpalette/qpalette.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qpalette.cpp diff --git a/tests/auto/qpicture/qpicture.pro b/tests/auto/qpicture/qpicture.pro index 9979fe3559..eb96b73487 100644 --- a/tests/auto/qpicture/qpicture.pro +++ b/tests/auto/qpicture/qpicture.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qpicture.cpp diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index f5df30cc1d..fe156d547c 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -1,6 +1,6 @@ load(qttest_p4) -QT += core-private gui-private +QT += core-private gui-private widgets widgets-private SOURCES += tst_qpixmap.cpp wince*|symbian: { @@ -25,10 +25,6 @@ wince*: { DEPLOYMENT_PLUGIN += qico } else:symbian { LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll - contains(QT_CONFIG, openvg) { - LIBS += $$QMAKE_LIBS_OPENVG - QT *= openvg - } } else { DEFINES += SRCDIR=\\\"$$PWD\\\" win32:LIBS += -lgdi32 -luser32 diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp index e62708fc3d..38858e5503 100644 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/qpixmap/tst_qpixmap.cpp @@ -51,7 +51,7 @@ #include <qtreewidget.h> #include <qsplashscreen.h> -#include <private/qpixmapdata_p.h> +#include <qplatformpixmap_qpa.h> #include <private/qdrawhelper_p.h> #include <QSet> @@ -102,9 +102,6 @@ public slots: private slots: void swap(); - void setAlphaChannel_data(); - void setAlphaChannel(); - void fromImage_data(); void fromImage(); @@ -267,79 +264,6 @@ void tst_QPixmap::swap() QCOMPARE(p2.size(), QSize(16,16)); } -void tst_QPixmap::setAlphaChannel_data() -{ - QTest::addColumn<int>("red"); - QTest::addColumn<int>("green"); - QTest::addColumn<int>("blue"); - QTest::addColumn<int>("alpha"); - - QTest::newRow("red 0") << 255 << 0 << 0 << 0; - QTest::newRow("red 24") << 255 << 0 << 0 << 24; - QTest::newRow("red 124") << 255 << 0 << 0 << 124; - QTest::newRow("red 255") << 255 << 0 << 0 << 255; - - QTest::newRow("green 0") << 0 << 255 << 0 << 0; - QTest::newRow("green 24") << 0 << 255 << 0 << 24; - QTest::newRow("green 124") << 0 << 255 << 0 << 124; - QTest::newRow("green 255") << 0 << 255 << 0 << 255; - - QTest::newRow("blue 0") << 0 << 0 << 255 << 0; - QTest::newRow("blue 24") << 0 << 0 << 255 << 24; - QTest::newRow("blue 124") << 0 << 0 << 255 << 124; - QTest::newRow("blue 255") << 0 << 0 << 255 << 255; -} - -void tst_QPixmap::setAlphaChannel() -{ - QFETCH(int, red); - QFETCH(int, green); - QFETCH(int, blue); - QFETCH(int, alpha); - - int width = 100; - int height = 100; - - QPixmap pixmap(width, height); - pixmap.fill(QColor(red, green, blue)); - - QPixmap alphaChannel(width, height); - alphaChannel.fill(QColor(alpha, alpha, alpha)); - pixmap.setAlphaChannel(alphaChannel); - -#ifdef Q_WS_X11 - if (pixmap.pixmapData()->classId() == QPixmapData::X11Class && !pixmap.x11PictureHandle()) - QSKIP("Requires XRender support", SkipAll); -#endif - - QImage result; - bool ok = true; - - QPixmap outAlpha = pixmap.alphaChannel(); - QCOMPARE(outAlpha.size(), pixmap.size()); - - result = outAlpha.toImage().convertToFormat(QImage::Format_ARGB32);; - for (int y = 0; y < height; ++y) { - for (int x = 0; x < width; ++x) { - ok &= qGray(result.pixel(x, y)) == alpha; - } - } - QVERIFY(ok); - - result = pixmap.toImage().convertToFormat(QImage::Format_ARGB32); - QRgb expected = alpha == 0 ? 0 : qRgba(red, green, blue, alpha); - for (int y = 0; y < height; ++y) { - for (int x = 0; x < width; ++x) { - if (result.colorCount() > 0) { - ok &= result.pixelIndex(x, y) == expected; - } else { - ok &= result.pixel(x, y) == expected; - } - } - } - QVERIFY(ok); -} - void tst_QPixmap::fromImage_data() { bool is16bit = false; @@ -375,7 +299,7 @@ void tst_QPixmap::fromImage() const QPixmap pixmap = QPixmap::fromImage(image); #ifdef Q_WS_X11 - if (pixmap.pixmapData()->classId() == QPixmapData::X11Class && !pixmap.x11PictureHandle()) + if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle()) QSKIP("Requires XRender support", SkipAll); #endif const QImage result = pixmap.toImage(); @@ -606,7 +530,7 @@ void tst_QPixmap::fill() pm = QPixmap(400, 400); #if defined(Q_WS_X11) - if (!bitmap && pm.pixmapData()->classId() == QPixmapData::X11Class && !pm.x11PictureHandle()) + if (!bitmap && pm.handle()->classId() == QPlatformPixmap::X11Class && !pm.x11PictureHandle()) QSKIP("Requires XRender support", SkipSingle); #endif @@ -636,7 +560,7 @@ void tst_QPixmap::fill_transparent() { QPixmap pixmap(10, 10); #ifdef Q_WS_X11 - if (pixmap.pixmapData()->classId() == QPixmapData::X11Class && !pixmap.x11PictureHandle()) + if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle()) QSKIP("Requires XRender support", SkipAll); #endif pixmap.fill(Qt::transparent); @@ -940,7 +864,7 @@ void tst_QPixmap::isNull() void tst_QPixmap::convertFromImageNoDetach() { QPixmap randomPixmap(10, 10); - if (randomPixmap.pixmapData()->classId() != QPixmapData::RasterClass) + if (randomPixmap.handle()->classId() != QPlatformPixmap::RasterClass) QSKIP("Test only valid for raster pixmaps", SkipAll); //first get the screen format @@ -1513,7 +1437,7 @@ void tst_QPixmap::fromImage_crash() delete img; } -//This is testing QPixmapData::createCompatiblePixmapData - see QTBUG-5977 +//This is testing QPlatformPixmap::createCompatiblePlatformPixmap - see QTBUG-5977 void tst_QPixmap::splash_crash() { QPixmap pix; @@ -1755,10 +1679,10 @@ void tst_QPixmap::toImageDeepCopy() #if defined(Q_OS_SYMBIAN) && !defined(QT_NO_OPENVG) Q_OPENVG_EXPORT VGImage qPixmapToVGImage(const QPixmap& pixmap); -class FriendlyVGPixmapData : public QVGPixmapData +class FriendlyVGPlatformPixmap : public QVGPlatformPixmap { public: - FriendlyVGPixmapData(PixelType type) : QVGPixmapData(type) { } + FriendlyVGPlatformPixmap(PixelType type) : QVGPlatformPixmap(type) { } bool sourceIsNull() { return source.isNull(); } friend QPixmap pixmapFromVGImage(VGImage image); }; @@ -1767,7 +1691,7 @@ QPixmap pixmapFromVGImage(VGImage image) if (image != VG_INVALID_HANDLE) { int w = vgGetParameteri(image, VG_IMAGE_WIDTH); int h = vgGetParameteri(image, VG_IMAGE_HEIGHT); - FriendlyVGPixmapData *pd = new FriendlyVGPixmapData(QPixmapData::PixmapType); + FriendlyVGPlatformPixmap *pd = new FriendlyVGPlatformPixmap(QPlatformPixmap::PixmapType); pd->resize(w, h); pd->vgImage = image; pd->recreate = false; @@ -1796,12 +1720,12 @@ public: } else { // second phase: check if readback works painter.drawPixmap(0, 0, pm); // Drawing should not cause readback, this is important for performance; - noreadback_ok = static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull(); + noreadback_ok = static_cast<FriendlyVGPlatformPixmap *>(pm.handle())->sourceIsNull(); // However toImage() requires readback. QImage img = pm.toImage(); readback_ok = img.width() == pm.width(); readback_ok &= img.height() == pm.height(); - readback_ok &= !static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull(); + readback_ok &= !static_cast<FriendlyVGPlatformPixmap *>(pm.handle())->sourceIsNull(); uint pix = img.pixel(1, 1); content_ok = qRed(pix) == testPixel.red(); content_ok &= qGreen(pix) == testPixel.green(); @@ -1823,7 +1747,7 @@ public: void tst_QPixmap::vgImageReadBack() { QPixmap tmp(10, 20); - if (tmp.pixmapData()->classId() == QPixmapData::OpenVGClass) { + if (tmp.handle()->classId() == QPlatformPixmap::OpenVGClass) { Content c; c.w = 50; c.h = 60; @@ -1837,7 +1761,7 @@ void tst_QPixmap::vgImageReadBack() QCOMPARE(pm.width(), c.w); QCOMPARE(pm.height(), c.h); QVERIFY(qPixmapToVGImage(pm) == c.vgimage); - QVERIFY(static_cast<FriendlyVGPixmapData *>(pm.pixmapData())->sourceIsNull()); + QVERIFY(static_cast<FriendlyVGPlatformPixmap *>(pm.handle())->sourceIsNull()); c.pm = pm; // Make sure the second phase in paintEvent is executed too. c.hide(); diff --git a/tests/auto/qpixmapfilter/qpixmapfilter.pro b/tests/auto/qpixmapfilter/qpixmapfilter.pro index d52a3c39a3..21e10b7ab9 100644 --- a/tests/auto/qpixmapfilter/qpixmapfilter.pro +++ b/tests/auto/qpixmapfilter/qpixmapfilter.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += gui-private SOURCES += tst_qpixmapfilter.cpp diff --git a/tests/auto/qplaintextedit/qplaintextedit.pro b/tests/auto/qplaintextedit/qplaintextedit.pro index fef1ac83aa..feac5e3f43 100644 --- a/tests/auto/qplaintextedit/qplaintextedit.pro +++ b/tests/auto/qplaintextedit/qplaintextedit.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += gui-private INCLUDEPATH += ../ diff --git a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp index 0802f51752..8a423dc933 100644 --- a/tests/auto/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/qplaintextedit/tst_qplaintextedit.cpp @@ -50,7 +50,7 @@ #include <qapplication.h> #include <qclipboard.h> #include <qtextbrowser.h> -#include <private/qtextcontrol_p.h> +#include <private/qwidgettextcontrol_p.h> #include <qscrollbar.h> #include <qtextobject.h> @@ -1136,7 +1136,7 @@ void tst_QPlainTextEdit::mimeDataReimplementations() QCOMPARE(ed.insertCallCount, 0); #ifdef QT_BUILD_INTERNAL - QTextControl *control = qFindChild<QTextControl *>(&ed); + QWidgetTextControl *control = qFindChild<QWidgetTextControl *>(&ed); QVERIFY(control); control->canInsertFromMimeData(QApplication::clipboard()->mimeData()); diff --git a/tests/auto/qpointer/qpointer.pro b/tests/auto/qpointer/qpointer.pro index a30a6fa42b..5728b7bb4f 100644 --- a/tests/auto/qpointer/qpointer.pro +++ b/tests/auto/qpointer/qpointer.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qpointer.cpp diff --git a/tests/auto/qpolygon/qpolygon.pro b/tests/auto/qpolygon/qpolygon.pro index e832666d7c..186b704d17 100644 --- a/tests/auto/qpolygon/qpolygon.pro +++ b/tests/auto/qpolygon/qpolygon.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qpolygon.cpp unix:!mac:!symbian:LIBS+=-lm diff --git a/tests/auto/qprinter/qprinter.pro b/tests/auto/qprinter/qprinter.pro index b412688544..cbe4ad7986 100644 --- a/tests/auto/qprinter/qprinter.pro +++ b/tests/auto/qprinter/qprinter.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += printsupport widgets SOURCES += tst_qprinter.cpp mac*:CONFIG+=insignificant_test diff --git a/tests/auto/qprinter/tst_qprinter.cpp b/tests/auto/qprinter/tst_qprinter.cpp index f67f8af3bd..a6b6895981 100644 --- a/tests/auto/qprinter/tst_qprinter.cpp +++ b/tests/auto/qprinter/tst_qprinter.cpp @@ -533,11 +533,13 @@ void tst_QPrinter::testMulitpleSets() void tst_QPrinter::changingOutputFormat() { +#if QT_VERSION < 0x050000 QPrinter p; p.setOutputFormat(QPrinter::PostScriptFormat); p.setPageSize(QPrinter::A8); p.setOutputFormat(QPrinter::PdfFormat); QCOMPARE(p.pageSize(), QPrinter::A8); +#endif } void tst_QPrinter::outputFormatFromSuffix() @@ -546,8 +548,6 @@ void tst_QPrinter::outputFormatFromSuffix() QSKIP("No printers available.", SkipAll); QPrinter p; QVERIFY(p.outputFormat() == QPrinter::NativeFormat); - p.setOutputFileName("test.ps"); - QVERIFY(p.outputFormat() == QPrinter::PostScriptFormat); p.setOutputFileName("test.pdf"); QVERIFY(p.outputFormat() == QPrinter::PdfFormat); p.setOutputFileName(QString()); @@ -647,7 +647,7 @@ void tst_QPrinter::testPageMargins() void tst_QPrinter::valuePreservation() { QPrinter::OutputFormat oldFormat = QPrinter::PdfFormat; - QPrinter::OutputFormat newFormat = QPrinter::PostScriptFormat; + QPrinter::OutputFormat newFormat = QPrinter::NativeFormat; // TODO: Correct? { QPrinter printer; diff --git a/tests/auto/qprinterinfo/qprinterinfo.pro b/tests/auto/qprinterinfo/qprinterinfo.pro index ade217faf3..1bf799d6ce 100644 --- a/tests/auto/qprinterinfo/qprinterinfo.pro +++ b/tests/auto/qprinterinfo/qprinterinfo.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qprinterinfo.cpp -QT += network +QT += printsupport network DEFINES += QT_USE_USING_NAMESPACE diff --git a/tests/auto/qprocess/testGuiProcess/main.cpp b/tests/auto/qprocess/testGuiProcess/main.cpp index 2c8f5f0e55..90d4d4a962 100644 --- a/tests/auto/qprocess/testGuiProcess/main.cpp +++ b/tests/auto/qprocess/testGuiProcess/main.cpp @@ -38,7 +38,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include <QtGui> +#include <QtWidgets/QApplication> +#include <QtWidgets/QLabel> #include <stdio.h> int main(int argc, char **argv) diff --git a/tests/auto/qprocess/testGuiProcess/testGuiProcess.pro b/tests/auto/qprocess/testGuiProcess/testGuiProcess.pro index 15a9e8e4e4..b26a583dee 100644 --- a/tests/auto/qprocess/testGuiProcess/testGuiProcess.pro +++ b/tests/auto/qprocess/testGuiProcess/testGuiProcess.pro @@ -1,4 +1,5 @@ SOURCES += main.cpp +QT += widgets CONFIG += console DESTDIR = ./ diff --git a/tests/auto/qprogressbar/qprogressbar.pro b/tests/auto/qprogressbar/qprogressbar.pro index 6f0d7728fe..70d8c9111f 100644 --- a/tests/auto/qprogressbar/qprogressbar.pro +++ b/tests/auto/qprogressbar/qprogressbar.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qprogressbar.cpp diff --git a/tests/auto/qprogressdialog/qprogressdialog.pro b/tests/auto/qprogressdialog/qprogressdialog.pro index 3a98d0b017..f3861e4cd3 100644 --- a/tests/auto/qprogressdialog/qprogressdialog.pro +++ b/tests/auto/qprogressdialog/qprogressdialog.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qprogressdialog.cpp diff --git a/tests/auto/qpushbutton/qpushbutton.pro b/tests/auto/qpushbutton/qpushbutton.pro index 0d5f9418e1..e2fd455951 100644 --- a/tests/auto/qpushbutton/qpushbutton.pro +++ b/tests/auto/qpushbutton/qpushbutton.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qpushbutton.cpp diff --git a/tests/auto/qradiobutton/qradiobutton.pro b/tests/auto/qradiobutton/qradiobutton.pro index 90e23ab2e0..82b2ff20a8 100644 --- a/tests/auto/qradiobutton/qradiobutton.pro +++ b/tests/auto/qradiobutton/qradiobutton.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qradiobutton.cpp diff --git a/tests/auto/qscrollarea/qscrollarea.pro b/tests/auto/qscrollarea/qscrollarea.pro index bcb2ff347c..5b2602bbdb 100644 --- a/tests/auto/qscrollarea/qscrollarea.pro +++ b/tests/auto/qscrollarea/qscrollarea.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qscrollarea.cpp diff --git a/tests/auto/qscrollbar/qscrollbar.pro b/tests/auto/qscrollbar/qscrollbar.pro index 40ce0cf6b8..75035dbcc2 100644 --- a/tests/auto/qscrollbar/qscrollbar.pro +++ b/tests/auto/qscrollbar/qscrollbar.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qscrollbar.cpp diff --git a/tests/auto/qscroller/qscroller.pro b/tests/auto/qscroller/qscroller.pro index 1c990dcb04..6daf0b30d3 100644 --- a/tests/auto/qscroller/qscroller.pro +++ b/tests/auto/qscroller/qscroller.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qscroller.cpp CONFIG += insignificant_test diff --git a/tests/auto/qsharedpointer_and_qwidget/qsharedpointer_and_qwidget.pro b/tests/auto/qsharedpointer_and_qwidget/qsharedpointer_and_qwidget.pro index db647a55c5..c947e7a246 100644 --- a/tests/auto/qsharedpointer_and_qwidget/qsharedpointer_and_qwidget.pro +++ b/tests/auto/qsharedpointer_and_qwidget/qsharedpointer_and_qwidget.pro @@ -1,3 +1,4 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qsharedpointer_and_qwidget.cpp DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/tests/auto/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp b/tests/auto/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp index 0bdf6c64cf..90b71c517c 100644 --- a/tests/auto/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp +++ b/tests/auto/qsharedpointer_and_qwidget/tst_qsharedpointer_and_qwidget.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include <QtGui/QWidget> -#include <QtGui/QPushButton> +#include <QtWidgets/QWidget> +#include <QtWidgets/QPushButton> #include <QtTest/QtTest> QT_BEGIN_NAMESPACE diff --git a/tests/auto/qshortcut/qshortcut.pro b/tests/auto/qshortcut/qshortcut.pro index 61e24b570a..3f68d2377e 100644 --- a/tests/auto/qshortcut/qshortcut.pro +++ b/tests/auto/qshortcut/qshortcut.pro @@ -4,6 +4,7 @@ load(qttest_p4) INCLUDEPATH += ../ # Normal Test Files -------------------------------------------------- +QT += widgets HEADERS += SOURCES += tst_qshortcut.cpp diff --git a/tests/auto/qsidebar/qsidebar.pro b/tests/auto/qsidebar/qsidebar.pro index 3ace4fe8a5..6487d201a4 100644 --- a/tests/auto/qsidebar/qsidebar.pro +++ b/tests/auto/qsidebar/qsidebar.pro @@ -1,6 +1,7 @@ CONFIG += qttest_p4 QT += core-private +QT += widgets widgets-private SOURCES += tst_qsidebar.cpp TARGET = tst_qsidebar diff --git a/tests/auto/qsidebar/tst_qsidebar.cpp b/tests/auto/qsidebar/tst_qsidebar.cpp index 1104a17654..4a7123567d 100644 --- a/tests/auto/qsidebar/tst_qsidebar.cpp +++ b/tests/auto/qsidebar/tst_qsidebar.cpp @@ -41,8 +41,8 @@ #include <QtTest/QtTest> -#include "../../../src/gui/dialogs/qsidebar_p.h" -#include "../../../src/gui/dialogs/qfilesystemmodel_p.h" +#include "../../../src/widgets/dialogs/qsidebar_p.h" +#include "../../../src/widgets/dialogs/qfilesystemmodel_p.h" //TESTED_CLASS= //TESTED_FILES= diff --git a/tests/auto/qsignalmapper/qsignalmapper.pro b/tests/auto/qsignalmapper/qsignalmapper.pro index 3215a5943d..5af4b70c63 100644 --- a/tests/auto/qsignalmapper/qsignalmapper.pro +++ b/tests/auto/qsignalmapper/qsignalmapper.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qsignalmapper.cpp diff --git a/tests/auto/qsizegrip/qsizegrip.pro b/tests/auto/qsizegrip/qsizegrip.pro index 7bc43d5283..da6dd5af49 100644 --- a/tests/auto/qsizegrip/qsizegrip.pro +++ b/tests/auto/qsizegrip/qsizegrip.pro @@ -1,5 +1,6 @@ load(qttest_p4) INCLUDEPATH += . +QT += widgets SOURCES += tst_qsizegrip.cpp diff --git a/tests/auto/qslider/qslider.pro b/tests/auto/qslider/qslider.pro index 32fcc81941..41f011649d 100644 --- a/tests/auto/qslider/qslider.pro +++ b/tests/auto/qslider/qslider.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qslider.cpp diff --git a/tests/auto/qsoftkeymanager/qsoftkeymanager.pro b/tests/auto/qsoftkeymanager/qsoftkeymanager.pro index 61ed4dcc8b..7032964629 100644 --- a/tests/auto/qsoftkeymanager/qsoftkeymanager.pro +++ b/tests/auto/qsoftkeymanager/qsoftkeymanager.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qsoftkeymanager.cpp requires(symbian) diff --git a/tests/auto/qspinbox/qspinbox.pro b/tests/auto/qspinbox/qspinbox.pro index a65554a087..56a58dadce 100644 --- a/tests/auto/qspinbox/qspinbox.pro +++ b/tests/auto/qspinbox/qspinbox.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qspinbox.cpp diff --git a/tests/auto/qsplitter/qsplitter.pro b/tests/auto/qsplitter/qsplitter.pro index bca4fc40fd..a0e6878aa9 100644 --- a/tests/auto/qsplitter/qsplitter.pro +++ b/tests/auto/qsplitter/qsplitter.pro @@ -1,7 +1,7 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qsplitter.cpp - wince*|symbian: { addFiles.files = extradata.txt setSizes3.dat addFiles.path = . diff --git a/tests/auto/qsql/tst_qsql.cpp b/tests/auto/qsql/tst_qsql.cpp index e8c6d14f5b..453eb44daa 100644 --- a/tests/auto/qsql/tst_qsql.cpp +++ b/tests/auto/qsql/tst_qsql.cpp @@ -41,7 +41,7 @@ #include <QtTest/QtTest> -#include <qapplication.h> +#include <qguiapplication.h> #include <qsqldatabase.h> #include <qsqlerror.h> #include <qsqlquery.h> @@ -117,7 +117,7 @@ void tst_QSql::cleanup() void tst_QSql::basicDriverTest() { int argc = 0; - QApplication app( argc, 0, false ); + QGuiApplication app( argc, 0, false ); tst_Databases dbs; dbs.open(); @@ -187,7 +187,7 @@ void tst_QSql::openInvalid() void tst_QSql::concurrentAccess() { int argc = 0; - QApplication app( argc, 0, false ); + QGuiApplication app( argc, 0, false ); tst_Databases dbs; dbs.open(); @@ -215,7 +215,7 @@ void tst_QSql::concurrentAccess() void tst_QSql::openErrorRecovery() { int argc = 0; - QApplication app( argc, 0, false ); + QGuiApplication app( argc, 0, false ); tst_Databases dbs; dbs.addDbs(); @@ -262,7 +262,7 @@ void tst_QSql::openErrorRecovery() void tst_QSql::registerSqlDriver() { int argc = 0; - QApplication app( argc, 0, false ); + QGuiApplication app( argc, 0, false ); QSqlDatabase::registerSqlDriver( "QSQLTESTDRIVER", new QSqlDriverCreator<QSqlNullDriver> ); QVERIFY( QSqlDatabase::drivers().contains( "QSQLTESTDRIVER" ) ); diff --git a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro index 4b23e94715..0664bae6e9 100644 --- a/tests/auto/qsqlquerymodel/qsqlquerymodel.pro +++ b/tests/auto/qsqlquerymodel/qsqlquerymodel.pro @@ -1,7 +1,7 @@ load(qttest_p4) SOURCES += tst_qsqlquerymodel.cpp -QT += sql +QT += widgets sql wince*: { DEPLOYMENT_PLUGIN += qsqlite diff --git a/tests/auto/qstackedlayout/qstackedlayout.pro b/tests/auto/qstackedlayout/qstackedlayout.pro index 1fbf5d33db..30f074d9b1 100644 --- a/tests/auto/qstackedlayout/qstackedlayout.pro +++ b/tests/auto/qstackedlayout/qstackedlayout.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qstackedlayout.cpp diff --git a/tests/auto/qstackedwidget/qstackedwidget.pro b/tests/auto/qstackedwidget/qstackedwidget.pro index b0ddc33077..c9436c6a86 100644 --- a/tests/auto/qstackedwidget/qstackedwidget.pro +++ b/tests/auto/qstackedwidget/qstackedwidget.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qstackedwidget.cpp diff --git a/tests/auto/qstandarditem/qstandarditem.pro b/tests/auto/qstandarditem/qstandarditem.pro index 9f22729a7d..1d280fc2f5 100644 --- a/tests/auto/qstandarditem/qstandarditem.pro +++ b/tests/auto/qstandarditem/qstandarditem.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qstandarditem.cpp diff --git a/tests/auto/qstandarditemmodel/qstandarditemmodel.pro b/tests/auto/qstandarditemmodel/qstandarditemmodel.pro index 0fc47b3624..8c634b9630 100644 --- a/tests/auto/qstandarditemmodel/qstandarditemmodel.pro +++ b/tests/auto/qstandarditemmodel/qstandarditemmodel.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qstandarditemmodel.cpp diff --git a/tests/auto/qstatemachine/qstatemachine.pro b/tests/auto/qstatemachine/qstatemachine.pro index ab71202f18..9d057eb05f 100644 --- a/tests/auto/qstatemachine/qstatemachine.pro +++ b/tests/auto/qstatemachine/qstatemachine.pro @@ -1,4 +1,5 @@ load(qttest_p4) -QT = core core-private gui +QT += widgets +QT += core core-private gui widgets SOURCES += tst_qstatemachine.cpp diff --git a/tests/auto/qstatemachine/tst_qstatemachine.cpp b/tests/auto/qstatemachine/tst_qstatemachine.cpp index 854e81fb81..08181c17de 100644 --- a/tests/auto/qstatemachine/tst_qstatemachine.cpp +++ b/tests/auto/qstatemachine/tst_qstatemachine.cpp @@ -41,10 +41,10 @@ #include <QtTest/QtTest> #include <QtCore/QCoreApplication> -#include <QtGui/QPushButton> -#include <QtGui/QGraphicsScene> -#include <QtGui/QGraphicsSceneEvent> -#include <QtGui/QGraphicsTextItem> +#include <QtWidgets/QPushButton> +#include <QtWidgets/QGraphicsScene> +#include <QtWidgets/QGraphicsSceneEvent> +#include <QtWidgets/QGraphicsTextItem> #include "qstatemachine.h" #include "qstate.h" diff --git a/tests/auto/qstatictext/qstatictext.pro b/tests/auto/qstatictext/qstatictext.pro index 0c16c4c149..c8c36f81f7 100644 --- a/tests/auto/qstatictext/qstatictext.pro +++ b/tests/auto/qstatictext/qstatictext.pro @@ -1,4 +1,5 @@ load(qttest_p4) -QT = core core-private gui gui-private +QT += widgets widgets-private +QT += core core-private gui gui-private SOURCES += tst_qstatictext.cpp diff --git a/tests/auto/qstatictext/tst_qstatictext.cpp b/tests/auto/qstatictext/tst_qstatictext.cpp index 5d5ed3c737..08069132de 100644 --- a/tests/auto/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/qstatictext/tst_qstatictext.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtTest/QtTest> -#include <QtGui/QApplication> +#include <QtWidgets/QApplication> #include <QtGui/QPainter> #include <QtGui/QImage> diff --git a/tests/auto/qstatusbar/qstatusbar.pro b/tests/auto/qstatusbar/qstatusbar.pro index 6c79001af1..51ec0e9cdb 100644 --- a/tests/auto/qstatusbar/qstatusbar.pro +++ b/tests/auto/qstatusbar/qstatusbar.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qstatusbar.cpp diff --git a/tests/auto/qstringlistmodel/qstringlistmodel.pro b/tests/auto/qstringlistmodel/qstringlistmodel.pro index 9a71d9fc64..fe70ed7345 100644 --- a/tests/auto/qstringlistmodel/qstringlistmodel.pro +++ b/tests/auto/qstringlistmodel/qstringlistmodel.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets HEADERS += qmodellistener.h SOURCES += tst_qstringlistmodel.cpp diff --git a/tests/auto/qstyle/qstyle.pro b/tests/auto/qstyle/qstyle.pro index eb198e28f5..5c949fa56a 100644 --- a/tests/auto/qstyle/qstyle.pro +++ b/tests/auto/qstyle/qstyle.pro @@ -1,5 +1,6 @@ load(qttest_p4) TARGET.EPOCHEAPSIZE = 0x200000 0x800000 +QT += widgets SOURCES += tst_qstyle.cpp wince*|symbian: { diff --git a/tests/auto/qstyleoption/qstyleoption.pro b/tests/auto/qstyleoption/qstyleoption.pro index 523d9b3946..ccbb39d55b 100644 --- a/tests/auto/qstyleoption/qstyleoption.pro +++ b/tests/auto/qstyleoption/qstyleoption.pro @@ -4,7 +4,7 @@ load(qttest_p4) TEMPLATE = app - +QT += widgets # Input SOURCES += tst_qstyleoption.cpp diff --git a/tests/auto/qstylesheetstyle/qstylesheetstyle.pro b/tests/auto/qstylesheetstyle/qstylesheetstyle.pro index 1575616b19..9dc296a51c 100644 --- a/tests/auto/qstylesheetstyle/qstylesheetstyle.pro +++ b/tests/auto/qstylesheetstyle/qstylesheetstyle.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets widgets-private QT += gui-private # Input SOURCES += tst_qstylesheetstyle.cpp diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp index a8dfea99d0..92b8812733 100644 --- a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -542,7 +542,6 @@ void tst_QStyleSheetStyle::dynamicProperty() } #ifdef Q_OS_MAC -#include <QtGui/QMacStyle> void tst_QStyleSheetStyle::layoutSpacing() { qApp->setStyleSheet("* { color: red }"); diff --git a/tests/auto/qsystemtrayicon/qsystemtrayicon.pro b/tests/auto/qsystemtrayicon/qsystemtrayicon.pro index a77b4788a1..8a6ea3d0a9 100644 --- a/tests/auto/qsystemtrayicon/qsystemtrayicon.pro +++ b/tests/auto/qsystemtrayicon/qsystemtrayicon.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qsystemtrayicon.cpp diff --git a/tests/auto/qtabbar/qtabbar.pro b/tests/auto/qtabbar/qtabbar.pro index 15aa11d9fa..befe5704ba 100644 --- a/tests/auto/qtabbar/qtabbar.pro +++ b/tests/auto/qtabbar/qtabbar.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtabbar.cpp diff --git a/tests/auto/qtableview/qtableview.pro b/tests/auto/qtableview/qtableview.pro index 0a2b5171ad..f710fe3773 100644 --- a/tests/auto/qtableview/qtableview.pro +++ b/tests/auto/qtableview/qtableview.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private TARGET.EPOCHEAPSIZE = 0x200000 0x800000 diff --git a/tests/auto/qtablewidget/qtablewidget.pro b/tests/auto/qtablewidget/qtablewidget.pro index d66d0ac67f..0f09203fd1 100644 --- a/tests/auto/qtablewidget/qtablewidget.pro +++ b/tests/auto/qtablewidget/qtablewidget.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtablewidget.cpp # This prevents the GCCE compile failure: "elf2e32: Error 1063: Fatal Error in diff --git a/tests/auto/qtabwidget/qtabwidget.pro b/tests/auto/qtabwidget/qtabwidget.pro index fb0960e3d7..d551c66500 100644 --- a/tests/auto/qtabwidget/qtabwidget.pro +++ b/tests/auto/qtabwidget/qtabwidget.pro @@ -1,6 +1,6 @@ load(qttest_p4) -QT += gui-private +QT += widgets widgets-private INCLUDEPATH += ../ diff --git a/tests/auto/qtabwidget/tst_qtabwidget.cpp b/tests/auto/qtabwidget/tst_qtabwidget.cpp index cf25bfadc8..3db105d3fe 100644 --- a/tests/auto/qtabwidget/tst_qtabwidget.cpp +++ b/tests/auto/qtabwidget/tst_qtabwidget.cpp @@ -45,7 +45,7 @@ #include <qdebug.h> #include <qapplication.h> #include <qlabel.h> -#include <QtGui/qboxlayout.h> +#include <QtWidgets/qboxlayout.h> //TESTED_CLASS= //TESTED_FILES= diff --git a/tests/auto/qtcpsocket/test/test.pro b/tests/auto/qtcpsocket/test/test.pro index 6ac2da653c..61bfaad1a1 100644 --- a/tests/auto/qtcpsocket/test/test.pro +++ b/tests/auto/qtcpsocket/test/test.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets QT += core-private network-private SOURCES += ../tst_qtcpsocket.cpp win32: { diff --git a/tests/auto/qtessellator/.gitignore b/tests/auto/qtessellator/.gitignore deleted file mode 100644 index 99f21607d8..0000000000 --- a/tests/auto/qtessellator/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tst_qtessellator diff --git a/tests/auto/qtessellator/XrenderFake.h b/tests/auto/qtessellator/XrenderFake.h deleted file mode 100644 index adc6feb28b..0000000000 --- a/tests/auto/qtessellator/XrenderFake.h +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -/** - These are just defines we need to compile this across platforms -**/ -/* - * - * Copyright © 2000 SuSE, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of SuSE not be used in advertising or - * publicity pertaining to distribution of the software without specific, - * written prior permission. SuSE makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Keith Packard, SuSE, Inc. - */ - -#ifndef _XRENDER_FAKE_H_ -#define _XRENDER_FAKE_H_ - -#ifndef _XRENDER_H_ -typedef double XDouble; - -typedef struct _XPointDouble { - XDouble x, y; -} XPointDouble; - -#define XDoubleToFixed(f) ((XFixed) ((f) * 65536)) -#define XFixedToDouble(f) (((XDouble) (f)) / 65536) - -typedef int XFixed; - -typedef struct _XPointFixed { - XFixed x, y; -} XPointFixed; - -typedef struct _XLineFixed { - XPointFixed p1, p2; -} XLineFixed; - -typedef struct _XTriangle { - XPointFixed p1, p2, p3; -} XTriangle; - -typedef struct _XTrapezoid { - XFixed top, bottom; - XLineFixed left, right; -} XTrapezoid; - -typedef struct _XSpanFix { - XFixed left, right, y; -} XSpanFix; - -typedef struct _XTrap { - XSpanFix top, bottom; -} XTrap; - -#endif - -#endif /* _XRENDER_H_ */ diff --git a/tests/auto/qtessellator/arc.data b/tests/auto/qtessellator/arc.data deleted file mode 100644 index f541372f10..0000000000 --- a/tests/auto/qtessellator/arc.data +++ /dev/null @@ -1,2 +0,0 @@ -330.399757,524.281800, 478.120912,550.329025, 477.831298,550.531815, 478.810211,541.885349, 478.599541,533.099490, 478.834287,533.328092, 330.341973,524.777589, 330.399757,524.281800, 330.370717,524.278415, 478.863031,532.828919, 479.097777,533.057521, 479.308667,541.907694, 478.323702,550.618639, 478.034088,550.821429, 330.312933,524.774204, 330.370717,524.278415, 330.399757,524.281800, 330.340478,524.278506, 475.092081,515.072484, 474.871052,515.401854, 472.271033,508.556408, 469.166670,501.975570, 465.531259,495.623207, 461.338095,489.463185, 456.560474,483.459373, 451.171691,477.575636, 438.453817,466.023860, 438.731065,466.049958, 330.475509,524.747774, 330.340478,524.278506, 330.399757,524.281800, 330.237181,524.308229, 438.492737,465.610413, 438.769984,465.636512, 451.529578,477.230250, 456.941391,483.142024, 461.742023,489.176805, 465.957079,495.369400, 469.612164,501.754612, 472.732885,508.367246, 475.344846,515.242105, 475.123817,515.571476, 330.372213,524.777498, 330.237181,524.308229, 330.399757,524.281800, 330.198654,524.334009, 419.097609,452.070769, 419.126347,452.478938, 406.609897,445.517586, 393.734425,439.489615, 380.499126,434.394819, 366.903191,430.232997, 352.945816,427.003943, 338.626193,424.707455, 323.943517,423.343328, 308.896980,422.911359, 309.141051,422.609824, 330.600976,524.476466, 330.198654,524.334009, 330.399757,524.281800, 330.111715,524.579537, 308.651790,422.712895, 308.895862,422.411361, 323.970137,422.844875, 338.685103,424.213480, 353.039954,426.516970, 367.033883,429.755143, 380.666084,433.927795, 393.935751,439.034722, 406.842076,445.075720, 419.384253,452.050587, 419.412991,452.458756, 330.514037,524.721995, 330.111715,524.579537, 330.399757,524.281800, 330.129715,524.633543, 283.437924,424.371616, 283.696186,424.514066, 274.149920,425.955307, 264.995958,427.789229, 256.246650,430.007574, 247.914348,432.602085, 240.011405,435.564508, 232.550171,438.886583, 225.542998,442.560055, 219.002238,446.576668, 212.940243,450.928163, 207.369363,455.606286, 202.301952,460.602778, 197.750359,465.909384, 193.726937,471.517846, 190.244038,477.419909, 187.314013,483.607314, 184.949214,490.071807, 184.768427,489.753472, 330.414019,524.284745, 330.129715,524.633543, 330.399757,524.281800, 330.298671,524.771258, 184.653079,490.239985, 184.472293,489.921650, 186.849209,483.425660, 189.795371,477.207106, 193.297958,471.274452, 197.344150,465.636164, 201.921125,460.300704, 207.016064,455.276537, 212.616146,450.572127, 218.708551,446.195939, 225.280457,442.156435, 232.319044,438.462081, 239.811492,435.121341, 247.744980,432.142678, 256.106687,429.534556, 264.883794,427.305441, 274.063479,425.463796, 283.632922,424.018084, 283.891183,424.160534, 330.582975,524.422461, 330.298671,524.771258, 330.399757,524.281800, 330.602547,524.571414, 313.237730,623.052184, 312.948116,623.254974, 297.919322,620.079380, 283.498874,615.993956, 269.752665,611.061508, 256.746589,605.344843, 244.546537,598.906766, 233.218404,591.810084, 222.828081,584.117603, 213.441462,575.892130, 205.124439,567.196470, 197.942906,558.093430, 191.962756,548.645817, 187.249880,538.916436, 183.870173,528.968094, 181.889527,518.863598, 181.373834,508.665752, 182.388989,498.437365, 182.678603,498.234575, 330.399757,524.281800, 330.602547,524.571414, 330.399757,524.281800, 473.399671,549.750400, 470.969436,559.210379, 467.157740,568.141238, 462.045076,576.508539, 455.711937,584.277845, 448.238814,591.414720, 439.706200,597.884727, 430.194588,603.653429, 419.784468,608.686389, 408.556335,612.949170, 396.590680,616.407336, 383.967995,619.026449, 370.768773,620.772073, 357.073506,621.609771, 342.962685,621.505106, 328.516805,620.423642, 313.816356,618.330940, 299.286707,615.269587, 285.342137,611.345049, 272.046506,606.617217, 259.463674,601.145981, 247.657501,594.991231, 236.691847,588.212857, 226.630571,580.870749, 217.537534,573.024797, 209.476596,564.734892, 202.511616,556.060922, 196.706454,547.062779, 192.124971,537.800351, 188.831026,528.333530, 186.888479,518.722205, 186.361190,509.026267, 187.313019,499.305604, 189.743255,489.845625, 193.554950,480.914766, 198.667614,472.547465, 205.000754,464.778159, 212.473876,457.641284, 221.006490,451.171277, 230.518103,445.402575, 240.928222,440.369615, 252.156355,436.106834, 264.122010,432.648668, 276.744695,430.029555, 289.943918,428.283931, 303.639185,427.446233, 317.750005,427.550898, 332.195885,428.632362, 346.896334,430.725063, 361.425983,433.786417, 375.370553,437.710955, 388.666184,442.438787, 401.249016,447.910023, 413.055189,454.064773, 424.020844,460.843147, 434.082119,468.185255, 443.175156,476.031206, 451.236095,484.321112, 458.201075,492.995082, 464.006236,501.993225, 468.587719,511.255653, 471.881665,520.722474, 473.824212,530.333799, 474.351500,540.029737, 473.399671,549.750400, 330.399757,524.281800, 472.907267,549.663576, 473.854306,539.992980, 473.329738,530.347191, 471.396677,520.785684, 468.118232,511.367936, 463.557515,502.153423, 457.777638,493.201621, 450.841711,484.572006, 442.812847,476.324055, 433.754155,468.517243, 423.728748,461.211047, 412.799737,454.464943, 401.030232,448.338407, 388.483346,442.890916, 375.222190,438.181944, 361.309874,434.270969, 346.809510,431.217467, 332.139266,429.127404, 317.728333,428.044226, 303.656359,427.933629, 290.002991,428.761309, 276.847876,430.492962, 264.270661,433.094284, 252.350994,436.530972, 241.168522,440.768720, 230.802891,445.773225, 221.333750,451.510184, 212.840745,457.945292, 205.403525,465.044245, 199.101735,472.772739, 194.015023,481.096470, 190.223037,489.981135, 187.805423,499.392428, 186.858385,509.063024, 187.382952,518.708813, 189.316014,528.270320, 192.594458,537.688068, 197.155175,546.902581, 202.935052,555.854383, 209.870979,564.483998, 217.899844,572.731949, 226.958535,580.538761, 236.983942,587.844957, 247.912954,594.591061, 259.682458,600.717597, 272.229344,606.165088, 285.490501,610.874060, 299.402817,614.785034, 313.903180,617.838537, 328.573424,619.928600, 342.984357,621.011778, 357.056331,621.122375, 370.709699,620.294695, 383.864814,618.563042, 396.442029,615.961720, 408.361696,612.525032, 419.544169,608.287284, 429.909799,603.282779, 439.378940,597.545820, 447.871945,591.110712, 455.309166,584.011759, 461.610956,576.283265, 466.697667,567.959534, 470.489654,559.074869, 472.907267,549.663576, 330.399757,524.281800, 330.454707,524.298165, 454.667822,577.456961, 454.762318,577.845876, 445.497902,587.443966, 440.285366,591.692799, 434.641502,595.603281, 421.926464,602.494557, 407.086134,608.288530, 406.823265,608.220270, 330.172154,524.697039, 330.454707,524.298165, 330.399757,524.281800, 330.540537,524.358965, 407.191648,607.882196, 406.928779,607.813936, 421.715525,602.044127, 434.366600,595.191446, 439.978360,591.303580, 445.160720,587.078457, 454.376603,577.527719, 454.471098,577.916634, 330.257983,524.757839, 330.540537,524.358965, 330.399757,524.281800, 330.568526,524.395792, 385.970533,613.309333, 385.803321,613.687465, 372.603353,615.647129, 359.376368,616.703732, 346.123165,616.857358, 332.844541,616.108092, 319.541292,614.456018, 306.214217,611.901220, 292.864113,608.443782, 279.491776,604.083789, 279.365802,603.713738, 330.145795,524.393211, 330.568526,524.395792, 330.399757,524.281800, 330.566895,524.662793, 279.786902,603.983321, 279.660927,603.613270, 293.007562,607.965618, 306.326866,611.416496, 319.619636,613.965989, 332.886669,615.614181, 346.128763,616.361156, 359.346715,616.206998, 372.541322,615.151791, 385.713383,613.195620, 385.546171,613.573752, 330.144165,524.660212, 330.566895,524.662793, 330.399757,524.281800, 330.312933,524.774204, 182.591778,498.726979, 182.881392,498.524189, 181.870979,508.702932, 182.383959,518.850950, 184.355179,528.905860, 187.719481,538.805277, 192.411711,548.486821, 198.366713,557.888107, 205.519330,566.946753, 213.804409,575.600375, 223.156792,583.786592, 233.511325,591.443019, 244.802851,598.507275, 256.966215,604.916975, 269.936262,610.609738, 283.647836,615.523180, 298.035780,619.594918, 313.034940,622.762570, 312.745326,622.965360, 330.110143,524.484590, 330.312933,524.774204, 330.399757,524.281800, - diff --git a/tests/auto/qtessellator/arc.h b/tests/auto/qtessellator/arc.h deleted file mode 100644 index 43492bbef6..0000000000 --- a/tests/auto/qtessellator/arc.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef ARC_H -#define ARC_H - -#include "sample_data.h" - -FullData arcData(); - -#endif diff --git a/tests/auto/qtessellator/datafiles.qrc b/tests/auto/qtessellator/datafiles.qrc deleted file mode 100644 index bb0ed3766d..0000000000 --- a/tests/auto/qtessellator/datafiles.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource prefix="/"> - <file>simple.data</file> - <file>arc.data</file> -</qresource> -</RCC> diff --git a/tests/auto/qtessellator/dataparser.cpp b/tests/auto/qtessellator/dataparser.cpp deleted file mode 100644 index 8ad7ae881f..0000000000 --- a/tests/auto/qtessellator/dataparser.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "dataparser.h" -#include <QString> -#include <QVector> -#include <QFile> -#include <QTextStream> - -#include <QtDebug> - -static QList<qreal> parseNumbersList(QByteArray::const_iterator &itr) -{ - QList<qreal> points; - QByteArray temp; - while ((*itr) == ' ') - ++itr; - while (((*itr) >= '0' && (*itr) <= '9') || - (*itr) == '-' || (*itr) == '+') { - temp = QByteArray(); - - if ((*itr) == '-') - temp += *itr++; - else if ((*itr) == '+') - temp += *itr++; - while ((*itr) >= '0' && (*itr) <= '9') - temp += *itr++; - if ((*itr) == '.') - temp += *itr++; - while ((*itr) >= '0' && (*itr) <= '9') - temp += *itr++; - if (( *itr) == 'e') { - temp += *itr++; - if ((*itr) == '-' || - (*itr) == '+') - temp += *itr++; - } - while ((*itr) >= '0' && (*itr) <= '9') - temp += *itr++; - while ((*itr) == ' ') - ++itr; - if ((*itr) == ',') - ++itr; - points.append(temp.toDouble()); - //eat the rest of space - while ((*itr) == ' ') - ++itr; - } - - return points; -} - -static QList<QPointF> parsePoints(const QByteArray &line) -{ - QList<QPointF> res; - - QByteArray::const_iterator it = line.constBegin(); - if (*it == ',') - ++it; - - QList<qreal> nums = parseNumbersList(it); - QList<qreal>::const_iterator nitr; - for (nitr = nums.begin(); nitr != nums.end(); ++nitr) { - qreal x = *nitr; - ++nitr; - if (nitr == nums.end()) { - qWarning() << "parsePoints: Even number of co-ordinates required, odd number found: skipping last point"; - break; - } - qreal y = *nitr; - res.append(QPointF(x, y)); - } - - return res; -} - -QList< QVector<QPointF> > parseData(const QByteArray &contents) -{ - QList<QByteArray> lines = contents.split('\n'); - QList<QByteArray>::const_iterator itr; - - QList< QVector<QPointF> > res; - QVector<QPointF> current; - - for (itr = lines.begin(); itr != lines.end(); ++itr) { - QByteArray line = (*itr).trimmed(); - if (line.isEmpty() || line.startsWith('/')) { - if (!current.isEmpty()) { - res.append(current); - current = QVector<QPointF>(); - } - continue; - } else { - QList<QPointF> lst = parsePoints(line); - current << lst.toVector(); - } - } - return res; -} - -QList< QVector<QPointF> > parseFile(const QString &fileName) -{ - QList< QVector<QPointF> > res; - QFile file(fileName); - - if (!file.open(QIODevice::ReadOnly)) { - qDebug()<<"couldn't open "<<fileName; - return res; - } - - QVector<QPointF> current; - - while (!file.atEnd()) { - QByteArray line = file.readLine().trimmed(); - if (line.isEmpty() || line.startsWith('/')) { - if (!current.isEmpty()) { - res.append(current); - current = QVector<QPointF>(); - } - continue; - } else { - QList<QPointF> lst = parsePoints(line); - current << lst.toVector(); - } - } - - return res; -} diff --git a/tests/auto/qtessellator/dataparser.h b/tests/auto/qtessellator/dataparser.h deleted file mode 100644 index 33b920ee73..0000000000 --- a/tests/auto/qtessellator/dataparser.h +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef DATAPARSER_H -#define DATAPARSER_H - -#include <QList> -#include <QVector> -#include <QPointF> - -QList< QVector<QPointF> > parseData(const QByteArray &contents); -QList< QVector<QPointF> > parseFile(const QString &fileName); - -#endif diff --git a/tests/auto/qtessellator/oldtessellator.cpp b/tests/auto/qtessellator/oldtessellator.cpp deleted file mode 100644 index fd39d20d94..0000000000 --- a/tests/auto/qtessellator/oldtessellator.cpp +++ /dev/null @@ -1,435 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "oldtessellator.h" -#include <QPointF> -#include <QVector> -#include <QList> -#include <QVariant> -#include <QVarLengthArray> -#include <qdebug.h> - -#include "limits.h" -#include "utils.h" - -#include "qnum.h" -#include "XrenderFake.h" - -/* - * Polygon tesselator - can probably be optimized a bit more - */ - -//#define QT_DEBUG_TESSELATOR -#define FloatToXFixed(i) (int)((i) * 65536) -#define IntToXFixed(i) ((i) << 16) - -//inline int qrealToXFixed(qreal f) -//{ return f << 8; } - -struct QEdge { - inline QEdge() - {} - inline QEdge(const QPointF &pt1, - const QPointF &pt2) - { - p1.x = XDoubleToFixed(pt1.x()); - p1.y = XDoubleToFixed(pt1.y()); - p2.x = XDoubleToFixed(pt2.x()); - p2.y = XDoubleToFixed(pt2.y()); - m = (pt1.x() - pt2.x()) ? (pt1.y() - pt2.y()) / (pt1.x() - pt2.x()) : 0; - im = m ? 1/m : 0; - b = pt1.y() - m * pt1.x(); - vertical = p1.x == p2.x; - horizontal = p1.y == p2.y; - } - - QPointF pf1, pf2; - XPointFixed p1, p2; - qreal m; - qreal im; - qreal b; - qreal intersection; - signed short winding; - bool vertical; - bool horizontal; -}; - -struct QVrtx { - typedef QList<QEdge> Edges; - XPointFixed coords; - Edges startingEdges; - Edges endingEdges; - Edges intersectingEdges; -}; - -struct QIntersectionPoint { - qreal x; - const QEdge *edge; -}; - -QT_BEGIN_NAMESPACE -Q_DECLARE_TYPEINFO(QEdge, Q_PRIMITIVE_TYPE); -Q_DECLARE_TYPEINFO(QVrtx, Q_PRIMITIVE_TYPE); -Q_DECLARE_TYPEINFO(QIntersectionPoint, Q_PRIMITIVE_TYPE); -QT_END_NAMESPACE - - -// used by the edge point sort algorithm -static qreal currentY = 0.f; - -static inline bool compareEdges(const QEdge *e1, const QEdge *e2) -{ - return e1->p1.y < e2->p1.y; -} - -static inline bool isEqual(const XPointFixed &p1, const XPointFixed &p2) -{ - return ((p1.x == p2.x) && (p1.y == p2.y)); -} - -static inline bool compareIntersections(const QIntersectionPoint &i1, const QIntersectionPoint &i2) -{ - if (qAbs(i1.x - i2.x) > 0.01) { // x != other.x in 99% of the cases - return i1.x < i2.x; - } else { - qreal x1 = (i1.edge->p1.x != i1.edge->p2.x) ? - ((currentY+1 - i1.edge->b)*i1.edge->m) : XFixedToDouble(i1.edge->p1.x); - qreal x2 = (i2.edge->p1.x != i2.edge->p2.x) ? - ((currentY+1 - i2.edge->b)*i2.edge->m) : XFixedToDouble(i2.edge->p1.x); -// qDebug() << ">>>" << currentY << i1.edge << i2.edge << x1 << x2; - return x1 < x2; - } -} - -#ifdef QT_USE_FIXED_POINT -inline int qrealToXFixed(qreal f) -{ return f.value() << 8; } -#else -#define qrealToXFixed FloatToXFixed -#endif - -static XTrapezoid QT_FASTCALL toXTrapezoid(XFixed y1, XFixed y2, const QEdge &left, const QEdge &right) -{ - XTrapezoid trap; - trap.top = y1; - trap.bottom = y2; - trap.left.p1.y = left.p1.y; - trap.left.p2.y = left.p2.y; - trap.right.p1.y = right.p1.y; - trap.right.p2.y = right.p2.y; - trap.left.p1.x = left.p1.x; - trap.left.p2.x = left.p2.x; - trap.right.p1.x = right.p1.x; - trap.right.p2.x = right.p2.x; - return trap; -} - -#ifdef QT_DEBUG_TESSELATOR -static void dump_edges(const QList<const QEdge *> &et) -{ - for (int x = 0; x < et.size(); ++x) { - qDebug() << "edge#" << x << et.at(x) << "(" - << XFixedToDouble(et.at(x)->p1.x) - << XFixedToDouble(et.at(x)->p1.y) - << ") (" - << XFixedToDouble(et.at(x)->p2.x) - << XFixedToDouble(et.at(x)->p2.y) - << ") b: " << et.at(x)->b << "m:" << et.at(x)->m; - } -} - -static void dump_trap(const XTrapezoid &t) -{ - qDebug() << "trap# t=" << t.top/65536.0 << "b=" << t.bottom/65536.0 << "h=" - << XFixedToDouble(t.bottom - t.top) << "\tleft p1: (" - << XFixedToDouble(t.left.p1.x) << ","<< XFixedToDouble(t.left.p1.y) - << ")" << "\tleft p2: (" << XFixedToDouble(t.left.p2.x) << "," - << XFixedToDouble(t.left.p2.y) << ")" << "\n\t\t\t\tright p1:(" - << XFixedToDouble(t.right.p1.x) << "," << XFixedToDouble(t.right.p1.y) << ")" - << "\tright p2:(" << XFixedToDouble(t.right.p2.x) << "," - << XFixedToDouble(t.right.p2.y) << ")"; -} -#endif - - -typedef int Q27Dot5; -#define Q27Dot5ToDouble(i) (i/32.) -#define FloatToQ27Dot5(i) (int)((i) * 32) -#define IntToQ27Dot5(i) ((i) << 5) -#define Q27Dot5ToXFixed(i) ((i) << 11) -#define Q27Dot5Factor 32 - -void old_tesselate_polygon(QVector<XTrapezoid> *traps, const QPointF *pg, int pgSize, - bool winding) -{ - QVector<QEdge> edges; - edges.reserve(128); - qreal ymin(INT_MAX/256); - qreal ymax(INT_MIN/256); - - //painter.begin(pg, pgSize); - if (pg[0] != pg[pgSize-1]) - qWarning() << Q_FUNC_INFO << "Malformed polygon (first and last points must be identical)"; - // generate edge table -// qDebug() << "POINTS:"; - for (int x = 0; x < pgSize-1; ++x) { - QEdge edge; - QPointF p1(Q27Dot5ToDouble(FloatToQ27Dot5(pg[x].x())), - Q27Dot5ToDouble(FloatToQ27Dot5(pg[x].y()))); - QPointF p2(Q27Dot5ToDouble(FloatToQ27Dot5(pg[x+1].x())), - Q27Dot5ToDouble(FloatToQ27Dot5(pg[x+1].y()))); - -// qDebug() << " " -// << p1; - edge.winding = p1.y() > p2.y() ? 1 : -1; - if (edge.winding > 0) - qSwap(p1, p2); - edge.p1.x = XDoubleToFixed(p1.x()); - edge.p1.y = XDoubleToFixed(p1.y()); - edge.p2.x = XDoubleToFixed(p2.x()); - edge.p2.y = XDoubleToFixed(p2.y()); - - edge.m = (p1.y() - p2.y()) / (p1.x() - p2.x()); // line derivative - edge.b = p1.y() - edge.m * p1.x(); // intersection with y axis - edge.m = edge.m != 0.0 ? 1.0 / edge.m : 0.0; // inverted derivative - edges.append(edge); - ymin = qMin(ymin, qreal(XFixedToDouble(edge.p1.y))); - ymax = qMax(ymax, qreal(XFixedToDouble(edge.p2.y))); - } - - QList<const QEdge *> et; // edge list - for (int i = 0; i < edges.size(); ++i) - et.append(&edges.at(i)); - - // sort edge table by min y value - qSort(et.begin(), et.end(), compareEdges); - - // eliminate shared edges - for (int i = 0; i < et.size(); ++i) { - for (int k = i+1; k < et.size(); ++k) { - const QEdge *edgeI = et.at(i); - const QEdge *edgeK = et.at(k); - if (edgeK->p1.y > edgeI->p1.y) - break; - if (edgeI->winding != edgeK->winding && - isEqual(edgeI->p1, edgeK->p1) && isEqual(edgeI->p2, edgeK->p2) - ) { - et.removeAt(k); - et.removeAt(i); - --i; - break; - } - } - } - - if (ymax <= ymin) - return; - QList<const QEdge *> aet; // edges that intersects the current scanline - -// if (ymin < 0) -// ymin = 0; -// if (paintEventClipRegion) // don't scan more lines than we have to -// ymax = paintEventClipRegion->boundingRect().height(); - -#ifdef QT_DEBUG_TESSELATOR - qDebug("==> ymin = %f, ymax = %f", ymin, ymax); -#endif // QT_DEBUG_TESSELATOR - - currentY = ymin; // used by the less than op - for (qreal y = ymin; y < ymax;) { - // fill active edge table with edges that intersect the current line - for (int i = 0; i < et.size(); ++i) { - const QEdge *edge = et.at(i); - if (edge->p1.y > XDoubleToFixed(y)) - break; - aet.append(edge); - et.removeAt(i); - --i; - } - - // remove processed edges from active edge table - for (int i = 0; i < aet.size(); ++i) { - if (aet.at(i)->p2.y <= XDoubleToFixed(y)) { - aet.removeAt(i); - --i; - } - } - if (aet.size()%2 != 0) { -#ifndef QT_NO_DEBUG - qWarning("QX11PaintEngine: aet out of sync - this should not happen."); -#endif - return; - } - - // done? - if (!aet.size()) { - if (!et.size()) { - break; - } else { - y = currentY = XFixedToDouble(et.at(0)->p1.y); - continue; - } - } - - // calculate the next y where we have to start a new set of trapezoids - qreal next_y(INT_MAX/256); - for (int i = 0; i < aet.size(); ++i) { - const QEdge *edge = aet.at(i); - if (XFixedToDouble(edge->p2.y) < next_y) - next_y = XFixedToDouble(edge->p2.y); - } - - if (et.size() && next_y > XFixedToDouble(et.at(0)->p1.y)) - next_y = XFixedToDouble(et.at(0)->p1.y); - - int aetSize = aet.size(); - for (int i = 0; i < aetSize; ++i) { - for (int k = i+1; k < aetSize; ++k) { - const QEdge *edgeI = aet.at(i); - const QEdge *edgeK = aet.at(k); - qreal m1 = edgeI->m; - qreal b1 = edgeI->b; - qreal m2 = edgeK->m; - qreal b2 = edgeK->b; - - if (qAbs(m1 - m2) < 0.001) - continue; - - // ### intersect is not calculated correctly when optimized with -O2 (gcc) - volatile qreal intersect = 0; - if (!qIsFinite(b1)) - intersect = (1.f / m2) * XFixedToDouble(edgeI->p1.x) + b2; - else if (!qIsFinite(b2)) - intersect = (1.f / m1) * XFixedToDouble(edgeK->p1.x) + b1; - else - intersect = (b1*m1 - b2*m2) / (m1 - m2); - - if (intersect > y && intersect < next_y) - next_y = intersect; - } - } - - XFixed yf, next_yf; - yf = qrealToXFixed(y); - next_yf = qrealToXFixed(next_y); - - if (yf == next_yf) { - y = currentY = next_y; - continue; - } - -#ifdef QT_DEBUG_TESSELATOR - qDebug("###> y = %f, next_y = %f, %d active edges", y, next_y, aet.size()); - qDebug("===> edges"); - dump_edges(et); - qDebug("===> active edges"); - dump_edges(aet); -#endif - // calc intersection points - QVarLengthArray<QIntersectionPoint> isects(aet.size()+1); - for (int i = 0; i < isects.size()-1; ++i) { - const QEdge *edge = aet.at(i); - isects[i].x = (edge->p1.x != edge->p2.x) ? - ((y - edge->b)*edge->m) : XFixedToDouble(edge->p1.x); - isects[i].edge = edge; - } - - if (isects.size()%2 != 1) - qFatal("%s: number of intersection points must be odd", Q_FUNC_INFO); - - // sort intersection points - qSort(&isects[0], &isects[isects.size()-1], compareIntersections); -// qDebug() << "INTERSECTION_POINTS:"; -// for (int i = 0; i < isects.size(); ++i) -// qDebug() << isects[i].edge << isects[i].x; - - if (winding) { - // winding fill rule - for (int i = 0; i < isects.size()-1;) { - int winding = 0; - const QEdge *left = isects[i].edge; - const QEdge *right = 0; - winding += isects[i].edge->winding; - for (++i; i < isects.size()-1 && winding != 0; ++i) { - winding += isects[i].edge->winding; - right = isects[i].edge; - } - if (!left || !right) - break; - //painter.addTrapezoid(&toXTrapezoid(yf, next_yf, *left, *right)); - traps->append(toXTrapezoid(yf, next_yf, *left, *right)); - } - } else { - // odd-even fill rule - for (int i = 0; i < isects.size()-2; i += 2) { - //painter.addTrapezoid(&toXTrapezoid(yf, next_yf, *isects[i].edge, *isects[i+1].edge)); - traps->append(toXTrapezoid(yf, next_yf, *isects[i].edge, *isects[i+1].edge)); - } - } - y = currentY = next_y; - } - -#ifdef QT_DEBUG_TESSELATOR - qDebug("==> number of trapezoids: %d - edge table size: %d\n", traps->size(), et.size()); - - for (int i = 0; i < traps->size(); ++i) - dump_trap(traps->at(i)); -#endif - - // optimize by unifying trapezoids that share left/right lines - // and have a common top/bottom edge -// for (int i = 0; i < tps.size(); ++i) { -// for (int k = i+1; k < tps.size(); ++k) { -// if (i != k && tps.at(i).right == tps.at(k).right -// && tps.at(i).left == tps.at(k).left -// && (tps.at(i).top == tps.at(k).bottom -// || tps.at(i).bottom == tps.at(k).top)) -// { -// tps[i].bottom = tps.at(k).bottom; -// tps.removeAt(k); -// i = 0; -// break; -// } -// } -// } - //static int i = 0; - //QImage img = painter.end(); - //img.save(QString("res%1.png").arg(i++), "PNG"); -} diff --git a/tests/auto/qtessellator/oldtessellator.h b/tests/auto/qtessellator/oldtessellator.h deleted file mode 100644 index 2023dee16e..0000000000 --- a/tests/auto/qtessellator/oldtessellator.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef NEWTESSELATOR_H -#define NEWTESSELATOR_H - -#include <QVector> -#include <QPointF> -#include "XrenderFake.h" - -void old_tesselate_polygon(QVector<XTrapezoid> *traps, const QPointF *pg, int pgSize, - bool winding); - - -#endif diff --git a/tests/auto/qtessellator/qnum.h b/tests/auto/qtessellator/qnum.h deleted file mode 100644 index 4027bc6948..0000000000 --- a/tests/auto/qtessellator/qnum.h +++ /dev/null @@ -1,145 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef QNUM_H -#define QNUM_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "QtCore/qglobal.h" - -static const unsigned char qt_be_inf_bytes[] = { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }; -static const unsigned char qt_le_inf_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }; -static inline double qtInf() -{ - return *reinterpret_cast<const double *>(QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_inf_bytes : qt_le_inf_bytes); -} -#define Q_INFINITY (::qtInf()) - -// Signaling NAN -static const unsigned char qt_be_snan_bytes[] = { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 }; -static const unsigned char qt_le_snan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }; -static inline double qtSnan() -{ - return *reinterpret_cast<const double *>(QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_snan_bytes : qt_le_snan_bytes); -} -#define Q_SNAN (::qtSnan()) - -// Quiet NAN -static const unsigned char qt_be_qnan_bytes[] = { 0xff, 0xf8, 0, 0, 0, 0, 0, 0 }; -static const unsigned char qt_le_qnan_bytes[] = { 0, 0, 0, 0, 0, 0, 0xf8, 0xff }; -static inline double qtQnan() -{ - return *reinterpret_cast<const double *>(QSysInfo::ByteOrder == QSysInfo::BigEndian ? qt_be_qnan_bytes : qt_le_qnan_bytes); -} -#define Q_QNAN (::qtQnan()) - -static inline bool qIsInf(double d) -{ - uchar *ch = (uchar *)&d; - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { - return (ch[0] & 0x7f) == 0x7f && ch[1] == 0xf0; - } else { - return (ch[7] & 0x7f) == 0x7f && ch[6] == 0xf0; - } -} - -static inline bool qIsNaN(double d) -{ - uchar *ch = (uchar *)&d; - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { - return (ch[0] & 0x7f) == 0x7f && ch[1] > 0xf0; - } else { - return (ch[7] & 0x7f) == 0x7f && ch[6] > 0xf0; - } -} - -static inline bool qIsFinite(double d) -{ - uchar *ch = (uchar *)&d; - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { - return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0xf0) != 0xf0; - } else { - return (ch[7] & 0x7f) != 0x7f || (ch[6] & 0xf0) != 0xf0; - } -} - -static inline bool qIsInf(float d) -{ - uchar *ch = (uchar *)&d; - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { - return (ch[0] & 0x7f) == 0x7f && ch[1] == 0x80; - } else { - return (ch[3] & 0x7f) == 0x7f && ch[2] == 0x80; - } -} - -static inline bool qIsNaN(float d) -{ - uchar *ch = (uchar *)&d; - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { - return (ch[0] & 0x7f) == 0x7f && ch[1] > 0x80; - } else { - return (ch[3] & 0x7f) == 0x7f && ch[2] > 0x80; - } -} - -static inline bool qIsFinite(float d) -{ - uchar *ch = (uchar *)&d; - if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { - return (ch[0] & 0x7f) != 0x7f || (ch[1] & 0x80) != 0x80; - } else { - return (ch[3] & 0x7f) != 0x7f || (ch[2] & 0x80) != 0x80; - } -} - -#endif // QNUMERIC_P_H diff --git a/tests/auto/qtessellator/qtessellator.pro b/tests/auto/qtessellator/qtessellator.pro deleted file mode 100644 index 6821d0e909..0000000000 --- a/tests/auto/qtessellator/qtessellator.pro +++ /dev/null @@ -1,10 +0,0 @@ -load(qttest_p4) - -QT += gui-private - -SOURCES += tst_tessellator.cpp testtessellator.cpp oldtessellator.cpp utils.cpp simple.cpp dataparser.cpp arc.cpp -HEADERS += oldtessellator.h testtessellator.h utils.h XRenderFake.h simple.h qnum.h dataparser.h arc.h - -RESOURCES += datafiles.qrc - - diff --git a/tests/auto/qtessellator/sample_data.h b/tests/auto/qtessellator/sample_data.h deleted file mode 100644 index 245911aae7..0000000000 --- a/tests/auto/qtessellator/sample_data.h +++ /dev/null @@ -1,51 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef SAMPLE_DATA_H -#define SAMPLE_DATA_H - -#include <QVector> -#include <QPointF> -#include <QList> - -typedef QVector<QPointF> SampleData; -typedef QList< SampleData > FullData; - -#endif diff --git a/tests/auto/qtessellator/simple.cpp b/tests/auto/qtessellator/simple.cpp deleted file mode 100644 index 1a1d279f94..0000000000 --- a/tests/auto/qtessellator/simple.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "simple.h" - -#include "dataparser.h" -#include <QString> - -FullData simpleData() -{ - return parseFile(":/simple.data"); -} diff --git a/tests/auto/qtessellator/simple.data b/tests/auto/qtessellator/simple.data deleted file mode 100644 index ab46f3969b..0000000000 --- a/tests/auto/qtessellator/simple.data +++ /dev/null @@ -1,195 +0,0 @@ -16.000000,6.000000, 16.000000,18.000000, 16.000000,1.000000, 16.000000,14.000000, 10.000000,17.000000, 16.000000,6.000000, - -10,10,16,18,18,14,21,18,25,18,25,11,15,7,15,12,13,12,10,10 - -10,10,20,10,20,20,10,20,10,10 - -0,0,0,10,12,10,12,0,0,0,4,2,4,6,10,6,10,2,4,2,0,0 - -0,0,0,10,12,10,12,0,0,0,4,2,4,6,10,6,10,2,4,2,0,0,0,0,0,10,12,10,12,0,0,0,4,2,4,6,10,6,10,2,4,2,0,0 - -10,11,22,10,12,4,16,14,20,4,10,11 - -10,11,22,10,12,4,16,14,20,4,10,11,10,11,22,10,12,4,16,14,20,4,10,11 - -0,0,10,10,10,0,0,10,0,0 - -0,15,15,15,15,0,5,0,5,20,10,20,10,5,0,5,0,15 - -0,15,15,15,15,0,5,0,5,20,10,20,10,5,0,5,0,15,0,15,15,15,15,0,5,0,5,20,10,20,10,5,0,5,0,15 - -0,10,10,10,10,0,0,0,10,10,0,10,10,0,10,5,0,5,5,0,5,10,0,10 - -10,16,19,8,8,8,4,4,17,14,1,1,10,16 - -19,1,13,4,15,19,5,4,8,15,15,7,0,7,15,8,9,1,19,1 - -15,9,18,3,14,11,4,12,10,14,7,16,15,9 - -16,10,4,14,12,15,17,10,14,19,13,11,16,10 - -5,19,12,8,12,12,7,19,9,14,3,18,5,19 - -3,14,11,2,1,15,3,13,10,3,15,11,3,14 - -8,6,8,1,12,2,0,4,4,15,10,9,8,6 - -15,16,0,3,16,16,19,5,10,9,15,4,15,16 - -3,19,17,14,9,8,16,6,16,7,17,6,3,19 - -0,13,0,4,5,5,7,10,4,10,0,8,0,13 - -4,18,5,17,19,2,0,4,8,8,10,12,4,18 - -13,12,15,19,11,5,0,14,19,15,11,11,13,12 - -7,11,18,8,9,7,17,7,3,7,12,1,7,11 - -10,10,7,8,13,14,7,9,8,9,6,17,10,10 - -13,16,7,13,19,5,8,18,1,11,7,6,13,16 - -9,6,16,11,7,10,14,12,17,2,15,13,9,6 - -9,11,17,17,2,14,19,15,1 12,16,15,9,11 - -1,8,7,17,0,19,12,7,5,14,13,6,1,8 - -11,7,13,6,8,6,7,11,7,16,13,6,11,7 - -1,1,18,1,1,14,2,14,14,3,18,1,1,1 - -1495,174,1965,1194,622,795,1892,1044,1618,1608,1464,1758,1495,174 - -12.437167782336,18.332947529852,6.037403680384,0.577168781310,17.369421254843,3.538437001407,1.208027666435,3.512877216563,6.647234912962,10.036138510332,13.422909136862,2.474576039240,12.437167782336,18.332947529852 - -5.591339580715,19.434930747375, 10.417904593050,11.852347580716, 18.050480354577,3.041639151052, 5.511732324958,17.206167224795, 4.091005269438,17.285228203982, 14.422692870721,17.285191211849, 5.591339580715,19.434930747375 - -9.662125930190,13.671313980594, 18.663120605052,13.914435822517, 4.666417893022,0.991358347237, 5.612019170076,9.671168159693, 14.484839309007,1.828807275742, 14.513027202338,18.705772804096, 9.662125930190,13.671313980594 - -85,54,64,169,73,28,77,104,122,113,7,90,85,54 - -8,9,13,2,16,8,6,16,15,18,18,1,8,9 - -1,19,1,19,16,4,12,4,17,10,9,18,1,19 - -7,5,4,1,17,16,4,1,18,9,19,18,7,5 - -5,2,10,7,2,15,10,7,19,7,4,18,5,2 - -193.344000,167.079000,193.927000,223.478000,192.927000,224.489000,191.461000,224.489000,190.462000,223.517000,190.144000,214.550000,189.758000,207.495000,189.303000,202.313000,189.303000,202.314000,188.432000,196.134000,187.401000,191.208000,186.180000,187.421000,185.546000,186.021000,184.895000,184.970000,184.121000,184.112000,183.389000,183.504000,182.740000,183.226000,181.868000,183.160000,181.868000,183.160000,174.478000,183.160000,175.478000,182.160000,175.478000,365.969000,175.506000,372.881000,175.590000,378.848000,175.930000,387.984000,176.507000,393.460000,176.506000,393.454000,177.006000,395.653000,177.567000,397.365000,178.244000,398.733000,178.559000,399.226000,178.834000,399.548000,179.193000,399.834000,179.499000,400.046000,179.699000,400.114000,180.048000,400.119000,180.048000,400.119000,181.868000,400.119000,182.868000,401.119000,182.868000,407.673000,181.868000,408.673000,159.625000,408.673000,158.625000,407.673000,158.625000,401.119000,159.625000,400.119000,161.481000,400.119000,161.858000,400.113000,162.068000,400.029000,162.391000,399.766000,162.784000,399.401000,163.092000,398.979000,163.431000,398.358000,164.137000,396.643000,164.715000,394.484000,165.207000,391.744000,165.207000,391.744000,165.679000,386.379000,165.959000,377.809000,166.051000,365.969000,166.051000,182.160000,167.051000,183.160000,160.744000,183.160000,159.690000,183.204000,158.850000,183.365000,158.032000,183.688000,157.329000,184.077000,156.837000,184.522000,156.371000,185.190000,156.377000,185.181000,155.135000,188.005000,154.052000,192.134000,153.069000,197.733000,152.247000,204.835000,151.685000,213.407000,151.378000,223.505000,150.378000,224.489000,148.912000,224.489000,147.912000,223.478000,148.531000,167.079000,149.531000,166.090000,192.344000,166.090000,193.344000,167.079000,192.344000,168.090000,149.531000,168.090000,150.531000,167.100000,149.912000,223.500000,148.912000,222.489000,150.378000,222.489000,149.378000,223.472000,149.691000,213.305000,150.264000,204.608000,151.091000,197.438000,152.142000,191.648000,153.353000,187.164000,154.663000,184.149000,154.669000,184.139000,155.353000,183.276000,156.247000,182.469000,157.167000,181.884000,158.209000,181.511000,159.466000,181.255000,160.744000,181.160000,160.744000,181.160000,167.051000,181.160000,168.051000,182.160000,168.051000,365.969000,167.953000,377.887000,167.663000,386.600000,167.185000,392.042000,167.185000,392.043000,166.641000,394.941000,165.969000,397.395000,165.212000,399.268000,164.738000,400.056000,164.180000,400.787000,163.652000,401.319000,163.002000,401.697000,162.185000,401.997000,161.481000,402.119000,161.481000,402.119000,159.625000,402.119000,160.625000,401.119000,160.625000,407.673000,159.625000,406.673000,181.868000,406.673000,180.868000,407.673000,180.868000,401.119000,181.868000,402.119000,180.048000,402.119000,179.401000,402.020000,178.647000,401.777000,178.044000,401.471000,177.539000,401.029000,176.994000,400.418000,176.533000,399.769000,175.791000,398.232000,175.109000,396.207000,174.543000,393.839000,174.542000,393.833000,174.221000,391.520000,173.956000,388.260000,173.599000,378.945000,173.478000,365.969000,173.478000,182.160000,174.478000,181.160000,181.868000,181.160000,183.093000,181.365000,184.400000,181.902000,185.484000,182.650000,186.386000,183.691000,187.271000,185.083000,188.032000,186.667000,188.032000,186.667000,189.288000,190.589000,190.384000,195.766000,191.290000,202.082000,191.290000,202.083000,191.748000,207.310000,192.140000,214.448000,192.461000,223.460000,191.461000,222.489000,192.927000,222.489000,191.927000,223.499000,191.344000,167.100000,192.344000,168.090000,193.344000,167.079000 - -13.000000,7.000000, 8.000000,15.000000, 16.000000,2.000000, 17.000000,13.000000, 5.000000,10.000000, 19.000000,17.000000, 13.000000,7.000000 - -10.000000,6.000000, 16.000000,4.000000, 0.000000,10.000000, 14.000000,10.000000, 9.000000,5.000000, 5.000000,15.000000, 10.000000,6.000000 - -2.000000,18.000000, 14.000000,11.000000, 2.000000,14.000000, 5.000000,19.000000, 14.000000,19.000000, 2.000000,1.000000, 2.000000,18.000000 - -18.000000,14.000000, 18.000000,6.000000, 18.000000,18.000000, 3.000000,9.000000, 19.000000,10.000000, 3.000000,19.000000, 18.000000,14.000000 - -0.000000,14.000000, 5.000000,11.000000, 19.000000,5.000000, 0.000000,16.000000, 12.000000,13.000000, 0.000000,14.000000, 0.000000,14.000000 - -6.000000,9.000000, 4.000000,7.000000, 11.000000,14.000000, 4.000000,10.000000, 11.000000,8.000000, 9.000000,15.000000, 6.000000,9.000000 - -15.000000,4.000000, 15.000000,3.000000, 11.000000,13.000000, 12.000000,4.000000, 19.000000,5.000000, 6.000000,9.000000, 15.000000,4.000000 - -4.000000,2.000000, 11.000000,8.000000, 19.000000,19.000000, 1.000000,18.000000, 19.000000,0.000000, 15.000000,15.000000, 4.000000,2.000000 - -7.000000,14.000000, 18.000000,6.000000, 8.000000,2.000000, 14.000000,14.000000, 4.000000,8.000000, 9.000000,11.000000, 7.000000,14.000000 - -16.000000,8.000000, 15.000000,9.000000, 9.000000,17.000000, 9.000000,16.000000, 4.000000,3.000000, 8.000000,16.000000, 16.000000,8.000000 - -11.000000,10.000000, 12.000000,10.000000, 11.000000,2.000000, 7.000000,4.000000, 5.000000,13.000000, 11.000000,10.000000, 11.000000,10.000000 - -17.000000,1.000000, 2.000000,15.000000, 17.000000,17.000000, 7.000000,7.000000, 16.000000,19.000000, 3.000000,18.000000, 7.000000,0.000000, 7.000000,0.000000, 6.000000,4.000000, 2.000000,1.000000, 4.000000,2.000000, 7.000000,16.000000, 11.000000,16.000000, 7.000000,3.000000, 11.000000,16.000000, 5.000000,9.000000, 18.000000,8.000000, 4.000000,15.000000, 5.000000,11.000000, 17.000000,1.000000 - -10.000000,8.000000, 12.000000,3.000000, 10.000000,8.000000, 10.000000,19.000000, 2.000000,8.000000, 16.000000,11.000000, 10.000000,8.000000 - -10.000000,10.000000, 13.000000,11.000000, 18.000000,2.000000, 13.000000,11.000000, 11.000000,10.000000, 10.000000,14.000000, 10.000000,10.000000 - -8.000000,13.000000, 8.000000,7.000000, 12.000000,19.000000, 8.000000,8.000000, 8.000000,7.000000, 8.000000,2.000000, 8.000000,13.000000 - -//1.000000,7.000000, 12.000000,16.000000, 3.000000,4.000000, 16.000000,18.000000, 11.000000,3.000000, 16.000000,18.000000, 2.000000,4.000000, 11.000000,4.000000, 11.000000,16.000000, 1.000000,7.000000 - -1.000000,0.000000, 18.000000,13.000000, 0.000000,4.000000, 4.000000,6.000000, 16.000000,15.000000, 4.000000,3.000000, 4.000000,16.000000, 1.000000,0.000000 - -17.000000,17.000000, 7.000000,12.000000, 1.000000,17.000000, 8.000000,17.000000, 15.000000,15.000000, 17.000000,12.000000, 12.000000,15.000000, 5.000000,11.000000, 9.000000,13.000000, 15.000000,18.000000, 7.000000,8.000000, 17.000000,17.000000 - -//4.000000,0.000000, 15.000000,2.000000, 1.000000,2.000000, 17.000000,9.000000, 11.000000,4.000000, 3.000000,2.000000, 4.000000,8.000000, 6.000000,12.000000, 18.000000,15.000000, 15.000000,2.000000, 4.000000,0.000000 - -5.000000,14.000000, 7.000000,15.000000, 9.000000,15.000000, 5.000000,16.000000, 12.000000,2.000000, 7.000000,12.000000, 5.000000,11.000000, 10.000000,9.000000, 5.000000,4.000000, 11.000000,18.000000, 9.000000,8.000000, 5.000000,14.000000 - -//1.000000,19.000000, 6.000000,5.000000, 12.000000,6.000000, 8.000000,5.000000, 6.000000,1.000000, 8.000000,5.000000, 2.000000,5.000000, 1.000000,19.000000, - -3.000000,18.000000, 0.000000,2.000000, 13.000000,0.000000, 1.000000,0.000000, 19.000000,19.000000, 2.000000,1.000000, 17.000000,0.000000, 3.000000,18.000000, - -12.000000,10.000000, 4.000000,19.000000, 10.000000,0.000000, 6.000000,19.000000, 4.000000,16.000000, 4.000000,19.000000, 0.000000,15.000000, 4.000000,16.000000, 11.000000,5.000000, 12.000000,10.000000, - -0.000000,2.000000, 9.000000,11.000000, 13.000000,8.000000, 8.000000,7.000000, 10.000000,15.000000, 16.000000,1.000000, 9.000000,11.000000, 8.000000,14.000000, 10.000000,11.000000, 0.000000,2.000000 - -13.000000,11.000000, 5.000000,7.000000, 15.000000,15.000000, 0.000000,3.000000, 16.000000,17.000000, 3.000000,9.000000, 6.000000,6.000000, 5.000000,7.000000, 3.000000,6.000000, 13.000000,11.000000, - -6.000000,6.000000, 2.000000,5.000000, 15.000000,6.000000, 14.000000,8.000000, 10.000000,11.000000, 18.000000,3.000000, 10.000000,11.000000, 15.000000,1.000000, 15.000000,19.000000, 6.000000,6.000000, - -15.000000,15.000000, 14.000000,14.000000, 1.000000,19.000000, 19.000000,12.000000, 1.000000,19.000000, 16.000000,18.000000, 2.000000,17.000000, 14.000000,19.000000, 2.000000,14.000000, 15.000000,15.000000, - -17.000000,1.000000, 2.000000,14.000000, 19.000000,11.000000, 18.000000,11.000000, 4.000000,16.000000, 10.000000,11.000000, 8.000000,16.000000, 12.000000,12.000000, 11.000000,14.000000, 17.000000,1.000000, - -17.000000,4.000000, 18.000000,9.000000, 10.000000,1.000000, 18.000000,9.000000, 4.000000,12.000000, 14.000000,17.000000, 4.000000,1.000000, 5.000000,17.000000, 4.000000,3.000000, 17.000000,4.000000, - -6.000000,12.000000, 13.000000,1.000000, 10.000000,15.000000, 0.000000,1.000000, 12.000000,12.000000, 1.000000,2.000000, 14.000000,2.000000, 9.000000,10.000000, 10.000000,9.000000, 6.000000,12.000000, - -10.000000,2.000000, 1.000000,19.000000, 18.000000,10.000000, 5.000000,11.000000, 13.000000,3.000000, 16.000000,12.000000, 13.000000,2.000000, 19.000000,4.000000, 12.000000,16.000000, 10.000000,2.000000, - -15.000000,18.000000, 9.000000,4.000000, 17.000000,19.000000, 8.000000,2.000000, 12.000000,14.000000, 16.000000,4.000000, 17.000000,11.000000, 1.000000,13.000000, 16.000000,8.000000, 15.000000,18.000000, - -0.000000,1.000000, 3.000000,5.000000, 6.000000,18.000000, 8.000000,10.000000, 2.000000,9.000000, 12.000000,13.000000, 17.000000,0.000000, 3.000000,10.000000, 16.000000,1.000000, 0.000000,1.000000, - -2.000000,5.000000, 5.000000,12.000000, 11.000000,2.000000, 1.000000,19.000000, 6.000000,5.000000, 17.000000,1.000000, 8.000000,0.000000, 14.000000,10.000000, 2.000000,5.000000 - -12.000000,17.000000, 14.000000,7.000000, 12.000000,17.000000, 15.000000,9.000000, 3.000000,8.000000, 15.000000,2.000000, 13.000000,13.000000, 12.000000,17.000000, - -16.000000,9.000000, 12.000000,17.000000, 9.000000,7.000000, 6.000000,14.000000, 10.000000,10.000000, 0.000000,18.000000, 19.000000,9.000000, 2.000000,11.000000, 16.000000,9.000000, - -2.000000,11.000000, 8.000000,4.000000, 5.000000,15.000000, 19.000000,7.000000, 1.000000,4.000000, 11.000000,15.000000, 6.000000,0.000000, 10.000000,13.000000, 15.000000,0.000000, 5.000000,7.000000, 2.000000,11.000000, - -14.000000,16.000000, 13.000000,3.000000, 13.000000,7.000000, 13.000000,4.000000, 4.000000,19.000000, 18.000000,3.000000, 3.000000,6.000000, 14.000000,16.000000 - -1.000000,10.000000, 16.000000,11.000000, 5.000000,12.000000, 14.000000,12.000000, 1.000000,10.000000, - -3.000000,14.000000, 18.000000,13.000000, 0.000000,13.000000, 17.000000,15.000000, 3.000000,14.000000 - -113.978891,188.283650, 114.049102,188.354061, 114.028390,188.311950, 140.621311,218.434785, 113.925508,188.451788, 114.028390,188.311950, 114.038094,188.325206, 107.079712,223.213808, 113.978891,188.283650 - -149.124266,243.836328, 149.130825,243.837775, 140.462458,289.372639, 149.124266,243.836328, 174.003258,285.357827, 149.081172,244.062877, 80.895955,240.414297, 149.081172,244.062877, 149.124266,243.836328, - -29.389873,51.154090, 34.288345,59.861919, 29.364091,51.189091, 29.379701,51.200590, 15.480095,51.026265, 27.327001,60.472279, 29.361537,51.172254, 29.379701,51.200590, 29.389873,51.154090, - -23.402194,41.096844, 23.406381,41.132628, 34.465476,40.926093, 32.678424,45.608817, 23.389763,41.132654, 23.414672,41.106110, 21.719863,48.560185, 23.402194,41.096844, - -30.951431,53.763363, 30.939362,53.811917, 41.512607,48.598876, 25.528987,61.504482, 30.925582,53.773491, 30.940776,53.812269, 28.790798,63.563660, 30.921651,53.782489, 30.951431,53.763363, - -40.932299,70.331769, 33.882179,80.568702, 40.952469,70.382541, 33.906555,80.507737, 38.158710,83.200483, 40.932299,70.331769 - -37.291393,64.307940, 47.917795,74.087993, 37.307928,64.317812, 51.927660,71.285431, 34.739208,76.059738, 37.291393,64.307940 - -97.604218,162.191009, 81.519079,186.128039, 97.652864,162.308413, 81.609840,186.099213, 67.592573,182.092187, 91.591892,192.217346, 97.604218,162.191009 - -135.877528,222.962402, 135.792476,222.983126, 195.753543,234.556614, 135.814790,223.162055, 135.936349,222.995801, 135.947907,223.011493, 127.815883,264.424834, 135.877528,222.962402, - -140.157057,229.713961, 140.069413,229.735364, 201.872134,241.630761, 140.092507,229.919758, 140.217696,229.748350, 140.229617,229.764516, 131.871019,272.449909, 140.157057,229.713961 - -193.086469,312.646765, 108.189184,287.648923, 193.023897,312.936441, 237.949462,362.828686, 192.949279,312.891753, 266.364944,345.116804, 192.999843,312.928266, 192.913653,312.765449, 193.086469,312.646765 - -247.422415,396.899455, 247.217314,397.163923, 247.574394,397.118778, 142.852727,414.776640, 288.712650,464.492402, 247.228121,397.184104, 135.733401,392.254819, 233.734466,471.311838, 247.203092,397.051434, 247.355072,397.270757, 247.422415,396.899455, - -330.399757,524.281800, 330.600976,524.476466, 323.970137,422.844875, 330.540537,524.358965, 406.928779,607.813936, 330.568526,524.395792, 359.346715,616.206998, 330.399757,524.281800, - -304.198844,484.203463, 173.561956,487.759775, 436.078782,489.984415, 374.610016,561.755629, 304.198844,484.203463, 354.969812,566.668108, 304.118093,484.657714, 304.198844,484.203463, - -216.327573,348.779345, 182.153126,401.142486, 216.158855,348.851925, 194.442338,411.748517, 216.134810,348.912273, 216.267739,349.105035, 216.327573,348.779345, - -40.510823,69.635522, 40.490212,69.696716, 38.684855,81.300842, 40.530783,69.685790, 47.264190,81.490170, 40.497275,69.699095, 37.801306,82.350057, 37.762746,82.375070, 40.472263,69.660535, 40.510823,69.635522 - -/ diff --git a/tests/auto/qtessellator/simple.h b/tests/auto/qtessellator/simple.h deleted file mode 100644 index c77c6c3748..0000000000 --- a/tests/auto/qtessellator/simple.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef SIMPLEDATA_H -#define SIMPLEDATA_H - -#include "sample_data.h" - -FullData simpleData(); - -#endif diff --git a/tests/auto/qtessellator/testtessellator.cpp b/tests/auto/qtessellator/testtessellator.cpp deleted file mode 100644 index c2af1ae780..0000000000 --- a/tests/auto/qtessellator/testtessellator.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "testtessellator.h" -#include <private/qtessellator_p.h> - -#include "math.h" -#include <QtCore/QDebug> - -class TestTessellator : public QTessellator -{ -public: - QVector<XTrapezoid> *traps; - void addTrap(const Trapezoid &trap); -}; - -void TestTessellator::addTrap(const Trapezoid &trap) -{ - XTrapezoid xtrap; - xtrap.top = Q27Dot5ToXFixed(trap.top); - xtrap.bottom = Q27Dot5ToXFixed(trap.bottom); - xtrap.left.p1.x = Q27Dot5ToXFixed(trap.topLeft->x); - xtrap.left.p1.y = Q27Dot5ToXFixed(trap.topLeft->y); - xtrap.left.p2.x = Q27Dot5ToXFixed(trap.bottomLeft->x); - xtrap.left.p2.y = Q27Dot5ToXFixed(trap.bottomLeft->y); - xtrap.right.p1.x = Q27Dot5ToXFixed(trap.topRight->x); - xtrap.right.p1.y = Q27Dot5ToXFixed(trap.topRight->y); - xtrap.right.p2.x = Q27Dot5ToXFixed(trap.bottomRight->x); - xtrap.right.p2.y = Q27Dot5ToXFixed(trap.bottomRight->y); - traps->append(xtrap); -} - - -void test_tesselate_polygon(QVector<XTrapezoid> *traps, const QPointF *points, int nPoints, - bool winding) -{ - TestTessellator t; - t.traps = traps; - t.setWinding(winding); - t.tessellate(points, nPoints); -} - - -void test_tessellate_polygon_convex(QVector<XTrapezoid> *traps, const QPointF *points, int nPoints, - bool winding) -{ - TestTessellator t; - t.traps = traps; - t.setWinding(winding); - t.tessellateConvex(points, nPoints); -} - - -void test_tessellate_polygon_rect(QVector<XTrapezoid> *traps, const QPointF *points, int nPoints, - bool winding) -{ - // 5 points per rect - if (nPoints % 5 != 0) - qWarning() << Q_FUNC_INFO << "multiples of 5 points expected"; - - TestTessellator t; - t.traps = traps; - t.setWinding(winding); - for (int i = 0; i < nPoints / 5; ++i) { - QPointF rectA = points[5*i]; - QPointF rectB = points[5*i+1]; - QPointF rectC = points[5*i+2]; - QPointF rectD = points[5*i+3]; - - QPointF a = (rectA + rectD) * 0.5; - QPointF b = (rectB + rectC) * 0.5; - - QPointF delta = rectA - rectD; - - qreal width = sqrt(delta.x() * delta.x() + delta.y() * delta.y()); - - t.tessellateRect(a, b, width); - } -} diff --git a/tests/auto/qtessellator/testtessellator.h b/tests/auto/qtessellator/testtessellator.h deleted file mode 100644 index 09d098f6dc..0000000000 --- a/tests/auto/qtessellator/testtessellator.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef TESTTESSELLATOR_H -#define TESTTESSELLATOR_H - -#include <QVector> -#include <QPointF> -#include "XrenderFake.h" - -typedef void (*tessellate_function)(QVector<XTrapezoid> *traps, const QPointF *points, int nPoints, - bool winding); - -void test_tesselate_polygon(QVector<XTrapezoid> *traps, const QPointF *points, int nPoints, - bool winding); - -void test_tessellate_polygon_convex(QVector<XTrapezoid> *traps, const QPointF *points, int nPoints, - bool winding); - -void test_tessellate_polygon_rect(QVector<XTrapezoid> *traps, const QPointF *points, int nPoints, - bool winding); -#endif diff --git a/tests/auto/qtessellator/tst_tessellator.cpp b/tests/auto/qtessellator/tst_tessellator.cpp deleted file mode 100644 index e8d4e2d1c6..0000000000 --- a/tests/auto/qtessellator/tst_tessellator.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include <QtTest/QtTest> -#include <QCoreApplication> -#include <QVector> -#include <qdebug.h> -#include <qpolygon.h> -#include <qmatrix.h> - -#include "oldtessellator.h" -#include "testtessellator.h" -#include "utils.h" -#include "simple.h" -#include "arc.h" - -#include "math.h" - -//TESTED_CLASS= -//TESTED_FILES= - -class tst_QTessellator : public QObject -{ - Q_OBJECT - -public: - tst_QTessellator() { - } - -private slots: - void testStandardSet(); - void testRandom(); - void testArc(); - void testRects(); - void testConvexRects(); - void testConvex(); -}; - - -QPointF creatPoint() -{ - qreal x = int(20.0 * (rand() / (RAND_MAX + 1.0))); - qreal y = int(20.0 * (rand() / (RAND_MAX + 1.0))); - return QPointF(x, y); -} - -bool test(const QPointF *pg, int pgSize, bool winding, tessellate_function tessellate = test_tesselate_polygon, qreal maxDiff = 0.005) -{ - QVector<XTrapezoid> traps; - qreal area1 = 0; - qreal area2 = 0; - - old_tesselate_polygon(&traps, pg, pgSize, winding); - area1 = compute_area_for_x(traps); - - traps.clear(); - - tessellate(&traps, pg, pgSize, winding); - area2 = compute_area_for_x(traps); - - bool result = (qAbs(area2 - area1) < maxDiff); - if (!result && area1) - result = (qAbs(area1 - area2)/area1 < maxDiff); - - if (!result) - qDebug() << area1 << area2; - - return result; -} - - -void simplifyTestFailure(QVector<QPointF> failure, bool winding) -{ - int i = 1; - while (i < failure.size() - 1) { - QVector<QPointF> t = failure; - t.remove(i); - if (test(t.data(), t.size(), winding)) { - ++i; - continue; - } - failure = t; - i = 1; - } - - for (int x = 0; x < failure.size(); ++x) { - fprintf(stderr, "%lf,%lf, ", failure[x].x(), failure[x].y()); - } - fprintf(stderr, "\n\n"); -} - -void tst_QTessellator::testStandardSet() -{ - QVector<FullData> sampleSet; - sampleSet.append(simpleData()); - - foreach(FullData data, sampleSet) { - for (int i = 0; i < data.size(); ++i) { - if (!test(data[i].data(), data[i].size(), false)) { - simplifyTestFailure(data[i], false); - QCOMPARE(true, false); - } - if (!test(data[i].data(), data[i].size(), true)) { - simplifyTestFailure(data[i], true); - QCOMPARE(true, false); - } - } - } -} - - - -void fillRandomVec(QVector<QPointF> &vec) -{ - int size = vec.size(); --size; - for (int i = 0; i < size; ++i) { - vec[i] = creatPoint(); - } - vec[size] = vec[0]; -} - -void tst_QTessellator::testRandom() -{ - int failures = 0; - for (int i = 5; i < 12; ++i) { - QVector<QPointF> vec(i); -#ifdef QT_ARCH_ARM - int k = 200; -#else - int k = 5000; -#endif - while (--k) { - fillRandomVec(vec); - if (!test(vec.data(), vec.size(), false)) { - simplifyTestFailure(vec, false); - ++failures; - } - if (!test(vec.data(), vec.size(), true)) { - simplifyTestFailure(vec, true); - ++failures; - } - } - } - QVERIFY(failures == 0); -} - - -// we need a higher threshold for failure here than in the above tests, as this basically draws -// a very thin outline, where the discretization in the new tesselator shows -bool test_arc(const QPolygonF &poly, bool winding) -{ - QVector<XTrapezoid> traps; - qreal area1 = 0; - qreal area2 = 0; - - old_tesselate_polygon(&traps, poly.data(), poly.size(), winding); - area1 = compute_area_for_x(traps); - - traps.clear(); - - test_tesselate_polygon(&traps, poly.data(), poly.size(), winding); - area2 = compute_area_for_x(traps); - - bool result = (area2 - area1 < .02); - if (!result && area1) - result = (qAbs(area1 - area2)/area1 < .02); - - return result; -} - - - -void tst_QTessellator::testArc() -{ - FullData arc = arcData(); - - QMatrix mat; -#ifdef QT_ARCH_ARM - const int stop = 5; -#else - const int stop = 1000; -#endif - for (int i = 0; i < stop; ++i) { - mat.rotate(qreal(.01)); - mat.scale(qreal(.99), qreal(.99)); - QPolygonF poly = arc.at(0); - QPolygonF vec = poly * mat; - QVERIFY(test_arc(vec, true)); - QVERIFY(test_arc(vec, false)); - } -} - -static bool isConvex(const QVector<QPointF> &v) -{ - int nPoints = v.size() - 1; - - qreal lastCross = 0; - for (int i = 0; i < nPoints; ++i) { - QPointF a = v[i]; - QPointF b = v[(i + 1) % nPoints]; - - QPointF d1 = b - a; - - for (int j = 0; j < nPoints; ++j) { - if (j == i || j == i + 1) - continue; - - QPointF p = v[j]; - QPointF d2 = p - a; - - qreal cross = d1.x() * d2.y() - d1.y() * d2.x(); - - if (!qFuzzyCompare(cross + 1, 1) - && !qFuzzyCompare(cross + 1, 1) - && (lastCross > 0) != (cross > 0)) - return false; - - lastCross = cross; - } - } - - return true; -} - -static void fillRectVec(QVector<QPointF> &v) -{ - int numRects = v.size() / 5; - - int first = 0; - v[first++] = QPointF(0, 0); - v[first++] = QPointF(10, 0); - v[first++] = QPointF(10, 10); - v[first++] = QPointF(0, 10); - v[first++] = QPointF(0, 0); - - v[first++] = QPointF(0, 0); - v[first++] = QPointF(2, 2); - v[first++] = QPointF(4, 0); - v[first++] = QPointF(2, -2); - v[first++] = QPointF(0, 0); - - v[first++] = QPointF(0, 0); - v[first++] = QPointF(4, 4); - v[first++] = QPointF(6, 2); - v[first++] = QPointF(2, -2); - v[first++] = QPointF(0, 0); - - for (int i = first / 5; i < numRects; ++i) { - QPointF a = creatPoint(); - QPointF b = creatPoint(); - - QPointF delta = a - b; - QPointF perp(delta.y(), -delta.x()); - - perp *= ((int)(20.0 * rand() / (RAND_MAX + 1.0))) / 20.0; - - int j = 5 * i; - v[j++] = a + perp; - v[j++] = a - perp; - v[j++] = b - perp; - v[j++] = b + perp; - v[j++] = a + perp; - } -} - -#ifdef QT_ARCH_ARM -const int numRects = 500; -#else -const int numRects = 5000; -#endif - -void tst_QTessellator::testConvexRects() -{ - return; - int failures = 0; - QVector<QPointF> vec(numRects * 5); - fillRectVec(vec); - for (int rect = 0; rect < numRects; ++rect) { - QVector<QPointF> v(5); - for (int i = 0; i < 5; ++i) - v[i] = vec[5 * rect + i]; - if (!test(v.data(), v.size(), false, test_tessellate_polygon_convex)) { - simplifyTestFailure(v, false); - ++failures; - } - if (!test(v.data(), v.size(), true, test_tessellate_polygon_convex)) { - simplifyTestFailure(v, true); - ++failures; - } - } - QVERIFY(failures == 0); -} - -void tst_QTessellator::testConvex() -{ - int failures = 0; - for (int i = 4; i < 10; ++i) { - QVector<QPointF> vec(i); - int k = 5000; - while (k--) { - fillRandomVec(vec); - if (!isConvex(vec)) - continue; - if (!test(vec.data(), vec.size(), false, test_tessellate_polygon_convex)) { - simplifyTestFailure(vec, false); - ++failures; - } - if (!test(vec.data(), vec.size(), true, test_tessellate_polygon_convex)) { - simplifyTestFailure(vec, true); - ++failures; - } - } - } - QVERIFY(failures == 0); -} - - -void tst_QTessellator::testRects() -{ - int failures = 0; - QVector<QPointF> vec(numRects * 5); - fillRectVec(vec); - for (int rect = 0; rect < numRects; ++rect) { - QVector<QPointF> v(5); - for (int i = 0; i < 5; ++i) - v[i] = vec[5 * rect + i]; - if (!test(v.data(), v.size(), false, test_tessellate_polygon_rect, qreal(0.05))) { - simplifyTestFailure(v, false); - ++failures; - } - if (!test(v.data(), v.size(), true, test_tessellate_polygon_rect, qreal(0.05))) { - simplifyTestFailure(v, true); - ++failures; - } - } - QVERIFY(failures == 0); -} - - -QTEST_MAIN(tst_QTessellator) -#include "tst_tessellator.moc" diff --git a/tests/auto/qtessellator/utils.cpp b/tests/auto/qtessellator/utils.cpp deleted file mode 100644 index 5790983445..0000000000 --- a/tests/auto/qtessellator/utils.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "utils.h" - -#include <assert.h> -#include <qglobal.h> - -#include "qnum.h" - -#define FloatToXFixed(i) (int)((i) * 65536) -#define IntToXFixed(i) ((i) << 16) - -static double compute_x_at(XFixed y, XPointFixed p1, XPointFixed p2) -{ - double d = XFixedToDouble(p2.x - p1.x); - return - XFixedToDouble(p1.x) + d*XFixedToDouble(y - p1.y)/XFixedToDouble(p2.y - p1.y); -} - -double compute_area(XTrapezoid *trap) -{ - double x1 = compute_x_at(trap->top, trap->left.p1, trap->left.p2); - double x2 = compute_x_at(trap->top, trap->right.p1, trap->right.p2); - double x3 = compute_x_at(trap->bottom, trap->left.p1, trap->left.p2); - double x4 = compute_x_at(trap->bottom, trap->right.p1, trap->right.p2); - - double top = XFixedToDouble(trap->top); - double bottom = XFixedToDouble(trap->bottom); - double h = bottom - top; - - double top_base = x2 - x1; - double bottom_base = x4 - x3; - - if ((top_base < 0 && bottom_base > 0) - || (top_base > 0 && bottom_base < 0)) { - double y0 = top_base*h/(top_base - bottom_base) + top; - double area = qAbs(top_base * (y0 - top) / 2.); - area += qAbs(bottom_base * (bottom - y0) /2.); - return area; - } - - - return 0.5 * h * qAbs(top_base + bottom_base); -} - -double compute_area_for_x(const QVector<XTrapezoid> &traps) -{ - double area = 0; - - for (int i = 0; i < traps.size(); ++i) { - XTrapezoid trap = traps[i]; - area += compute_area(&trap); - } - return area; -} diff --git a/tests/auto/qtessellator/utils.h b/tests/auto/qtessellator/utils.h deleted file mode 100644 index 6a4ef150b7..0000000000 --- a/tests/auto/qtessellator/utils.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef UTILS_H -#define UTILS_H - -#include <QVector> -#include <QPointF> -#include <QDebug> -#include "XrenderFake.h" - -double compute_area(XTrapezoid *trap); -double compute_area_for_x(const QVector<XTrapezoid> &traps); - -QT_BEGIN_NAMESPACE -Q_DECLARE_TYPEINFO(XTrapezoid, Q_PRIMITIVE_TYPE); -QT_END_NAMESPACE - -#endif diff --git a/tests/auto/qtextblock/qtextblock.pro b/tests/auto/qtextblock/qtextblock.pro index 5558a71506..d50ef5ca78 100644 --- a/tests/auto/qtextblock/qtextblock.pro +++ b/tests/auto/qtextblock/qtextblock.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qtextblock.cpp diff --git a/tests/auto/qtextblock/tst_qtextblock.cpp b/tests/auto/qtextblock/tst_qtextblock.cpp index 6477c50758..b04a6f5559 100644 --- a/tests/auto/qtextblock/tst_qtextblock.cpp +++ b/tests/auto/qtextblock/tst_qtextblock.cpp @@ -43,8 +43,9 @@ #include <QtTest/QtTest> -#define private public +#define protected public #include <qtextdocument.h> +#undef protected #include <qdebug.h> #ifndef Q_WS_WIN #include <private/qtextdocument_p.h> @@ -118,9 +119,8 @@ void tst_QTextBlock::fragmentOverBlockBoundaries() // Block separators are always a fragment of their self. Thus: // |Hello|\b|World|\b| #if !defined(Q_WS_WIN) && !defined(Q_WS_S60) - QVERIFY(doc->d_func()->fragmentMap().numNodes() == 4); + QVERIFY(doc->docHandle()->fragmentMap().numNodes() == 4); #endif - QCOMPARE(cursor.block().text(), QString("Hello")); cursor.movePosition(QTextCursor::NextBlock); QCOMPARE(cursor.block().text(), QString("World")); diff --git a/tests/auto/qtextbrowser/qtextbrowser.pro b/tests/auto/qtextbrowser/qtextbrowser.pro index 937a13e16d..f4ae8b7b67 100644 --- a/tests/auto/qtextbrowser/qtextbrowser.pro +++ b/tests/auto/qtextbrowser/qtextbrowser.pro @@ -2,6 +2,7 @@ load(qttest_p4) SOURCES += tst_qtextbrowser.cpp !symbian:DEFINES += SRCDIR=\\\"$$PWD\\\" +QT += widgets wince*|symbian: { addFiles.files = *.html diff --git a/tests/auto/qtextdocumentlayout/qtextdocumentlayout.pro b/tests/auto/qtextdocumentlayout/qtextdocumentlayout.pro index b2dc6a1f68..32b05ce061 100644 --- a/tests/auto/qtextdocumentlayout/qtextdocumentlayout.pro +++ b/tests/auto/qtextdocumentlayout/qtextdocumentlayout.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtextdocumentlayout.cpp diff --git a/tests/auto/qtextedit/qtextedit.pro b/tests/auto/qtextedit/qtextedit.pro index 594e53fda4..fa10ab72a3 100644 --- a/tests/auto/qtextedit/qtextedit.pro +++ b/tests/auto/qtextedit/qtextedit.pro @@ -1,6 +1,6 @@ load(qttest_p4) -QT += gui-private +QT += widgets widgets-private gui-private INCLUDEPATH += ../ HEADERS += diff --git a/tests/auto/qtextedit/tst_qtextedit.cpp b/tests/auto/qtextedit/tst_qtextedit.cpp index 7208861394..f10879d284 100644 --- a/tests/auto/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/qtextedit/tst_qtextedit.cpp @@ -49,7 +49,7 @@ #include <qapplication.h> #include <qclipboard.h> #include <qtextbrowser.h> -#include <private/qtextcontrol_p.h> +#include <private/qwidgettextcontrol_p.h> #include <qscrollbar.h> #include <qtextobject.h> #include <qtexttable.h> @@ -1484,7 +1484,7 @@ void tst_QTextEdit::mimeDataReimplementations() QCOMPARE(ed.insertCallCount, 0); #ifdef QT_BUILD_INTERNAL - QTextControl *control = qFindChild<QTextControl *>(&ed); + QWidgetTextControl *control = qFindChild<QWidgetTextControl *>(&ed); QVERIFY(control); control->canInsertFromMimeData(QApplication::clipboard()->mimeData()); @@ -2095,7 +2095,7 @@ void tst_QTextEdit::cursorRect() void tst_QTextEdit::setDocumentPreservesPalette() { #ifdef QT_BUILD_INTERNAL - QTextControl *control = qFindChild<QTextControl *>(ed); + QWidgetTextControl *control = qFindChild<QWidgetTextControl *>(ed); QVERIFY(control); QPalette defaultPal = ed->palette(); diff --git a/tests/auto/qtextobject/qtextobject.pro b/tests/auto/qtextobject/qtextobject.pro index 1715fa65a3..e87a364ab6 100644 --- a/tests/auto/qtextobject/qtextobject.pro +++ b/tests/auto/qtextobject/qtextobject.pro @@ -3,7 +3,7 @@ ############################################################ load(qttest_p4) - +QT += widgets SOURCES += tst_qtextobject.cpp diff --git a/tests/auto/qtextpiecetable/qtextpiecetable.pro b/tests/auto/qtextpiecetable/qtextpiecetable.pro index edcb0a091c..cfbbe2bca5 100644 --- a/tests/auto/qtextpiecetable/qtextpiecetable.pro +++ b/tests/auto/qtextpiecetable/qtextpiecetable.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets widgets-private QT += core-private gui-private SOURCES += tst_qtextpiecetable.cpp HEADERS += ../qtextdocument/common.h diff --git a/tests/auto/qtextpiecetable/tst_qtextpiecetable.cpp b/tests/auto/qtextpiecetable/tst_qtextpiecetable.cpp index 1717c6bea6..ddaf84134d 100644 --- a/tests/auto/qtextpiecetable/tst_qtextpiecetable.cpp +++ b/tests/auto/qtextpiecetable/tst_qtextpiecetable.cpp @@ -42,9 +42,10 @@ #include <QtTest/QtTest> -#define private public +#define protected public #include <qtextdocument.h> +#undef protected #include <private/qtextdocument_p.h> #include <qabstracttextdocumentlayout.h> #include <qtextobject.h> @@ -124,7 +125,7 @@ tst_QTextPieceTable::tst_QTextPieceTable() void tst_QTextPieceTable::init() { doc = new QTextDocument(0); - table = doc->d_func(); + table = doc->docHandle(); blockFormatIndex = table->formatCollection()->indexForFormat(QTextBlockFormat()); charFormatIndex = table->formatCollection()->indexForFormat(QTextCharFormat()); } diff --git a/tests/auto/qtexttable/qtexttable.pro b/tests/auto/qtexttable/qtexttable.pro index 6ab64bfa94..611b706fc4 100644 --- a/tests/auto/qtexttable/qtexttable.pro +++ b/tests/auto/qtexttable/qtexttable.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtexttable.cpp diff --git a/tests/auto/qtoolbar/qtoolbar.pro b/tests/auto/qtoolbar/qtoolbar.pro index 2c1176fe00..b340097d81 100644 --- a/tests/auto/qtoolbar/qtoolbar.pro +++ b/tests/auto/qtoolbar/qtoolbar.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets widgets-private QT += gui-private SOURCES += tst_qtoolbar.cpp diff --git a/tests/auto/qtoolbox/qtoolbox.pro b/tests/auto/qtoolbox/qtoolbox.pro index 00c4549ee2..24f3ea6cb9 100644 --- a/tests/auto/qtoolbox/qtoolbox.pro +++ b/tests/auto/qtoolbox/qtoolbox.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtoolbox.cpp diff --git a/tests/auto/qtoolbutton/qtoolbutton.pro b/tests/auto/qtoolbutton/qtoolbutton.pro index a40f31e6b4..a14f2e4713 100644 --- a/tests/auto/qtoolbutton/qtoolbutton.pro +++ b/tests/auto/qtoolbutton/qtoolbutton.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtoolbutton.cpp CONFIG+=insignificant_test diff --git a/tests/auto/qtooltip/qtooltip.pro b/tests/auto/qtooltip/qtooltip.pro index 0bd0e42c48..4a78dfd3de 100644 --- a/tests/auto/qtooltip/qtooltip.pro +++ b/tests/auto/qtooltip/qtooltip.pro @@ -1,2 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtooltip.cpp diff --git a/tests/auto/qtouchevent/qtouchevent.pro b/tests/auto/qtouchevent/qtouchevent.pro index 8f6aa8703f..55f99b6cdd 100644 --- a/tests/auto/qtouchevent/qtouchevent.pro +++ b/tests/auto/qtouchevent/qtouchevent.pro @@ -1,3 +1,3 @@ SOURCES=tst_qtouchevent.cpp TARGET=tst_qtouchevent -QT+=testlib +QT += testlib widgets diff --git a/tests/auto/qtranslator/qtranslator.pro b/tests/auto/qtranslator/qtranslator.pro index 0001d1c329..c87af7b733 100644 --- a/tests/auto/qtranslator/qtranslator.pro +++ b/tests/auto/qtranslator/qtranslator.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtranslator.cpp RESOURCES += qtranslator.qrc diff --git a/tests/auto/qtreeview/qtreeview.pro b/tests/auto/qtreeview/qtreeview.pro index 75c89094d6..1c310bda76 100644 --- a/tests/auto/qtreeview/qtreeview.pro +++ b/tests/auto/qtreeview/qtreeview.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtreeview.cpp contains(QT_CONFIG,xcb):qpa:CONFIG+=insignificant_test # QTBUG-20756 crashes on qpa, xcb diff --git a/tests/auto/qtreewidget/qtreewidget.pro b/tests/auto/qtreewidget/qtreewidget.pro index bc38239c6f..5668be1da7 100644 --- a/tests/auto/qtreewidget/qtreewidget.pro +++ b/tests/auto/qtreewidget/qtreewidget.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtreewidget.cpp diff --git a/tests/auto/qtreewidgetitemiterator/qtreewidgetitemiterator.pro b/tests/auto/qtreewidgetitemiterator/qtreewidgetitemiterator.pro index 0af47a3bcc..de7762e773 100644 --- a/tests/auto/qtreewidgetitemiterator/qtreewidgetitemiterator.pro +++ b/tests/auto/qtreewidgetitemiterator/qtreewidgetitemiterator.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qtreewidgetitemiterator.cpp diff --git a/tests/auto/qundogroup/qundogroup.pro b/tests/auto/qundogroup/qundogroup.pro index 587143d045..c2b6ceb038 100644 --- a/tests/auto/qundogroup/qundogroup.pro +++ b/tests/auto/qundogroup/qundogroup.pro @@ -1,3 +1,4 @@ CONFIG += qttest_p4 +QT += widgets SOURCES += tst_qundogroup.cpp TARGET = tst_qundogroup diff --git a/tests/auto/qundostack/qundostack.pro b/tests/auto/qundostack/qundostack.pro index beb0b103b2..c8cfb70059 100644 --- a/tests/auto/qundostack/qundostack.pro +++ b/tests/auto/qundostack/qundostack.pro @@ -1,3 +1,4 @@ CONFIG += qttest_p4 +QT += widgets SOURCES += tst_qundostack.cpp TARGET = tst_qundostack diff --git a/tests/auto/qvariant/qvariant.pro b/tests/auto/qvariant/qvariant.pro index 468b7724c2..52af24ea85 100644 --- a/tests/auto/qvariant/qvariant.pro +++ b/tests/auto/qvariant/qvariant.pro @@ -1,5 +1,5 @@ load(qttest_p4) SOURCES += tst_qvariant.cpp -QT += network +QT += widgets network CONFIG+=insignificant_test diff --git a/tests/auto/qwidget/qwidget.pro b/tests/auto/qwidget/qwidget.pro index 0cd4a70e99..df0fdec006 100644 --- a/tests/auto/qwidget/qwidget.pro +++ b/tests/auto/qwidget/qwidget.pro @@ -1,6 +1,6 @@ load(qttest_p4) -QT += core-private gui-private +QT += widgets core-private gui-private widgets-private SOURCES += tst_qwidget.cpp RESOURCES = qwidget.qrc diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index eb110a246e..99b069487f 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -65,12 +65,13 @@ #include <qdockwidget.h> #include <qtoolbar.h> #include <QtGui/qpaintengine.h> -#include <private/qbackingstore_p.h> +#include <QtGui/qbackingstore.h> +#include <QtGui/qguiapplication.h> #include <qmenubar.h> #include <qtableview.h> -#include <QtGui/QGraphicsView> -#include <QtGui/QGraphicsProxyWidget> +#include <QtWidgets/QGraphicsView> +#include <QtWidgets/QGraphicsProxyWidget> #include "../../shared/util.h" @@ -102,6 +103,23 @@ #include <QtTest/QtTest> +#if defined(Q_OS_WIN) +# include <QtCore/qt_windows.h> +# include <QtGui/private/qguiapplication_p.h> +# include <QtGui/QPlatformNativeInterface> +# include <QtGui/QPlatformIntegration> + +static HWND winHandleOf(const QWidget *w) +{ + static QPlatformNativeInterface *nativeInterface + = QGuiApplicationPrivate::instance()->platformIntegration()->nativeInterface(); + if (void *handle = nativeInterface->nativeResourceForWindow("handle", w->window()->windowHandle())) + return reinterpret_cast<HWND>(handle); + qWarning() << "Cannot obtain native handle for " << w; + return 0; +} +#endif + #if defined(Q_WS_WIN) # include <qt_windows.h> # if !defined(Q_OS_WINCE) @@ -211,10 +229,6 @@ private slots: void restoreVersion1Geometry_data(); void restoreVersion1Geometry(); - void windowTitle(); - void windowModified(); - void windowIconText(); - void widgetAt(); #ifdef Q_WS_MAC void retainHIView(); @@ -322,7 +336,6 @@ private slots: void updateGeometry(); void updateGeometry_data(); void sendUpdateRequestImmediately(); - void painterRedirection(); void doubleRepaint(); #ifndef Q_WS_MAC void resizeInPaintEvent(); @@ -1245,7 +1258,7 @@ void tst_QWidget::visible_setWindowOpacity() QVERIFY( !testWidget->isVisible() ); testWidget->setWindowOpacity(0.5); #ifdef Q_OS_WIN - QVERIFY(::IsWindowVisible(testWidget->winId()) == FALSE); + QVERIFY(::IsWindowVisible(winHandleOf(testWidget)) == FALSE); #endif testWidget->setWindowOpacity(1.0); } @@ -3234,28 +3247,22 @@ void tst_QWidget::widgetAt() w2->lower(); qApp->processEvents(); - QTRY_VERIFY((wr = QApplication::widgetAt(100, 100))); - const bool match = (wr->objectName() == QString("w1")); + QTRY_VERIFY((wr = QApplication::widgetAt(100, 100)) && wr->objectName() == QString("w1")); w2->raise(); - QVERIFY(match); qApp->processEvents(); - QTRY_VERIFY((wr = QApplication::widgetAt(100, 100))); - QCOMPARE(wr->objectName(), QString("w2")); - + QTRY_VERIFY((wr = QApplication::widgetAt(100, 100)) && wr->objectName() == QString("w2")); QWidget *w3 = new QWidget(w2); w3->setGeometry(10,10,50,50); w3->setObjectName("w3"); w3->show(); qApp->processEvents(); - QTRY_VERIFY((wr = QApplication::widgetAt(100,100))); - QCOMPARE(wr->objectName(), QString("w3")); + QTRY_VERIFY((wr = QApplication::widgetAt(100,100)) && wr->objectName() == QString("w3")); w3->setAttribute(Qt::WA_TransparentForMouseEvents); qApp->processEvents(); - QTRY_VERIFY((wr = QApplication::widgetAt(100, 100))); - QCOMPARE(wr->objectName(), QString("w2")); + QTRY_VERIFY((wr = QApplication::widgetAt(100, 100)) && wr->objectName() == QString("w2")); QRegion rgn = QRect(QPoint(0,0), w2->size()); QPoint point = w2->mapFromGlobal(QPoint(100,100)); @@ -3381,249 +3388,6 @@ static CAknContextPane* ContextPane() } #endif -static QString visibleWindowTitle(QWidget *window, Qt::WindowState state = Qt::WindowNoState) -{ - QString vTitle; - -#ifdef Q_WS_WIN - Q_UNUSED(state); - const size_t maxTitleLength = 256; - wchar_t title[maxTitleLength]; - GetWindowText(window->winId(), title, maxTitleLength); - vTitle = QString::fromWCharArray(title); -#elif defined(Q_WS_X11) - /* - We can't check what the window manager displays, but we can - check what we tell the window manager to display. This will - have to do. - */ - Atom UTF8_STRING = XInternAtom(window->x11Info().display(), "UTF8_STRING", false); - Atom _NET_WM_NAME = XInternAtom(window->x11Info().display(), "_NET_WM_NAME", false); - Atom _NET_WM_ICON_NAME = XInternAtom(window->x11Info().display(), "_NET_WM_ICON_NAME", false); - uchar *data = 0; - ulong length = 0; - if (state == Qt::WindowMinimized) { - if (getProperty(window->x11Info().display(), window->winId(), - UTF8_STRING, _NET_WM_ICON_NAME, &data, &length)) { - vTitle = QString::fromUtf8((char *) data, length); - XFree(data); - } else { - XTextProperty text_prop; - if (XGetWMIconName(window->x11Info().display(), window->winId(), &text_prop)) { - vTitle = textPropertyToString(window->x11Info().display(), text_prop); - XFree((char *) text_prop.value); - } - } - } else { - if (getProperty(window->x11Info().display(), window->winId(), - UTF8_STRING, _NET_WM_NAME, &data, &length)) { - vTitle = QString::fromUtf8((char *) data, length); - XFree(data); - } else { - XTextProperty text_prop; - if (XGetWMName(window->x11Info().display(), window->winId(), &text_prop)) { - vTitle = textPropertyToString(window->x11Info().display(), text_prop); - XFree((char *) text_prop.value); - } - } - } -#elif defined(Q_WS_MAC) - vTitle = nativeWindowTitle(window, state); -#elif defined(Q_WS_QWS) - if (qwsServer) { - const QWSWindow *win = 0; - const QList<QWSWindow*> windows = qwsServer->clientWindows(); - for (int i = 0; i < windows.count(); ++i) { - const QWSWindow* w = windows.at(i); - if (w->winId() == window->winId()) { - win = w; - break; - } - } - if (win) - vTitle = win->caption(); - } -#elif defined (Q_WS_S60) - CAknTitlePane* titlePane = TitlePane(); - if(titlePane) - { - const TDesC* nTitle = titlePane->Text(); - vTitle = QString::fromUtf16(nTitle->Ptr(), nTitle->Length()); - } -#endif - - return vTitle; -} - -void tst_QWidget::windowTitle() -{ - QWidget widget(0); - widget.setWindowTitle("Application Name"); - widget.winId(); // Make sure the window is created... - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name")); - - widget.setWindowTitle("Application Name *"); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name *")); - - widget.setWindowTitle("Application Name[*]"); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name")); - - widget.setWindowTitle("Application Name[*][*]"); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name[*]")); - - widget.setWindowTitle("Application Name[*][*][*]"); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name[*]")); - - widget.setWindowTitle("Application Name[*][*][*][*]"); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name[*][*]")); -} - -void tst_QWidget::windowIconText() -{ -#ifdef Q_OS_SYMBIAN - QSKIP("Symbian/S60 windows don't have window icon text", SkipAll); -#endif - QWidget widget(0); - - widget.setWindowTitle("Application Name"); - widget.setWindowIconText("Application Minimized"); - widget.showNormal(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name")); - widget.showMinimized(); -#if defined(Q_WS_QWS) || defined(Q_OS_WINCE) - QEXPECT_FAIL(0, "Qt/Embedded/WinCE does not implement showMinimized()", Continue); - //See task 147193 for WinCE -#endif - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget, Qt::WindowMinimized), - QString("Application Minimized")); - - widget.setWindowTitle("Application Name[*]"); - widget.setWindowIconText("Application Minimized[*]"); - widget.showNormal(); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name")); - widget.showMinimized(); -#if defined (Q_WS_QWS) || defined(Q_OS_WINCE) - QEXPECT_FAIL(0, "Qt/Embedded/WinCE does not implement showMinimized()", Continue); - //See task 147193 for WinCE -#endif - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget, Qt::WindowMinimized), - QString("Application Minimized")); - - widget.setWindowModified(true); - widget.showNormal(); - QApplication::instance()->processEvents(); - if (widget.style()->styleHint(QStyle::SH_TitleBar_ModifyNotification, 0, &widget)) - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name*")); - else - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name")); - widget.showMinimized(); -#if defined (Q_WS_QWS) || defined(Q_OS_WINCE) - QEXPECT_FAIL(0, "Qt/Embedded/WinCE does not implement showMinimized()", Continue); - //See task 147193 for WinCE -#endif - QApplication::instance()->processEvents(); -#ifdef Q_WS_MAC - QCOMPARE(visibleWindowTitle(&widget, Qt::WindowMinimized), - QString("Application Minimized")); - QVERIFY(nativeWindowModified(&widget)); -#else - QCOMPARE(visibleWindowTitle(&widget, Qt::WindowMinimized), - QString("Application Minimized*")); -#endif -} - -void tst_QWidget::windowModified() -{ - QWidget widget(0); - widget.show(); - QTest::qWaitForWindowShown(&widget); -#ifndef Q_WS_MAC - QTest::ignoreMessage(QtWarningMsg, "QWidget::setWindowModified: The window title does not contain a '[*]' placeholder"); -#endif - widget.setWindowTitle("Application Name"); - QTest::qWait(10); - QTRY_COMPARE(visibleWindowTitle(&widget), QString("Application Name")); - -#ifdef Q_WS_MAC - widget.setWindowModified(true); - QVERIFY(nativeWindowModified(&widget)); -#else - widget.setWindowModified(true); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name")); - - widget.setWindowModified(false); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name")); - - widget.setWindowTitle("Application Name[*]"); - - widget.setWindowModified(true); - QApplication::instance()->processEvents(); - if (widget.style()->styleHint(QStyle::SH_TitleBar_ModifyNotification, 0, &widget)) - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name*")); - else - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name")); - - widget.setWindowModified(false); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name")); - - widget.setWindowTitle("Application[*] Name[*]"); - - widget.setWindowModified(true); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application* Name*")); - - widget.setWindowModified(false); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name")); - - widget.setWindowTitle("Application Name[*][*]"); - - widget.setWindowModified(true); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name[*]")); - - widget.setWindowModified(false); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name[*]")); - - widget.setWindowTitle("Application[*][*] Name[*][*]"); - - widget.setWindowModified(true); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application[*] Name[*]")); - - widget.setWindowModified(false); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application[*] Name[*]")); - - widget.setWindowTitle("Application[*] Name[*][*][*]"); - - widget.setWindowModified(true); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application* Name[*]*")); - - widget.setWindowModified(false); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application Name[*]")); - - widget.setWindowTitle("Application[*][*][*] Name[*][*][*]"); - - widget.setWindowModified(true); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application[*]* Name[*]*")); - - widget.setWindowModified(false); - QApplication::instance()->processEvents(); - QCOMPARE(visibleWindowTitle(&widget), QString("Application[*] Name[*]")); -#endif -} - void tst_QWidget::task110173() { QWidget w; @@ -5424,6 +5188,7 @@ void tst_QWidget::showAndMoveChild() QDesktopWidget desktop; QRect desktopDimensions = desktop.availableGeometry(&parent); + desktopDimensions = desktopDimensions.adjusted(64, 64, -64, -64); parent.setGeometry(desktopDimensions); parent.setPalette(Qt::red); @@ -8046,64 +7811,6 @@ void tst_QWidget::sendUpdateRequestImmediately() QCOMPARE(updateWidget.numUpdateRequestEvents, 1); } -class RedirectedWidget : public QWidget -{ -protected: - void paintEvent(QPaintEvent *) - { - // Verify that the widget has a redirection set. The widget is redirected to - // the backing store on all platforms using it; otherwise to itself if the wrect - // does not start in (0, 0) or it has a mask set. - QPaintDevice *oldRedirection = QPainter::redirected(this); -#ifndef Q_WS_MAC - QVERIFY(oldRedirection); -#endif - - QImage image(size(), QImage::Format_RGB32); - image.fill(Qt::blue); - - { - QPainter painter(this); - QCOMPARE(painter.device(), static_cast<QPaintDevice *>(this)); - } - - QPainter::setRedirected(this, &image); - QCOMPARE(QPainter::redirected(this), static_cast<QPaintDevice *>(&image)); - - QPainter painter(this); - painter.fillRect(rect(), Qt::red); - - QPainter::restoreRedirected(this); - QCOMPARE(QPainter::redirected(this), oldRedirection); - - for (int i = 0; i < image.height(); ++i) - for (int j = 0; j < image.width(); ++j) - QCOMPARE(image.pixel(j, i), QColor(Qt::red).rgb()); - } - -}; - -// Test to make sure we're compatible in the particular case where QPainter::setRedirected -// actually works. It has been broken for all other cases since Qt 4.1.4 (backing store). -// QWidget::render is the modern and more powerful way of doing the same. -void tst_QWidget::painterRedirection() -{ - RedirectedWidget widget; - // Set FramelessWindowHint and mask to trigger internal painter redirection on the Mac. - widget.setWindowFlags(widget.windowFlags() | Qt::FramelessWindowHint); - widget.setMask(QRect(10, 10, 50, 50)); - widget.setFixedSize(100, 200); - widget.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&widget); -#endif - QPixmap pixmap(widget.size()); - QPainter::setRedirected(&widget, &pixmap, QPoint()); - widget.repaint(); - QCOMPARE(QPainter::redirected(&widget), static_cast<QPaintDevice *>(&pixmap)); -} - - void tst_QWidget::doubleRepaint() { #ifdef Q_OS_IRIX @@ -9392,7 +9099,7 @@ void tst_QWidget::destroyBackingStore() QTRY_VERIFY(w.numPaintEvents > 0); w.reset(); w.update(); - qt_widget_private(&w)->topData()->backingStore.create(&w); + qt_widget_private(&w)->topData()->backingStoreTracker.create(&w); w.update(); QApplication::processEvents(); @@ -9416,7 +9123,7 @@ QWidgetBackingStore* backingStore(QWidget &widget) QWidgetBackingStore *backingStore = 0; #ifdef QT_BUILD_INTERNAL if (QTLWExtra *topExtra = qt_widget_private(&widget)->maybeTopData()) - backingStore = topExtra->backingStore.data(); + backingStore = topExtra->backingStoreTracker.data(); #endif return backingStore; } @@ -10251,12 +9958,12 @@ class scrollWidgetWBS : public QWidget public: void deleteBackingStore() { - static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->backingStore.destroy(); + static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->backingStoreTracker.destroy(); } void enableBackingStore() { if (!static_cast<QWidgetPrivate*>(d_ptr.data())->maybeBackingStore()) { - static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->backingStore.create(this); + static_cast<QWidgetPrivate*>(d_ptr.data())->topData()->backingStoreTracker.create(this); static_cast<QWidgetPrivate*>(d_ptr.data())->invalidateBuffer(this->rect()); repaint(); } @@ -10487,18 +10194,26 @@ void tst_QWidget::nativeChildFocus() QLineEdit *p2 = new QLineEdit; layout->addWidget(p1); layout->addWidget(p2); +#if 1 p1->setObjectName("p1"); p2->setObjectName("p2"); +#endif w.show(); +#if 1 w.activateWindow(); p1->setFocus(); p1->setAttribute(Qt::WA_NativeWindow); p2->setAttribute(Qt::WA_NativeWindow); QApplication::processEvents(); QTest::qWaitForWindowShown(&w); + QTest::qWait(10); + qDebug() << "checking active window:" << QApplication::activeWindow(); QCOMPARE(QApplication::activeWindow(), &w); QCOMPARE(QApplication::focusWidget(), static_cast<QWidget*>(p1)); +#endif + + QTest::qWait(1000); } QTEST_MAIN(tst_QWidget) diff --git a/tests/auto/qwidget_window/qwidget_window.pro b/tests/auto/qwidget_window/qwidget_window.pro index df7d68739b..dd5837012c 100644 --- a/tests/auto/qwidget_window/qwidget_window.pro +++ b/tests/auto/qwidget_window/qwidget_window.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qwidget_window.cpp x11 { diff --git a/tests/auto/qwidgetaction/qwidgetaction.pro b/tests/auto/qwidgetaction/qwidgetaction.pro index cc80e58fe3..3e037c2efb 100644 --- a/tests/auto/qwidgetaction/qwidgetaction.pro +++ b/tests/auto/qwidgetaction/qwidgetaction.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qwidgetaction.cpp diff --git a/tests/auto/qwindow/qwindow.pro b/tests/auto/qwindow/qwindow.pro new file mode 100644 index 0000000000..560945322c --- /dev/null +++ b/tests/auto/qwindow/qwindow.pro @@ -0,0 +1,6 @@ +load(qttest_p4) + +QT += core-private gui-private + +SOURCES += tst_qwindow.cpp + diff --git a/tests/auto/qtessellator/arc.cpp b/tests/auto/qwindow/tst_qwindow.cpp index 64fe0e5199..77e3d5f88c 100644 --- a/tests/auto/qtessellator/arc.cpp +++ b/tests/auto/qwindow/tst_qwindow.cpp @@ -38,12 +38,37 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "arc.h" -#include "dataparser.h" -#include <QString> +#include <qwindow.h> +#include <qtest.h> -FullData arcData() +class tst_QWindow: public QObject { - return parseFile(":/arc.data"); + Q_OBJECT + +private slots: + void mapGlobal(); +}; + + +void tst_QWindow::mapGlobal() +{ + QWindow a; + QWindow b(&a); + QWindow c(&b); + + a.setGeometry(10, 10, 300, 300); + b.setGeometry(20, 20, 200, 200); + c.setGeometry(40, 40, 100, 100); + + QCOMPARE(a.mapToGlobal(QPoint(100, 100)), QPoint(110, 110)); + QCOMPARE(b.mapToGlobal(QPoint(100, 100)), QPoint(130, 130)); + QCOMPARE(c.mapToGlobal(QPoint(100, 100)), QPoint(170, 170)); + + QCOMPARE(a.mapFromGlobal(QPoint(100, 100)), QPoint(90, 90)); + QCOMPARE(b.mapFromGlobal(QPoint(100, 100)), QPoint(70, 70)); + QCOMPARE(c.mapFromGlobal(QPoint(100, 100)), QPoint(30, 30)); } + +#include <tst_qwindow.moc> +QTEST_MAIN(tst_QWindow); diff --git a/tests/auto/qwindowsurface/qwindowsurface.pro b/tests/auto/qwindowsurface/qwindowsurface.pro index f236793b91..f1e8bf6070 100644 --- a/tests/auto/qwindowsurface/qwindowsurface.pro +++ b/tests/auto/qwindowsurface/qwindowsurface.pro @@ -1,5 +1,6 @@ load(qttest_p4) +QT += widgets widgets-private QT += gui-private SOURCES += tst_qwindowsurface.cpp diff --git a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp index 5810ec3580..11348e9162 100644 --- a/tests/auto/qwindowsurface/tst_qwindowsurface.cpp +++ b/tests/auto/qwindowsurface/tst_qwindowsurface.cpp @@ -45,7 +45,7 @@ #include <QPalette> #include <QWindowsStyle> -#ifndef Q_WS_MAC +#if !defined(Q_WS_MAC) && QT_VERSION < 0x050000 // Fixme Qt 5 #include <private/qwindowsurface_p.h> #include <QDesktopWidget> diff --git a/tests/auto/qwizard/qwizard.pro b/tests/auto/qwizard/qwizard.pro index a22e45cf19..6d508470c7 100644 --- a/tests/auto/qwizard/qwizard.pro +++ b/tests/auto/qwizard/qwizard.pro @@ -1,4 +1,5 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qwizard.cpp #SOURCES += /home/jasmin/dev/solutions/widgets/qtwizard/src/qtwizard.cpp #HEADERS += /home/jasmin/dev/solutions/widgets/qtwizard/src/qtwizard.h diff --git a/tests/auto/qworkspace/qworkspace.pro b/tests/auto/qworkspace/qworkspace.pro index de4d29a229..0b8a604fe8 100644 --- a/tests/auto/qworkspace/qworkspace.pro +++ b/tests/auto/qworkspace/qworkspace.pro @@ -1,2 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qworkspace.cpp diff --git a/tests/auto/qwsembedwidget/qwsembedwidget.pro b/tests/auto/qwsembedwidget/qwsembedwidget.pro index c34212b06a..640b52d384 100644 --- a/tests/auto/qwsembedwidget/qwsembedwidget.pro +++ b/tests/auto/qwsembedwidget/qwsembedwidget.pro @@ -1,2 +1,3 @@ load(qttest_p4) +QT += widgets SOURCES += tst_qwsembedwidget.cpp diff --git a/tests/auto/uiloader/uiloader/uiloader.pro b/tests/auto/uiloader/uiloader/uiloader.pro index b959d438b7..12624703ff 100644 --- a/tests/auto/uiloader/uiloader/uiloader.pro +++ b/tests/auto/uiloader/uiloader/uiloader.pro @@ -13,7 +13,7 @@ win32 { } } -QT += xml svg network +QT += widgets network wince*|symbian: { configuration.files = ../*.ini |