summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-09-01 16:38:18 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-09-01 16:38:18 (GMT)
commitfb920977b1afd105ae87109d9ee930f5a2fe0b90 (patch)
treef13149d253529f800d067e7f97aa356e8d3d3229 /tests/auto
parent35d05651d3eabeb981f0ffa0251410df4d991d36 (diff)
parente4804c5d3d2e80cc7f57936591374d29478dbb2a (diff)
downloadQt-fb920977b1afd105ae87109d9ee930f5a2fe0b90.zip
Qt-fb920977b1afd105ae87109d9ee930f5a2fe0b90.tar.gz
Qt-fb920977b1afd105ae87109d9ee930f5a2fe0b90.tar.bz2
Merge branch '4.6'
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gestures/customgesturerecognizer.cpp208
-rw-r--r--tests/auto/gestures/customgesturerecognizer.h228
-rw-r--r--tests/auto/gestures/gestures.pro3
-rw-r--r--tests/auto/gestures/tst_gestures.cpp962
-rw-r--r--tests/auto/qabstractitemmodel/dynamictreemodel.cpp67
-rw-r--r--tests/auto/qabstractitemmodel/dynamictreemodel.h67
-rw-r--r--tests/auto/qabstractitemmodel/qabstractitemmodel.pro2
-rw-r--r--tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp2
-rw-r--r--tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp20
-rw-r--r--tests/auto/qatomicint/tst_qatomicint.cpp44
-rw-r--r--tests/auto/qatomicpointer/tst_qatomicpointer.cpp48
-rw-r--r--tests/auto/qbytearray/tst_qbytearray.cpp4
-rw-r--r--tests/auto/qgl/tst_qgl.cpp63
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp205
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp7
-rw-r--r--tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp8
-rw-r--r--tests/auto/qicon/tst_qicon.cpp3
-rw-r--r--tests/auto/qicon/tst_qicon.qrc14
-rw-r--r--tests/auto/qimagereader/images/qt.gifbin0 -> 26504 bytes
-rw-r--r--tests/auto/qimagereader/images/qt1.gifbin0 -> 7216 bytes
-rw-r--r--tests/auto/qimagereader/images/qt2.gifbin0 -> 5559 bytes
-rw-r--r--tests/auto/qimagereader/images/qt3.gifbin0 -> 4702 bytes
-rw-r--r--tests/auto/qimagereader/images/qt4.gifbin0 -> 4310 bytes
-rw-r--r--tests/auto/qimagereader/images/qt5.gifbin0 -> 4234 bytes
-rw-r--r--tests/auto/qimagereader/images/qt6.gifbin0 -> 4732 bytes
-rw-r--r--tests/auto/qimagereader/images/qt7.gifbin0 -> 5265 bytes
-rw-r--r--tests/auto/qimagereader/images/qt8.gifbin0 -> 6144 bytes
-rw-r--r--tests/auto/qimagereader/qimagereader.qrc13
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp13
-rw-r--r--tests/auto/qmake/testdata/include_function/main.cpp41
-rw-r--r--tests/auto/qmargins/qmargins.pro3
-rw-r--r--tests/auto/qmargins/tst_qmargins.cpp108
-rw-r--r--tests/auto/qnetworkreply/tst_qnetworkreply.cpp6
-rw-r--r--tests/auto/qpainterpath/tst_qpainterpath.cpp5
-rw-r--r--tests/auto/qpixmap/tst_qpixmap.cpp29
-rw-r--r--tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp14
-rw-r--r--tests/auto/qsqldatabase/tst_qsqldatabase.cpp41
-rw-r--r--tests/auto/qsslcertificate/tst_qsslcertificate.cpp6
-rw-r--r--tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp82
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp30
-rw-r--r--tests/auto/xmlpatternsview/view/FunctionSignaturesView.cpp41
-rw-r--r--tests/auto/xmlpatternsview/view/MainWindow.cpp41
-rw-r--r--tests/auto/xmlpatternsview/view/TestCaseView.cpp41
-rw-r--r--tests/auto/xmlpatternsview/view/TestResultView.cpp41
-rw-r--r--tests/auto/xmlpatternsview/view/TreeSortFilter.cpp41
-rw-r--r--tests/auto/xmlpatternsview/view/UserTestCase.cpp41
-rw-r--r--tests/auto/xmlpatternsview/view/XDTItemItem.cpp41
-rw-r--r--tests/auto/xmlpatternsview/view/main.cpp41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/ASTItem.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/ExpressionNamer.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/Global.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/ResultThreader.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/TestBaseLine.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/TestCase.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/TestResult.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/TestResultHandler.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/Worker.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/XMLWriter.h41
-rw-r--r--tests/auto/xmlpatternsxqts/lib/XQTSTestCase.h41
62 files changed, 848 insertions, 2400 deletions
diff --git a/tests/auto/gestures/customgesturerecognizer.cpp b/tests/auto/gestures/customgesturerecognizer.cpp
deleted file mode 100644
index 96028be..0000000
--- a/tests/auto/gestures/customgesturerecognizer.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "customgesturerecognizer.h"
-#include "qgesture.h"
-
-const char* SingleshotGestureRecognizer::Name = "SingleshotGesture";
-const char* PinchGestureRecognizer::Name = "PinchGesture";
-const char* SecondFingerGestureRecognizer::Name = "SecondFingerGesture";
-const char* PanGestureRecognizer::Name = "PanGesture";
-
-SingleshotGestureRecognizer::SingleshotGestureRecognizer(QObject *parent)
- : QGestureRecognizer(QString(SingleshotGestureRecognizer::Name), parent)
-{
- gesture = new SingleshotGesture(this, SingleshotGestureRecognizer::Name);
-}
-
-QGestureRecognizer::Result SingleshotGestureRecognizer::filterEvent(const QEvent *event)
-{
- if (event->type() == SingleshotEvent::Type) {
- gesture->setHotSpot(static_cast<const SingleshotEvent*>(event)->point);
- return QGestureRecognizer::GestureFinished;
- }
- return QGestureRecognizer::NotGesture;
-}
-
-void SingleshotGestureRecognizer::reset()
-{
- gesture->setHotSpot(QPoint());
- gesture->offset = QPoint();
-}
-
-PinchGestureRecognizer::PinchGestureRecognizer(QObject *parent)
- : QGestureRecognizer(PinchGestureRecognizer::Name, parent)
-{
- gesture = new PinchGesture(this, PinchGestureRecognizer::Name);
-}
-
-QGestureRecognizer::Result PinchGestureRecognizer::filterEvent(const QEvent *event)
-{
- if (event->type() != TouchEvent::Type)
- return QGestureRecognizer::Ignore;
-
- const TouchEvent *e = static_cast<const TouchEvent*>(event);
- if (e->points[0].state == TouchPoint::Begin)
- gesture->startPoints[0] = e->points[0];
- if (e->points[1].state == TouchPoint::Begin)
- gesture->startPoints[1] = e->points[1];
- gesture->lastPoints[0] = gesture->points[0];
- gesture->lastPoints[1] = gesture->points[1];
- gesture->points[0] = e->points[0];
- gesture->points[1] = e->points[1];
- if (((e->points[0].state == TouchPoint::Begin || e->points[0].state == TouchPoint::Update))) {
- if (e->points[1].state == TouchPoint::End || e->points[1].state == TouchPoint::None)
- return MaybeGesture;
- return GestureStarted;
- } else if (((e->points[1].state == TouchPoint::Begin || e->points[1].state == TouchPoint::Update))) {
- if (e->points[0].state == TouchPoint::End || e->points[0].state == TouchPoint::None)
- return MaybeGesture;
- return GestureStarted;
- } else if ((e->points[0].state == TouchPoint::End && e->points[1].state == TouchPoint::End) ||
- (e->points[0].state == TouchPoint::End && e->points[1].state == TouchPoint::None) ||
- (e->points[0].state == TouchPoint::None && e->points[1].state == TouchPoint::End)) {
- return QGestureRecognizer::NotGesture;
- }
- return QGestureRecognizer::NotGesture;
-}
-
-void PinchGestureRecognizer::reset()
-{
- gesture->startPoints[0] = TouchPoint();
- gesture->startPoints[1] = TouchPoint();
- gesture->lastPoints[0] = TouchPoint();
- gesture->lastPoints[1] = TouchPoint();
- gesture->points[0] = TouchPoint();
- gesture->points[1] = TouchPoint();
- gesture->offset = QPoint();
-}
-
-SecondFingerGestureRecognizer::SecondFingerGestureRecognizer(QObject *parent)
- : QGestureRecognizer(SecondFingerGestureRecognizer::Name, parent)
-{
- gesture = new SecondFingerGesture(this, SecondFingerGestureRecognizer::Name);
-}
-
-QGestureRecognizer::Result SecondFingerGestureRecognizer::filterEvent(const QEvent *event)
-{
- if (event->type() != TouchEvent::Type)
- return QGestureRecognizer::Ignore;
-
- const TouchEvent *e = static_cast<const TouchEvent*>(event);
- if (e->points[1].state != TouchPoint::None) {
- if (e->points[1].state == TouchPoint::Begin)
- gesture->startPoint = e->points[1];
- gesture->lastPoint = gesture->point;
- gesture->point = e->points[1];
- if (e->points[1].state == TouchPoint::End)
- return QGestureRecognizer::GestureFinished;
- else if (e->points[1].state != TouchPoint::None)
- return QGestureRecognizer::GestureStarted;
- }
- return QGestureRecognizer::NotGesture;
-}
-
-void SecondFingerGestureRecognizer::reset()
-{
- gesture->startPoint = TouchPoint();
- gesture->lastPoint = TouchPoint();
- gesture->point = TouchPoint();
- gesture->offset = QPoint();
-}
-
-PanGestureRecognizer::PanGestureRecognizer(QObject *parent)
- : QGestureRecognizer(PanGestureRecognizer::Name, parent)
-{
- gesture = new PanGesture(this, PanGestureRecognizer::Name);
-}
-
-QGestureRecognizer::Result PanGestureRecognizer::filterEvent(const QEvent *event)
-{
- if (event->type() != QEvent::TouchBegin &&
- event->type() != QEvent::TouchUpdate &&
- event->type() != QEvent::TouchEnd)
- return QGestureRecognizer::Ignore;
-
- const QTouchEvent *e = static_cast<const QTouchEvent*>(event);
- const QList<QTouchEvent::TouchPoint> &points = e->touchPoints();
-
- if (points.size() >= 1) {
- gesture->lastPoints[0] = gesture->points[0];
- gesture->points[0].id = points.at(0).id();
- gesture->points[0].pt = points.at(0).startPos().toPoint();
- gesture->points[0].state = (TouchPoint::State)points.at(0).state();
- if (points.at(0).state() == Qt::TouchPointPressed) {
- gesture->startPoints[0] = gesture->points[0];
- gesture->lastPoints[0] = gesture->points[0];
- }
- }
- if (points.size() >= 2) {
- gesture->lastPoints[1] = gesture->points[1];
- gesture->points[1].id = points.at(1).id();
- gesture->points[1].pt = points.at(1).startPos().toPoint();
- gesture->points[1].state = (TouchPoint::State)points.at(1).state();
- if (points.at(1).state() == Qt::TouchPointPressed) {
- gesture->startPoints[1] = gesture->points[1];
- gesture->lastPoints[1] = gesture->points[1];
- }
- }
-
- if (points.size() == 2)
- return QGestureRecognizer::GestureStarted;
- if (points.size() > 2)
- return QGestureRecognizer::MaybeGesture;
- if (points.at(0).state() == Qt::TouchPointPressed)
- return QGestureRecognizer::MaybeGesture;
- if (points.at(0).state() == Qt::TouchPointReleased)
- return QGestureRecognizer::GestureFinished;
- return QGestureRecognizer::GestureStarted;
-}
-
-void PanGestureRecognizer::reset()
-{
- gesture->startPoints[0] = TouchPoint();
- gesture->startPoints[1] = TouchPoint();
- gesture->lastPoints[0] = TouchPoint();
- gesture->lastPoints[1] = TouchPoint();
- gesture->points[0] = TouchPoint();
- gesture->points[1] = TouchPoint();
- gesture->offset = QPoint();
-}
diff --git a/tests/auto/gestures/customgesturerecognizer.h b/tests/auto/gestures/customgesturerecognizer.h
deleted file mode 100644
index 2a24efb..0000000
--- a/tests/auto/gestures/customgesturerecognizer.h
+++ /dev/null
@@ -1,228 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef CUSTOMGESTURERECOGNIZER_H
-#define CUSTOMGESTURERECOGNIZER_H
-
-#include "qgesturerecognizer.h"
-#include "qgesture.h"
-#include "qevent.h"
-
-class SingleshotEvent : public QEvent
-{
-public:
- static const int Type = QEvent::User + 1;
-
- QPoint point;
-
- explicit SingleshotEvent(int x = 0, int y = 0)
- : QEvent(QEvent::Type(Type)), point(x, y) { }
-};
-
-class SingleshotGesture : public QGesture
-{
- Q_OBJECT
-public:
- SingleshotGesture(QObject *parent, const QString &type)
- : QGesture(parent, type) { }
-
- QPoint offset;
-
-protected:
- void translate(const QPoint &pt)
- {
- offset += pt;
- }
-};
-
-class SingleshotGestureRecognizer : public QGestureRecognizer
-{
- Q_OBJECT
-public:
- static const char *Name;
-
- SingleshotGestureRecognizer(QObject *parent = 0);
-
- QGestureRecognizer::Result filterEvent(const QEvent *event);
- QGesture* getGesture() { return gesture; }
- void reset();
-
-private:
- SingleshotGesture *gesture;
-};
-
-struct TouchPoint {
- enum State
- {
- None = 0,
- Begin = Qt::TouchPointPressed,
- Update = Qt::TouchPointMoved,
- End = Qt::TouchPointReleased
- };
- int id;
- QPoint pt;
- State state;
- TouchPoint() : id(0), state(None) { }
- TouchPoint(int id_, int x_, int y_, State state_) : id(id_), pt(x_, y_), state(state_) { }
-};
-
-class TouchEvent : public QEvent
-{
-public:
- static const int Type = QEvent::User + 2;
-
- TouchEvent()
- : QEvent(QEvent::Type(Type))
- {
- }
-
- TouchPoint points[2];
-};
-
-class PinchGesture : public QGesture
-{
- Q_OBJECT
-public:
- PinchGesture(QObject *parent, const QString &type)
- : QGesture(parent, type) { }
-
- TouchPoint startPoints[2];
- TouchPoint lastPoints[2];
- TouchPoint points[2];
-
- QPoint offset;
-
-protected:
- void translate(const QPoint &pt)
- {
- offset += pt;
- }
-};
-
-class PinchGestureRecognizer : public QGestureRecognizer
-{
- Q_OBJECT
-public:
- static const char *Name;
-
- PinchGestureRecognizer(QObject *parent = 0);
-
- QGestureRecognizer::Result filterEvent(const QEvent *event);
- QGesture* getGesture() { return gesture; }
- void reset();
-
-private:
- PinchGesture *gesture;
-};
-
-class SecondFingerGesture : public QGesture
-{
- Q_OBJECT
-public:
- SecondFingerGesture(QObject *parent, const QString &type)
- : QGesture(parent, type) { }
-
- TouchPoint startPoint;
- TouchPoint lastPoint;
- TouchPoint point;
-
- QPoint offset;
-
-protected:
- void translate(const QPoint &pt)
- {
- offset += pt;
- }
-};
-
-class SecondFingerGestureRecognizer : public QGestureRecognizer
-{
- Q_OBJECT
-public:
- static const char *Name;
-
- SecondFingerGestureRecognizer(QObject *parent = 0);
-
- QGestureRecognizer::Result filterEvent(const QEvent *event);
- QGesture* getGesture() { return gesture; }
- void reset();
-
-private:
- SecondFingerGesture *gesture;
-};
-
-class PanGesture : public QGesture
-{
- Q_OBJECT
-public:
- PanGesture(QObject *parent, const QString &type)
- : QGesture(parent, type) { }
-
- TouchPoint startPoints[2];
- TouchPoint lastPoints[2];
- TouchPoint points[2];
-
- QPoint offset;
-
-protected:
- void translate(const QPoint &pt)
- {
- offset += pt;
- }
-};
-
-class PanGestureRecognizer : public QGestureRecognizer
-{
- Q_OBJECT
-public:
- static const char *Name;
-
- PanGestureRecognizer(QObject *parent = 0);
-
- QGestureRecognizer::Result filterEvent(const QEvent *event);
- QGesture* getGesture() { return gesture; }
- void reset();
-
-private:
- PanGesture *gesture;
-};
-
-#endif
diff --git a/tests/auto/gestures/gestures.pro b/tests/auto/gestures/gestures.pro
deleted file mode 100644
index ac99b19..0000000
--- a/tests/auto/gestures/gestures.pro
+++ /dev/null
@@ -1,3 +0,0 @@
-load(qttest_p4)
-SOURCES += tst_gestures.cpp customgesturerecognizer.cpp
-HEADERS += customgesturerecognizer.h
diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp
deleted file mode 100644
index 85fd355..0000000
--- a/tests/auto/gestures/tst_gestures.cpp
+++ /dev/null
@@ -1,962 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the test suite of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#include <QtGui>
-
-#include <QtTest/QtTest>
-
-#include "customgesturerecognizer.h"
-
-//TESTED_CLASS=
-//TESTED_FILES=
-
-// color generator for syntax highlighting from QQ-26 by Helder Correia
-QVector<QColor> highlight(const QColor &bg, const
- QColor &fg, int noColors)
-{
- QVector<QColor> colors;
- const int HUE_BASE = (bg.hue() == -1) ? 90 : bg.hue();
- int h, s, v;
- for (int i = 0; i < noColors; i++) {
- h = int(HUE_BASE + (360.0 / noColors * i)) % 360;
- s = 240;
- v = int(qMax(bg.value(), fg.value()) * 0.85);
-
- const int M = 35;
- if ((h < bg.hue() + M && h > bg.hue() - M)
- || (h < fg.hue() + M && h > fg.hue() - M))
- {
- h = ((bg.hue() + fg.hue()) / (i+1)) % 360;
- s = ((bg.saturation() + fg.saturation() + 2*i)
- / 2) % 256;
- v = ((bg.value() + fg.value() + 2*i) / 2)
- % 256;
- }
- colors.append(QColor::fromHsv(h, s, v));
- }
- return colors;
-}
-
-
-// a hack to mark an event as spontaneous.
-class QETWidget
-{
-public:
- static void setSpont(QEvent *event, bool spont) { event->spont = spont; }
-};
-
-struct GestureState
-{
- int seenGestureEvent;
- struct LastGestureEvent
- {
- struct SingleshotGesture
- {
- bool delivered;
- QPoint offset;
- } singleshot;
- struct PinchGesture
- {
- bool delivered;
- TouchPoint startPoints[2];
- TouchPoint lastPoints[2];
- TouchPoint points[2];
- QPoint offset;
- } pinch;
- struct SecondFingerGesture
- {
- bool delivered;
- TouchPoint startPoint;
- TouchPoint lastPoint;
- TouchPoint point;
- QPoint offset;
- } secondfinger;
- struct PanGesture
- {
- bool delivered;
- TouchPoint startPoints[2];
- TouchPoint lastPoints[2];
- TouchPoint points[2];
- QPoint offset;
- } pan;
- QSet<QString> cancelled;
- } last;
-
- GestureState() { reset(); }
- void reset()
- {
- seenGestureEvent = 0;
- last.singleshot.delivered = false;
- last.singleshot.offset = QPoint();
- last.pinch.delivered = false;
- last.pinch.startPoints[0] = TouchPoint();
- last.pinch.startPoints[1] = TouchPoint();
- last.pinch.lastPoints[0] = TouchPoint();
- last.pinch.lastPoints[1] = TouchPoint();
- last.pinch.points[0] = TouchPoint();
- last.pinch.points[1] = TouchPoint();
- last.pinch.offset = QPoint();
- last.secondfinger.delivered = false;
- last.secondfinger.startPoint = TouchPoint();
- last.secondfinger.lastPoint = TouchPoint();
- last.secondfinger.point = TouchPoint();
- last.secondfinger.offset = QPoint();
- last.pan.delivered = false;
- last.pan.startPoints[0] = TouchPoint();
- last.pan.startPoints[1] = TouchPoint();
- last.pan.lastPoints[0] = TouchPoint();
- last.pan.lastPoints[1] = TouchPoint();
- last.pan.points[0] = TouchPoint();
- last.pan.points[1] = TouchPoint();
- last.cancelled.clear();
- }
-};
-
-struct TouchState
-{
- int seenTouchBeginEvent;
- int seenTouchUpdateEvent;
- int seenTouchEndEvent;
-
- TouchState() { reset(); }
- void reset()
- {
- seenTouchBeginEvent = seenTouchUpdateEvent = seenTouchEndEvent = 0;
- }
-};
-
-class GestureWidget : public QWidget
-{
- Q_OBJECT
- static QVector<QColor> colors;
- static int numberOfWidgets;
-
-public:
- enum Type { DoNotGrabGestures, GrabAllGestures, GrabSingleshot,
- GrabPinch, GrabSecondFinger, GrabPan };
-
- static const int LeftMargin = 10;
- static const int TopMargin = 20;
-
- GestureWidget(Type type = GrabAllGestures)
- {
- if (colors.isEmpty()) {
- colors = highlight(palette().color(QPalette::Window), palette().color(QPalette::Text), 5);
- }
- QPalette p = palette();
- p.setColor(QPalette::Window, colors[numberOfWidgets % colors.size()]);
- setPalette(p);
- setAutoFillBackground(true);
- ++numberOfWidgets;
-
- QVBoxLayout *l = new QVBoxLayout(this);
- l->setSpacing(0);
- l->setContentsMargins(LeftMargin, TopMargin, LeftMargin, TopMargin);
-
- singleshotGestureId = -1;
- pinchGestureId = -1;
- secondFingerGestureId = -1;
- panGestureId = -1;
- if (type == GrabAllGestures || type == GrabSingleshot) {
- singleshotGestureId = grabGesture(SingleshotGestureRecognizer::Name);
- }
- if (type == GrabAllGestures || type == GrabPinch) {
- pinchGestureId = grabGesture(PinchGestureRecognizer::Name);
- }
- if (type == GrabAllGestures || type == GrabSecondFinger) {
- secondFingerGestureId = grabGesture(SecondFingerGestureRecognizer::Name);
- }
- if (type == GrabAllGestures || type == GrabPan) {
- panGestureId = grabGesture(PanGestureRecognizer::Name);
- }
- reset();
- }
- ~GestureWidget()
- {
- --numberOfWidgets;
- ungrabGestures();
- }
-
- void grabSingleshotGesture()
- {
- singleshotGestureId = grabGesture(SingleshotGestureRecognizer::Name);
- }
- void grabPinchGesture()
- {
- pinchGestureId = grabGesture(PinchGestureRecognizer::Name);
- }
- void grabSecondFingerGesture()
- {
- secondFingerGestureId = grabGesture(SecondFingerGestureRecognizer::Name);
- }
- void grabPanGesture()
- {
- panGestureId = grabGesture(PanGestureRecognizer::Name);
- }
- void ungrabGestures()
- {
- releaseGesture(singleshotGestureId);
- singleshotGestureId = -1;
- releaseGesture(pinchGestureId);
- pinchGestureId = -1;
- releaseGesture(secondFingerGestureId);
- secondFingerGestureId = -1;
- releaseGesture(panGestureId);
- panGestureId = -1;
- }
-
- int singleshotGestureId;
- int pinchGestureId;
- int secondFingerGestureId;
- int panGestureId;
-
- bool shouldAcceptSingleshotGesture;
- bool shouldAcceptPinchGesture;
- bool shouldAcceptSecondFingerGesture;
- bool shouldAcceptPanGesture;
-
- GestureState gesture;
- TouchState touch;
-
- void reset()
- {
- shouldAcceptSingleshotGesture = true;
- shouldAcceptPinchGesture = true;
- shouldAcceptSecondFingerGesture = true;
- shouldAcceptPanGesture = true;
- gesture.reset();
- touch.reset();
- }
-protected:
- bool event(QEvent *event)
- {
- if (event->type() == QEvent::TouchBegin) {
- event->accept();
- ++touch.seenTouchBeginEvent;
- return true;
- } else if (event->type() == QEvent::TouchUpdate) {
- ++touch.seenTouchUpdateEvent;
- } else if (event->type() == QEvent::TouchEnd) {
- ++touch.seenTouchEndEvent;
- } else if (event->type() == QEvent::Gesture) {
- QGestureEvent *e = static_cast<QGestureEvent*>(event);
- ++gesture.seenGestureEvent;
- if (SingleshotGesture *g = (SingleshotGesture*)e->gesture(SingleshotGestureRecognizer::Name)) {
- gesture.last.singleshot.delivered = true;
- gesture.last.singleshot.offset = g->offset;
- if (shouldAcceptSingleshotGesture)
- g->accept();
- }
- if (PinchGesture *g = (PinchGesture*)e->gesture(PinchGestureRecognizer::Name)) {
- gesture.last.pinch.delivered = true;
- gesture.last.pinch.startPoints[0] = g->startPoints[0];
- gesture.last.pinch.startPoints[1] = g->startPoints[1];
- gesture.last.pinch.lastPoints[0] = g->lastPoints[0];
- gesture.last.pinch.lastPoints[1] = g->lastPoints[1];
- gesture.last.pinch.points[0] = g->points[0];
- gesture.last.pinch.points[1] = g->points[1];
- gesture.last.pinch.offset = g->offset;
- if (shouldAcceptPinchGesture)
- g->accept();
- }
- if (SecondFingerGesture *g = (SecondFingerGesture*)e->gesture(SecondFingerGestureRecognizer::Name)) {
- gesture.last.secondfinger.delivered = true;
- gesture.last.secondfinger.startPoint = g->startPoint;
- gesture.last.secondfinger.lastPoint = g->lastPoint;
- gesture.last.secondfinger.point = g->point;
- gesture.last.secondfinger.offset = g->offset;
- if (shouldAcceptSecondFingerGesture)
- g->accept();
- }
- if (PanGesture *g = (PanGesture*)e->gesture(PanGestureRecognizer::Name)) {
- gesture.last.pan.delivered = true;
- gesture.last.pan.startPoints[0] = g->startPoints[0];
- gesture.last.pan.startPoints[1] = g->startPoints[1];
- gesture.last.pan.lastPoints[0] = g->lastPoints[0];
- gesture.last.pan.lastPoints[1] = g->lastPoints[1];
- gesture.last.pan.points[0] = g->points[0];
- gesture.last.pan.points[1] = g->points[1];
- gesture.last.pan.offset = g->offset;
- if (shouldAcceptPanGesture)
- g->accept();
- }
- gesture.last.cancelled = e->cancelledGestures();
- return true;
- }
- return QWidget::event(event);
- }
-};
-QVector<QColor> GestureWidget::colors;
-int GestureWidget::numberOfWidgets = 0;
-
-class GraphicsScene : public QGraphicsScene
-{
-public:
- GraphicsScene()
- {
- reset();
- }
- bool shouldAcceptSingleshotGesture;
- bool shouldAcceptPinchGesture;
- bool shouldAcceptSecondFingerGesture;
- GestureState gesture;
-
- void reset()
- {
- shouldAcceptSingleshotGesture = false;
- shouldAcceptPinchGesture = false;
- shouldAcceptSecondFingerGesture = false;
- gesture.reset();
- }
-protected:
- bool event(QEvent *event)
- {
- if (event->type() == QEvent::GraphicsSceneGesture) {
- QGraphicsSceneGestureEvent *e = static_cast<QGraphicsSceneGestureEvent*>(event);
- ++gesture.seenGestureEvent;
- QGraphicsScene::event(event);
- if (SingleshotGesture *g = (SingleshotGesture*)e->gesture(SingleshotGestureRecognizer::Name)) {
- gesture.last.singleshot.delivered = true;
- gesture.last.singleshot.offset = g->offset;
- if (shouldAcceptSingleshotGesture)
- g->accept();
- }
- if (PinchGesture *g = (PinchGesture*)e->gesture(PinchGestureRecognizer::Name)) {
- gesture.last.pinch.delivered = true;
- gesture.last.pinch.startPoints[0] = g->startPoints[0];
- gesture.last.pinch.startPoints[1] = g->startPoints[1];
- gesture.last.pinch.lastPoints[0] = g->lastPoints[0];
- gesture.last.pinch.lastPoints[1] = g->lastPoints[1];
- gesture.last.pinch.points[0] = g->points[0];
- gesture.last.pinch.points[1] = g->points[1];
- gesture.last.pinch.offset = g->offset;
- if (shouldAcceptPinchGesture)
- g->accept();
- }
- if (SecondFingerGesture *g = (SecondFingerGesture*)e->gesture(SecondFingerGestureRecognizer::Name)) {
- gesture.last.secondfinger.delivered = true;
- gesture.last.secondfinger.startPoint = g->startPoint;
- gesture.last.secondfinger.lastPoint = g->lastPoint;
- gesture.last.secondfinger.point = g->point;
- gesture.last.secondfinger.offset = g->offset;
- if (shouldAcceptSecondFingerGesture)
- g->accept();
- }
- gesture.last.cancelled = e->cancelledGestures();
- return true;
- }
- return QGraphicsScene::event(event);
- }
-};
-
-class GraphicsItem : public QGraphicsItem
-{
-public:
- GraphicsItem(int w = 100, int h = 100)
- : width(w), height(h)
- {
- reset();
- }
-
- QRectF boundingRect() const
- {
- return QRectF(0, 0, width, height);
- }
-
- void paint(QPainter *painter, const QStyleOptionGraphicsItem*, QWidget*)
- {
- painter->setBrush(Qt::green);
- painter->drawRect(0, 0, width, height);
- }
-
- void grabSingleshotGesture()
- {
- singleshotGestureId = grabGesture(SingleshotGestureRecognizer::Name);
- }
- void grabPinchGesture()
- {
- pinchGestureId = grabGesture(PinchGestureRecognizer::Name);
- }
- void grabSecondFingerGesture()
- {
- secondFingerGestureId = grabGesture(SecondFingerGestureRecognizer::Name);
- }
- void ungrabGestures()
- {
- releaseGesture(singleshotGestureId);
- singleshotGestureId = -1;
- releaseGesture(pinchGestureId);
- pinchGestureId = -1;
- releaseGesture(secondFingerGestureId);
- secondFingerGestureId = -1;
- }
-
- int width;
- int height;
-
- int singleshotGestureId;
- int pinchGestureId;
- int secondFingerGestureId;
-
- bool shouldAcceptSingleshotGesture;
- bool shouldAcceptPinchGesture;
- bool shouldAcceptSecondFingerGesture;
- GestureState gesture;
-
- TouchState touch;
-
- void reset()
- {
- shouldAcceptSingleshotGesture = true;
- shouldAcceptPinchGesture = true;
- shouldAcceptSecondFingerGesture = true;
- gesture.reset();
- }
-protected:
- bool sceneEvent(QEvent *event)
- {
- if (event->type() == QEvent::TouchBegin) {
- event->accept();
- ++touch.seenTouchBeginEvent;
- return true;
- } else if (event->type() == QEvent::TouchUpdate) {
- ++touch.seenTouchUpdateEvent;
- } else if (event->type() == QEvent::TouchEnd) {
- ++touch.seenTouchEndEvent;
- } else if (event->type() == QEvent::GraphicsSceneGesture) {
- QGraphicsSceneGestureEvent *e = static_cast<QGraphicsSceneGestureEvent*>(event);
- ++gesture.seenGestureEvent;
- if (SingleshotGesture *g = (SingleshotGesture*)e->gesture(SingleshotGestureRecognizer::Name)) {
- gesture.last.singleshot.delivered = true;
- gesture.last.singleshot.offset = g->offset;
- if (shouldAcceptSingleshotGesture)
- g->accept();
- }
- if (PinchGesture *g = (PinchGesture*)e->gesture(PinchGestureRecognizer::Name)) {
- gesture.last.pinch.delivered = true;
- gesture.last.pinch.startPoints[0] = g->startPoints[0];
- gesture.last.pinch.startPoints[1] = g->startPoints[1];
- gesture.last.pinch.lastPoints[0] = g->lastPoints[0];
- gesture.last.pinch.lastPoints[1] = g->lastPoints[1];
- gesture.last.pinch.points[0] = g->points[0];
- gesture.last.pinch.points[1] = g->points[1];
- gesture.last.pinch.offset = g->offset;
- if (shouldAcceptPinchGesture)
- g->accept();
- }
- if (SecondFingerGesture *g = (SecondFingerGesture*)e->gesture(SecondFingerGestureRecognizer::Name)) {
- gesture.last.secondfinger.delivered = true;
- gesture.last.secondfinger.startPoint = g->startPoint;
- gesture.last.secondfinger.lastPoint = g->lastPoint;
- gesture.last.secondfinger.point = g->point;
- gesture.last.secondfinger.offset = g->offset;
- if (shouldAcceptSecondFingerGesture)
- g->accept();
- }
- gesture.last.cancelled = e->cancelledGestures();
- return true;
- }
- return QGraphicsItem::sceneEvent(event);
- }
-};
-
-class tst_Gestures : public QObject
-{
- Q_OBJECT
-
-public:
- tst_Gestures();
- virtual ~tst_Gestures();
-
-public slots:
- void initTestCase();
- void cleanupTestCase();
- void init();
- void cleanup();
-
-private slots:
- void singleshotGesture();
- void pinchGesture();
-
- void simplePropagation();
- void simplePropagation2();
- void acceptedGesturePropagation();
-
- void simpleGraphicsView();
- void simpleGraphicsItem();
- void overlappingGraphicsItems();
-
- void touch_widget();
- void touch_graphicsView();
-
- void panOnWidgets();
-
-private:
- SingleshotGestureRecognizer *singleshotRecognizer;
- PinchGestureRecognizer *pinchRecognizer;
- SecondFingerGestureRecognizer *secondFingerRecognizer;
- PanGestureRecognizer *panGestureRecognizer;
- GestureWidget *mainWidget;
-
- void sendPinchEvents(QWidget *receiver, const QPoint &fromFinger1, const QPoint &fromFinger2);
-};
-
-tst_Gestures::tst_Gestures()
-{
- singleshotRecognizer = new SingleshotGestureRecognizer;
- pinchRecognizer = new PinchGestureRecognizer;
- secondFingerRecognizer = new SecondFingerGestureRecognizer;
- panGestureRecognizer = new PanGestureRecognizer;
- qApp->addGestureRecognizer(singleshotRecognizer);
- qApp->addGestureRecognizer(pinchRecognizer);
- qApp->addGestureRecognizer(secondFingerRecognizer);
- qApp->addGestureRecognizer(panGestureRecognizer);
-}
-
-tst_Gestures::~tst_Gestures()
-{
-}
-
-
-void tst_Gestures::initTestCase()
-{
- mainWidget = new GestureWidget(GestureWidget::DoNotGrabGestures);
- mainWidget->setObjectName("MainGestureWidget");
- mainWidget->resize(500, 600);
- mainWidget->show();
-}
-
-void tst_Gestures::cleanupTestCase()
-{
- delete mainWidget; mainWidget = 0;
-}
-
-void tst_Gestures::init()
-{
- // TODO: Add initialization code here.
- // This will be executed immediately before each test is run.
- mainWidget->reset();
-}
-
-void tst_Gestures::cleanup()
-{
-}
-
-bool sendSpontaneousEvent(QWidget *receiver, QEvent *event)
-{
- QETWidget::setSpont(event, true);
- return qApp->notify(receiver, event);
-}
-
-void tst_Gestures::singleshotGesture()
-{
- mainWidget->grabSingleshotGesture();
- SingleshotEvent event;
- sendSpontaneousEvent(mainWidget, &event);
- QVERIFY(mainWidget->gesture.seenGestureEvent);
- QVERIFY(mainWidget->gesture.last.singleshot.delivered);
- QVERIFY(mainWidget->gesture.last.cancelled.isEmpty());
-}
-
-void tst_Gestures::sendPinchEvents(QWidget *receiver, const QPoint &fromFinger1, const QPoint &fromFinger2)
-{
- int x1 = fromFinger1.x();
- int y1 = fromFinger1.x();
- int x2 = fromFinger2.x();
- int y2 = fromFinger2.x();
-
- TouchEvent event;
- event.points[0] = TouchPoint(0,x1,y1, TouchPoint::Begin);
- event.points[1] = TouchPoint();
- sendSpontaneousEvent(receiver, &event);
- event.points[0] = TouchPoint(0, x1+=2,y1+=2, TouchPoint::Update);
- event.points[1] = TouchPoint();
- sendSpontaneousEvent(receiver, &event);
- event.points[0] = TouchPoint(0, x1,y1, TouchPoint::Update);
- event.points[1] = TouchPoint(1, x2,y2, TouchPoint::Begin);
- sendSpontaneousEvent(receiver, &event);
- event.points[0] = TouchPoint(0, x1+=5,y1+=10, TouchPoint::End);
- event.points[1] = TouchPoint(1, x2+=3,y2+=6, TouchPoint::Update);
- sendSpontaneousEvent(receiver, &event);
- event.points[0] = TouchPoint();
- event.points[1] = TouchPoint(1, x2+=10,y2+=15, TouchPoint::Update);
- sendSpontaneousEvent(receiver, &event);
- event.points[0] = TouchPoint();
- event.points[1] = TouchPoint(1, x2,y2, TouchPoint::End);
- sendSpontaneousEvent(receiver, &event);
-}
-
-void tst_Gestures::pinchGesture()
-{
- mainWidget->grabPinchGesture();
- sendPinchEvents(mainWidget, QPoint(10,10), QPoint(20,20));
-
- QVERIFY(mainWidget->gesture.seenGestureEvent);
- QVERIFY(!mainWidget->gesture.last.singleshot.delivered);
- QVERIFY(mainWidget->gesture.last.cancelled.isEmpty());
- QVERIFY(mainWidget->gesture.last.pinch.delivered);
- QCOMPARE(mainWidget->gesture.last.pinch.startPoints[0].pt, QPoint(10,10));
- QCOMPARE(mainWidget->gesture.last.pinch.startPoints[1].pt, QPoint(20,20));
- QCOMPARE(mainWidget->gesture.last.pinch.offset, QPoint(0,0));
-}
-
-void tst_Gestures::simplePropagation()
-{
- mainWidget->grabSingleshotGesture();
- GestureWidget offsetWidget(GestureWidget::DoNotGrabGestures);
- offsetWidget.setFixedSize(30, 30);
- mainWidget->layout()->addWidget(&offsetWidget);
- GestureWidget nonGestureWidget(GestureWidget::DoNotGrabGestures);
- mainWidget->layout()->addWidget(&nonGestureWidget);
- QApplication::processEvents();
-
- SingleshotEvent event;
- sendSpontaneousEvent(&nonGestureWidget, &event);
- QVERIFY(!offsetWidget.gesture.seenGestureEvent);
- QVERIFY(!nonGestureWidget.gesture.seenGestureEvent);
- QVERIFY(mainWidget->gesture.seenGestureEvent);
- QVERIFY(mainWidget->gesture.last.cancelled.isEmpty());
- QVERIFY(mainWidget->gesture.last.singleshot.delivered);
- QCOMPARE(mainWidget->gesture.last.singleshot.offset, QPoint(GestureWidget::LeftMargin, 30 + GestureWidget::TopMargin));
-}
-
-void tst_Gestures::simplePropagation2()
-{
- mainWidget->grabSingleshotGesture();
- mainWidget->grabPinchGesture();
- GestureWidget nonGestureMiddleWidget(GestureWidget::DoNotGrabGestures);
- GestureWidget secondGestureWidget(GestureWidget::GrabPinch);
- nonGestureMiddleWidget.layout()->addWidget(&secondGestureWidget);
- mainWidget->layout()->addWidget(&nonGestureMiddleWidget);
- QApplication::processEvents();
-
- SingleshotEvent event;
- sendSpontaneousEvent(&secondGestureWidget, &event);
- QVERIFY(!secondGestureWidget.gesture.seenGestureEvent);
- QVERIFY(!nonGestureMiddleWidget.gesture.seenGestureEvent);
- QVERIFY(mainWidget->gesture.seenGestureEvent);
- QVERIFY(mainWidget->gesture.last.singleshot.delivered);
- QVERIFY(mainWidget->gesture.last.cancelled.isEmpty());
- QCOMPARE(mainWidget->gesture.last.singleshot.offset, QPoint(GestureWidget::LeftMargin*2,GestureWidget::TopMargin*2));
-
- mainWidget->reset();
- nonGestureMiddleWidget.reset();
- secondGestureWidget.reset();
-
- sendPinchEvents(&secondGestureWidget, QPoint(10,10), QPoint(20,20));
- QVERIFY(secondGestureWidget.gesture.seenGestureEvent);
- QVERIFY(!secondGestureWidget.gesture.last.singleshot.delivered);
- QVERIFY(secondGestureWidget.gesture.last.pinch.delivered);
- QCOMPARE(secondGestureWidget.gesture.last.pinch.startPoints[0].pt, QPoint(10,10));
- QCOMPARE(secondGestureWidget.gesture.last.pinch.startPoints[1].pt, QPoint(20,20));
- QCOMPARE(secondGestureWidget.gesture.last.pinch.offset, QPoint(0,0));
- QVERIFY(!nonGestureMiddleWidget.gesture.seenGestureEvent);
- QVERIFY(!mainWidget->gesture.seenGestureEvent);
-}
-
-void tst_Gestures::acceptedGesturePropagation()
-{
- mainWidget->grabSingleshotGesture();
- mainWidget->grabPinchGesture();
- mainWidget->grabSecondFingerGesture();
- GestureWidget nonGestureMiddleWidget(GestureWidget::DoNotGrabGestures);
- nonGestureMiddleWidget.setObjectName("nonGestureMiddleWidget");
- GestureWidget secondGestureWidget(GestureWidget::GrabSecondFinger);
- secondGestureWidget.setObjectName("secondGestureWidget");
- nonGestureMiddleWidget.layout()->addWidget(&secondGestureWidget);
- mainWidget->layout()->addWidget(&nonGestureMiddleWidget);
- QApplication::processEvents();
-
- sendPinchEvents(&secondGestureWidget, QPoint(10, 10), QPoint(40, 40));
- QVERIFY(secondGestureWidget.gesture.seenGestureEvent);
- QVERIFY(!secondGestureWidget.gesture.last.singleshot.delivered);
- QVERIFY(!secondGestureWidget.gesture.last.pinch.delivered);
- QVERIFY(secondGestureWidget.gesture.last.secondfinger.delivered);
- QCOMPARE(secondGestureWidget.gesture.last.secondfinger.startPoint.pt, QPoint(40,40));
- QVERIFY(!nonGestureMiddleWidget.gesture.seenGestureEvent);
- QVERIFY(mainWidget->gesture.seenGestureEvent);
- QVERIFY(!mainWidget->gesture.last.singleshot.delivered);
- QVERIFY(!mainWidget->gesture.last.secondfinger.delivered);
- QVERIFY(mainWidget->gesture.last.pinch.delivered);
- QCOMPARE(mainWidget->gesture.last.pinch.startPoints[0].pt, QPoint(10,10));
- QCOMPARE(mainWidget->gesture.last.pinch.startPoints[1].pt, QPoint(40,40));
-
- mainWidget->reset();
- nonGestureMiddleWidget.reset();
- secondGestureWidget.reset();
-
- // don't accept it and make sure it propagates to parent
- secondGestureWidget.shouldAcceptSecondFingerGesture = false;
- sendPinchEvents(&secondGestureWidget, QPoint(10, 10), QPoint(40, 40));
- QVERIFY(secondGestureWidget.gesture.seenGestureEvent);
- QVERIFY(secondGestureWidget.gesture.last.secondfinger.delivered);
- QVERIFY(!nonGestureMiddleWidget.gesture.seenGestureEvent);
- QVERIFY(mainWidget->gesture.seenGestureEvent);
- QVERIFY(!mainWidget->gesture.last.singleshot.delivered);
- QVERIFY(mainWidget->gesture.last.secondfinger.delivered);
- QVERIFY(mainWidget->gesture.last.pinch.delivered);
-}
-
-void tst_Gestures::simpleGraphicsView()
-{
- mainWidget->grabSingleshotGesture();
- GraphicsScene scene;
- QGraphicsView view(&scene);
- view.grabGesture(SingleshotGestureRecognizer::Name);
- mainWidget->layout()->addWidget(&view);
- QApplication::processEvents();
-
- scene.shouldAcceptSingleshotGesture = true;
-
- SingleshotEvent event;
- sendSpontaneousEvent(&view, &event);
- QVERIFY(!mainWidget->gesture.seenGestureEvent);
- QVERIFY(scene.gesture.seenGestureEvent);
- QVERIFY(scene.gesture.last.singleshot.delivered);
- QVERIFY(scene.gesture.last.cancelled.isEmpty());
-}
-
-void tst_Gestures::simpleGraphicsItem()
-{
- mainWidget->grabSingleshotGesture();
- GraphicsScene scene;
- QGraphicsView view(&scene);
- mainWidget->layout()->addWidget(&view);
- GraphicsItem *item = new GraphicsItem;
- item->grabSingleshotGesture();
- item->setPos(30, 50);
- scene.addItem(item);
- QApplication::processEvents();
-
- QPoint pt = view.mapFromScene(item->mapToScene(30, 30));
- SingleshotEvent event(pt.x(), pt.y());
- sendSpontaneousEvent(&view, &event);
- QVERIFY(item->gesture.seenGestureEvent);
- QVERIFY(scene.gesture.seenGestureEvent);
- QVERIFY(!mainWidget->gesture.seenGestureEvent);
-
- item->reset();
- scene.reset();
- mainWidget->reset();
-
- item->shouldAcceptSingleshotGesture = false;
- // outside of the graphicsitem
- pt = view.mapFromScene(item->mapToScene(-10, -10));
- SingleshotEvent event2(pt.x(), pt.y());
- sendSpontaneousEvent(&view, &event2);
- QVERIFY(!item->gesture.seenGestureEvent);
- QVERIFY(scene.gesture.seenGestureEvent);
- QVERIFY(mainWidget->gesture.seenGestureEvent);
-}
-
-void tst_Gestures::overlappingGraphicsItems()
-{
- mainWidget->grabSingleshotGesture();
- GraphicsScene scene;
- QGraphicsView view(&scene);
- mainWidget->layout()->addWidget(&view);
-
- GraphicsItem *item = new GraphicsItem(300, 100);
- item->setPos(30, 50);
- scene.addItem(item);
- GraphicsItem *subitem1 = new GraphicsItem(50, 70);
- subitem1->setPos(70, 70);
- subitem1->setZValue(1);
- scene.addItem(subitem1);
- GraphicsItem *subitem2 = new GraphicsItem(50, 70);
- subitem2->setPos(250, 70);
- subitem2->setZValue(1);
- scene.addItem(subitem2);
- QApplication::processEvents();
-
- item->grabSingleshotGesture();
- item->grabPinchGesture();
- item->grabSecondFingerGesture();
- subitem1->grabSingleshotGesture();
- subitem2->grabSecondFingerGesture();
-
- QPoint pt = view.mapFromScene(subitem1->mapToScene(20, 20));
- SingleshotEvent event(pt.x(), pt.y());
- sendSpontaneousEvent(&view, &event);
- QVERIFY(scene.gesture.seenGestureEvent);
- QVERIFY(!subitem2->gesture.seenGestureEvent);
- QVERIFY(!item->gesture.seenGestureEvent);
- QVERIFY(!mainWidget->gesture.seenGestureEvent);
- QVERIFY(subitem1->gesture.seenGestureEvent);
- QVERIFY(subitem1->gesture.last.singleshot.delivered);
-
- item->reset();
- subitem1->reset();
- subitem2->reset();
- scene.reset();
- mainWidget->reset();
-
- subitem1->shouldAcceptSingleshotGesture = false;
- SingleshotEvent event2(pt.x(), pt.y());
- sendSpontaneousEvent(&view, &event2);
- QVERIFY(scene.gesture.seenGestureEvent);
- QVERIFY(!subitem2->gesture.seenGestureEvent);
- QVERIFY(subitem1->gesture.seenGestureEvent);
- QVERIFY(item->gesture.seenGestureEvent);
- QVERIFY(!mainWidget->gesture.seenGestureEvent);
- QVERIFY(subitem1->gesture.last.singleshot.delivered);
- QVERIFY(item->gesture.last.singleshot.delivered);
-}
-
-void tst_Gestures::touch_widget()
-{
- GestureWidget leftWidget(GestureWidget::DoNotGrabGestures);
- leftWidget.setObjectName("leftWidget");
- leftWidget.setAttribute(Qt::WA_AcceptTouchEvents);
- GestureWidget rightWidget(GestureWidget::DoNotGrabGestures);
- rightWidget.setObjectName("rightWidget");
- rightWidget.setAttribute(Qt::WA_AcceptTouchEvents);
- delete mainWidget->layout();
- (void)new QHBoxLayout(mainWidget);
- mainWidget->layout()->addWidget(&leftWidget);
- mainWidget->layout()->addWidget(&rightWidget);
- QApplication::processEvents();
-
- QTest::touchEvent()
- .press(0, QPoint(10, 10), &leftWidget);
- QTest::touchEvent()
- .move(0, QPoint(12, 30), &leftWidget);
- QTest::touchEvent()
- .stationary(0)
- .press(1, QPoint(15, 15), &rightWidget);
- QTest::touchEvent()
- .move(0, QPoint(10, 35), &leftWidget)
- .press(1, QPoint(15, 15), &rightWidget);
- QTest::touchEvent()
- .move(0, QPoint(10, 40), &leftWidget)
- .move(1, QPoint(20, 50), &rightWidget);
- QTest::touchEvent()
- .release(0, QPoint(10, 40), &leftWidget)
- .release(1, QPoint(20, 50), &rightWidget);
- QVERIFY(!mainWidget->touch.seenTouchBeginEvent);
- QVERIFY(leftWidget.touch.seenTouchBeginEvent);
- QVERIFY(leftWidget.touch.seenTouchUpdateEvent);
- QVERIFY(leftWidget.touch.seenTouchEndEvent);
- QVERIFY(rightWidget.touch.seenTouchBeginEvent);
- QVERIFY(rightWidget.touch.seenTouchUpdateEvent);
- QVERIFY(rightWidget.touch.seenTouchEndEvent);
-}
-
-void tst_Gestures::touch_graphicsView()
-{
- mainWidget->setAttribute(Qt::WA_AcceptTouchEvents);
- GraphicsScene scene;
- QGraphicsView view(&scene);
- view.viewport()->setAttribute(Qt::WA_AcceptTouchEvents);
- mainWidget->layout()->addWidget(&view);
-
- GraphicsItem *item = new GraphicsItem(300, 100);
- item->setAcceptTouchEvents(true);
- item->setPos(30, 50);
- scene.addItem(item);
- GraphicsItem *subitem1 = new GraphicsItem(50, 70);
- subitem1->setAcceptTouchEvents(true);
- subitem1->setPos(70, 70);
- scene.addItem(subitem1);
- GraphicsItem *subitem2 = new GraphicsItem(50, 70);
- subitem2->setAcceptTouchEvents(true);
- subitem2->setPos(250, 70);
- scene.addItem(subitem2);
- QApplication::processEvents();
-
- QRect itemRect = view.mapFromScene(item->mapRectToScene(item->boundingRect())).boundingRect();
- QPoint pt = itemRect.center();
- QTest::touchEvent(view.viewport())
- .press(0, pt)
- .press(1, pt);
- QTest::touchEvent(view.viewport())
- .move(0, pt + QPoint(20, 30))
- .move(1, QPoint(300, 300));
- QTest::touchEvent(view.viewport())
- .stationary(0)
- .move(1, QPoint(330, 330));
- QTest::touchEvent(view.viewport())
- .release(0, QPoint(120, 120))
- .release(1, QPoint(300, 300));
-
- QVERIFY(item->touch.seenTouchBeginEvent);
- QVERIFY(item->touch.seenTouchUpdateEvent);
- QVERIFY(item->touch.seenTouchEndEvent);
-}
-
-void tst_Gestures::panOnWidgets()
-{
- GestureWidget leftWidget(GestureWidget::GrabPan);
- leftWidget.setObjectName("leftWidget");
- leftWidget.setAttribute(Qt::WA_AcceptTouchEvents);
- GestureWidget rightWidget(GestureWidget::GrabPan);
- rightWidget.setObjectName("rightWidget");
- rightWidget.setAttribute(Qt::WA_AcceptTouchEvents);
- delete mainWidget->layout();
- (void)new QHBoxLayout(mainWidget);
- mainWidget->layout()->addWidget(&leftWidget);
- mainWidget->layout()->addWidget(&rightWidget);
- QApplication::processEvents();
-
- QTest::touchEvent()
- .press(0, QPoint(10, 10), &leftWidget);
- QTest::touchEvent()
- .move(0, QPoint(12, 30), &leftWidget);
- QTest::touchEvent()
- .stationary(0)
- .press(1, QPoint(15, 15), &rightWidget);
- QTest::touchEvent()
- .move(0, QPoint(10, 35), &leftWidget)
- .press(1, QPoint(15, 15), &rightWidget);
- QTest::touchEvent()
- .move(0, QPoint(10, 40), &leftWidget)
- .move(1, QPoint(20, 50), &rightWidget);
- QTest::touchEvent()
- .release(0, QPoint(10, 40), &leftWidget)
- .release(1, QPoint(20, 50), &rightWidget);
-
- QVERIFY(leftWidget.gesture.last.pan.delivered);
- QVERIFY(rightWidget.gesture.last.pan.delivered);
-}
-
-QTEST_MAIN(tst_Gestures)
-#include "tst_gestures.moc"
diff --git a/tests/auto/qabstractitemmodel/dynamictreemodel.cpp b/tests/auto/qabstractitemmodel/dynamictreemodel.cpp
index 374b7db..dd0615d 100644
--- a/tests/auto/qabstractitemmodel/dynamictreemodel.cpp
+++ b/tests/auto/qabstractitemmodel/dynamictreemodel.cpp
@@ -1,31 +1,50 @@
-/*
- Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Library General Public License as published by
- the Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
-
- This library is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
- License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
+/****************************************************************************
+**
+** Copyright (C) 2009 Stephen Kelly <steveire@gmail.com>
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#include "dynamictreemodel.h"
-#include <QHash>
-#include <QList>
-#include <QTimer>
-
-#include <QDebug>
+#include <QtCore/QHash>
+#include <QtCore/QList>
+#include <QtCore/QTimer>
-#include <kdebug.h>
DynamicTreeModel::DynamicTreeModel(QObject *parent)
: QAbstractItemModel(parent),
diff --git a/tests/auto/qabstractitemmodel/dynamictreemodel.h b/tests/auto/qabstractitemmodel/dynamictreemodel.h
index c19ed9d..a769c38 100644
--- a/tests/auto/qabstractitemmodel/dynamictreemodel.h
+++ b/tests/auto/qabstractitemmodel/dynamictreemodel.h
@@ -1,33 +1,52 @@
-/*
- Copyright (c) 2009 Stephen Kelly <steveire@gmail.com>
-
- This library is free software; you can redistribute it and/or modify it
- under the terms of the GNU Library General Public License as published by
- the Free Software Foundation; either version 2 of the License, or (at your
- option) any later version.
-
- This library is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
- License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-*/
+/****************************************************************************
+**
+** Copyright (C) 2009 Stephen Kelly <steveire@gmail.com>
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
#ifndef DYNAMICTREEMODEL_H
#define DYNAMICTREEMODEL_H
-#include <QAbstractItemModel>
-
-#include <QHash>
-#include <QList>
+#include <QtCore/QAbstractItemModel>
-#include <QDebug>
+#include <QtCore/QHash>
+#include <QtCore/QList>
-#include <kdebug.h>
template<typename T> class QList;
diff --git a/tests/auto/qabstractitemmodel/qabstractitemmodel.pro b/tests/auto/qabstractitemmodel/qabstractitemmodel.pro
index 84ed5a2..a31868b 100644
--- a/tests/auto/qabstractitemmodel/qabstractitemmodel.pro
+++ b/tests/auto/qabstractitemmodel/qabstractitemmodel.pro
@@ -2,5 +2,5 @@ load(qttest_p4)
SOURCES += tst_qabstractitemmodel.cpp dynamictreemodel.cpp
HEADERS += dynamictreemodel.h
-QT = core
+
diff --git a/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp b/tests/auto/qabstractitemmodel/tst_qabstractitemmodel.cpp
index da65e7d..58832c7 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 <QSortFilterProxyModel>
+#include <QtGui/QSortFilterProxyModel>
//TESTED_CLASS=QAbstractListModel QAbstractTableModel
//TESTED_FILES=
diff --git a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
index fa36845..19fa502 100644
--- a/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
+++ b/tests/auto/qabstractnetworkcache/tst_qabstractnetworkcache.cpp
@@ -69,6 +69,8 @@ private slots:
void cacheControl_data();
void cacheControl();
+ void deleteCache();
+
private:
void check();
};
@@ -84,8 +86,8 @@ public:
#ifdef Q_OS_SYMBIAN
QString location = QLatin1String("./cache/");
#else
- QString location = QDesktopServices::storageLocation(QDesktopServices::DataLocation)
- + QLatin1String("/cache/");
+ QString location = QDesktopServices::storageLocation(QDesktopServices::CacheLocation)
+ + QLatin1String("/qnetworkdiskcache/");
#endif
setCacheDirectory(location);
clear();
@@ -275,6 +277,20 @@ void tst_QAbstractNetworkCache::check()
QCOMPARE(diskCache->gotData, fetchFromCache);
}
+void tst_QAbstractNetworkCache::deleteCache()
+{
+ QNetworkAccessManager manager;
+ NetworkDiskCache *diskCache = new NetworkDiskCache(&manager);
+ manager.setCache(diskCache);
+
+ QString url = "httpcachetest_cachecontrol.cgi?max-age=1000";
+ QNetworkRequest request(QUrl(TESTFILE + url));
+ QNetworkReply *reply = manager.get(request);
+ QSignalSpy downloaded1(reply, SIGNAL(finished()));
+ manager.setCache(0);
+ QTRY_COMPARE(downloaded1.count(), 1);
+}
+
QTEST_MAIN(tst_QAbstractNetworkCache)
#include "tst_qabstractnetworkcache.moc"
diff --git a/tests/auto/qatomicint/tst_qatomicint.cpp b/tests/auto/qatomicint/tst_qatomicint.cpp
index c3ea31d..5fde633 100644
--- a/tests/auto/qatomicint/tst_qatomicint.cpp
+++ b/tests/auto/qatomicint/tst_qatomicint.cpp
@@ -59,6 +59,8 @@ public:
~tst_QAtomicInt();
private slots:
+ void warningFree();
+
// QAtomicInt members
void constructor_data();
void constructor();
@@ -101,6 +103,9 @@ private slots:
void testAndSet_loop();
void fetchAndAdd_loop();
void fetchAndAdd_threadedLoop();
+
+private:
+ static void warningFreeHelper();
};
tst_QAtomicInt::tst_QAtomicInt()
@@ -109,6 +114,45 @@ tst_QAtomicInt::tst_QAtomicInt()
tst_QAtomicInt::~tst_QAtomicInt()
{ }
+void tst_QAtomicInt::warningFreeHelper()
+{
+ Q_ASSERT(false);
+ // The code below is bogus, and shouldn't be run. We're looking for warnings, only.
+
+ QBasicAtomicInt i = Q_BASIC_ATOMIC_INITIALIZER(0);
+
+ int expectedValue = 0;
+ int newValue = 0;
+ int valueToAdd = 0;
+
+ i.ref();
+ i.deref();
+
+ i.testAndSetRelaxed(expectedValue, newValue);
+ i.testAndSetAcquire(expectedValue, newValue);
+ i.testAndSetRelease(expectedValue, newValue);
+ i.testAndSetOrdered(expectedValue, newValue);
+
+ i.fetchAndStoreRelaxed(newValue);
+ i.fetchAndStoreAcquire(newValue);
+ i.fetchAndStoreRelease(newValue);
+ i.fetchAndStoreOrdered(newValue);
+
+ i.fetchAndAddRelaxed(valueToAdd);
+ i.fetchAndAddAcquire(valueToAdd);
+ i.fetchAndAddRelease(valueToAdd);
+ i.fetchAndAddOrdered(valueToAdd);
+}
+
+void tst_QAtomicInt::warningFree()
+{
+ // This is a compile time check for warnings.
+ // No need for actual work here.
+
+ void (*foo)() = &warningFreeHelper;
+ (void)foo;
+}
+
void tst_QAtomicInt::constructor_data()
{
QTest::addColumn<int>("value");
diff --git a/tests/auto/qatomicpointer/tst_qatomicpointer.cpp b/tests/auto/qatomicpointer/tst_qatomicpointer.cpp
index b9636a0..c1e0efd 100644
--- a/tests/auto/qatomicpointer/tst_qatomicpointer.cpp
+++ b/tests/auto/qatomicpointer/tst_qatomicpointer.cpp
@@ -58,6 +58,8 @@ public:
~tst_QAtomicPointer();
private slots:
+ void warningFree();
+
void constructor();
void copy_constructor();
void equality_operator();
@@ -78,6 +80,9 @@ private slots:
void isFetchAndAddWaitFree();
void fetchAndAdd_data();
void fetchAndAdd();
+
+private:
+ static void warningFreeHelper();
};
tst_QAtomicPointer::tst_QAtomicPointer()
@@ -86,6 +91,49 @@ tst_QAtomicPointer::tst_QAtomicPointer()
tst_QAtomicPointer::~tst_QAtomicPointer()
{ }
+struct WFHC
+{
+ void bar() {}
+};
+
+void tst_QAtomicPointer::warningFreeHelper()
+{
+ Q_ASSERT(false);
+ // The code below is bogus, and shouldn't be run. We're looking for warnings, only.
+
+ QBasicAtomicPointer<WFHC> p = Q_BASIC_ATOMIC_INITIALIZER(0);
+
+ p->bar();
+
+ WFHC *expectedValue = 0;
+ WFHC *newValue = 0;
+ qptrdiff valueToAdd = 0;
+
+ p.testAndSetRelaxed(expectedValue, newValue);
+ p.testAndSetAcquire(expectedValue, newValue);
+ p.testAndSetRelease(expectedValue, newValue);
+ p.testAndSetOrdered(expectedValue, newValue);
+
+ p.fetchAndStoreRelaxed(newValue);
+ p.fetchAndStoreAcquire(newValue);
+ p.fetchAndStoreRelease(newValue);
+ p.fetchAndStoreOrdered(newValue);
+
+ p.fetchAndAddRelaxed(valueToAdd);
+ p.fetchAndAddAcquire(valueToAdd);
+ p.fetchAndAddRelease(valueToAdd);
+ p.fetchAndAddOrdered(valueToAdd);
+}
+
+void tst_QAtomicPointer::warningFree()
+{
+ // This is a compile time check for warnings.
+ // No need for actual work here.
+
+ void (*foo)() = &warningFreeHelper;
+ (void)foo;
+}
+
void tst_QAtomicPointer::constructor()
{
void *one = this;
diff --git a/tests/auto/qbytearray/tst_qbytearray.cpp b/tests/auto/qbytearray/tst_qbytearray.cpp
index 435724a..dfb2fe1 100644
--- a/tests/auto/qbytearray/tst_qbytearray.cpp
+++ b/tests/auto/qbytearray/tst_qbytearray.cpp
@@ -464,7 +464,7 @@ void tst_QByteArray::base64_data()
QTest::newRow("f") << ba << QByteArray("AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==");
QTest::newRow("g") << QByteArray("foo\0bar", 7) << QByteArray("Zm9vAGJhcg==");
- QTest::newRow("h") << QByteArray("f\xd1oo\x9cbar") << QByteArray("ZtFvb7py");
+ QTest::newRow("h") << QByteArray("f\xd1oo\x9ctar") << QByteArray("ZtFvb5x0YXI=");
QTest::newRow("i") << QByteArray("\"\0\0\0\0\0\0\"", 8) << QByteArray("IgAAAAAAACI=");
}
@@ -514,7 +514,7 @@ void tst_QByteArray::fromBase64_data()
QTest::newRow("g") << QByteArray("foo\0bar", 7) << QByteArray("Zm9vAGJhcg");
- QTest::newRow("h") << QByteArray("f\xd1oo\x9cbar") << QByteArray("ZtFv\0b7py", 9);
+ QTest::newRow("h") << QByteArray("f\xd1oo\x9ctar") << QByteArray("ZtFvb5x0YXI=");
QTest::newRow("i") << QByteArray("\"\0\0\0\0\0\0\"", 8) << QByteArray("IgAAAAAAACI");
}
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index 073afc8..1629542 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -46,6 +46,7 @@
#include <qdebug.h>
#include <qgl.h>
#include <qglpixelbuffer.h>
+#include <qglframebufferobject.h>
#include <qglcolormap.h>
#include <qpaintengine.h>
@@ -71,6 +72,7 @@ private slots:
void partialGLWidgetUpdates_data();
void partialGLWidgetUpdates();
void glWidgetRendering();
+ void glFBORendering();
void glPBufferRendering();
void glWidgetReparent();
void colormap();
@@ -706,6 +708,67 @@ void tst_QGL::glWidgetRendering()
QCOMPARE(fb, reference);
}
+// 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_QGL::glFBORendering()
+{
+ if (!QGLFramebufferObject::hasOpenGLFramebufferObjects())
+ QSKIP("QGLFramebufferObject not supported on this platform", SkipSingle);
+
+ QGLWidget glw;
+ glw.makeCurrent();
+
+ // No multisample with combined depth/stencil attachment:
+ QGLFramebufferObjectFormat fboFormat(0, QGLFramebufferObject::CombinedDepthStencil);
+
+ // Don't complicate things by using NPOT:
+ QGLFramebufferObject *fbo = new QGLFramebufferObject(256, 128, fboFormat);
+
+ QPainter fboPainter;
+ bool painterBegun = fboPainter.begin(fbo);
+ QVERIFY(painterBegun);
+
+ 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();
+
+ fboPainter.fillRect(0, 0, fbo->width(), fbo->height(), Qt::red); // Background
+ fboPainter.translate(14, 14);
+ fboPainter.fillPath(intersectingPath, Qt::blue); // Test stencil buffer works
+ fboPainter.translate(128, 0);
+ fboPainter.setClipPath(trianglePath); // Test depth buffer works
+ fboPainter.setTransform(QTransform()); // reset xform
+ fboPainter.fillRect(0, 0, fbo->width(), fbo->height(), Qt::green);
+ fboPainter.end();
+
+ QImage fb = fbo->toImage().convertToFormat(QImage::Format_RGB32);
+ delete fbo;
+
+ // 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:
+ QCOMPARE(fb.pixel(39, 64), QColor(Qt::red).rgb());
+ QCOMPARE(fb.pixel(89, 64), QColor(Qt::red).rgb());
+ QCOMPARE(fb.pixel(64, 39), QColor(Qt::blue).rgb());
+ QCOMPARE(fb.pixel(64, 89), QColor(Qt::blue).rgb());
+
+ QCOMPARE(fb.pixel(167, 39), QColor(Qt::red).rgb());
+ QCOMPARE(fb.pixel(217, 39), QColor(Qt::red).rgb());
+ QCOMPARE(fb.pixel(192, 64), QColor(Qt::green).rgb());
+}
+
void tst_QGL::glWidgetReparent()
{
// Try it as a top-level first:
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 541b5ba..aa1f2b8 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -289,6 +289,9 @@ private slots:
void setGraphicsEffect();
void panel();
void addPanelToActiveScene();
+ void activate();
+ void setActivePanelOnInactiveScene();
+ void activationOnShowHide();
// task specific tests below me
void task141694_textItemEnsureVisible();
@@ -5417,6 +5420,7 @@ void tst_QGraphicsItem::contextMenuEventPropagation()
qt_x11_wait_for_window_manager(&view);
#endif
view.resize(200, 200);
+ QTest::qWait(250);
QContextMenuEvent event(QContextMenuEvent::Mouse, QPoint(10, 10),
view.viewport()->mapToGlobal(QPoint(10, 10)));
@@ -7823,26 +7827,15 @@ void tst_QGraphicsItem::panel()
// No previous activation, so the scene is active.
QVERIFY(scene.isActive());
- QVERIFY(!scene.activePanel());
- QVERIFY(!panel1->isActive());
- QVERIFY(!panel2->isActive());
- QVERIFY(!panel3->isActive());
- QVERIFY(!panel4->isActive());
- QVERIFY(notPanel1->isActive());
- QVERIFY(notPanel2->isActive());
- QCOMPARE(spy_activate_notPanel1.count(), 1);
- QCOMPARE(spy_activate_notPanel2.count(), 1);
-
- // Switch to panel1.
- scene.setActivePanel(panel1);
+ QCOMPARE(scene.activePanel(), (QGraphicsItem *)panel1);
QVERIFY(panel1->isActive());
QVERIFY(!panel2->isActive());
QVERIFY(!panel3->isActive());
QVERIFY(!panel4->isActive());
QVERIFY(!notPanel1->isActive());
QVERIFY(!notPanel2->isActive());
- QCOMPARE(spy_deactivate_notPanel1.count(), 1);
- QCOMPARE(spy_deactivate_notPanel2.count(), 1);
+ QCOMPARE(spy_deactivate_notPanel1.count(), 0);
+ QCOMPARE(spy_deactivate_notPanel2.count(), 0);
QCOMPARE(spy_activate_panel1.count(), 1);
QCOMPARE(spy_activate_panel2.count(), 0);
QCOMPARE(spy_activate_panel3.count(), 0);
@@ -7857,8 +7850,8 @@ void tst_QGraphicsItem::panel()
QVERIFY(!panel4->isActive());
QVERIFY(notPanel1->isActive());
QVERIFY(notPanel2->isActive());
- QCOMPARE(spy_activate_notPanel1.count(), 2);
- QCOMPARE(spy_activate_notPanel2.count(), 2);
+ QCOMPARE(spy_activate_notPanel1.count(), 1);
+ QCOMPARE(spy_activate_notPanel2.count(), 1);
// Deactivate the scene
QApplication::sendEvent(&scene, &deactivate);
@@ -7869,8 +7862,8 @@ void tst_QGraphicsItem::panel()
QVERIFY(!panel4->isActive());
QVERIFY(!notPanel1->isActive());
QVERIFY(!notPanel2->isActive());
- QCOMPARE(spy_deactivate_notPanel1.count(), 2);
- QCOMPARE(spy_deactivate_notPanel2.count(), 2);
+ QCOMPARE(spy_deactivate_notPanel1.count(), 1);
+ QCOMPARE(spy_deactivate_notPanel2.count(), 1);
// Reactivate the scene
QApplication::sendEvent(&scene, &activate);
@@ -7881,14 +7874,14 @@ void tst_QGraphicsItem::panel()
QVERIFY(!panel4->isActive());
QVERIFY(notPanel1->isActive());
QVERIFY(notPanel2->isActive());
- QCOMPARE(spy_activate_notPanel1.count(), 3);
- QCOMPARE(spy_activate_notPanel2.count(), 3);
+ QCOMPARE(spy_activate_notPanel1.count(), 2);
+ QCOMPARE(spy_activate_notPanel2.count(), 2);
// Switch to panel1
scene.setActivePanel(panel1);
QVERIFY(panel1->isActive());
- QCOMPARE(spy_deactivate_notPanel1.count(), 3);
- QCOMPARE(spy_deactivate_notPanel2.count(), 3);
+ QCOMPARE(spy_deactivate_notPanel1.count(), 2);
+ QCOMPARE(spy_deactivate_notPanel2.count(), 2);
QCOMPARE(spy_activate_panel1.count(), 2);
// Deactivate the scene
@@ -7942,5 +7935,173 @@ void tst_QGraphicsItem::addPanelToActiveScene()
QCOMPARE(scene.activePanel(), (QGraphicsItem *)rect);
}
+void tst_QGraphicsItem::activate()
+{
+ QGraphicsScene scene;
+ QGraphicsRectItem *rect = scene.addRect(-10, -10, 20, 20);
+ QVERIFY(!rect->isActive());
+
+ QEvent activate(QEvent::WindowActivate);
+ QEvent deactivate(QEvent::WindowDeactivate);
+
+ QApplication::sendEvent(&scene, &activate);
+
+ // Non-panel item (active when scene is active).
+ QVERIFY(rect->isActive());
+
+ QGraphicsRectItem *rect2 = new QGraphicsRectItem;
+ rect2->setFlag(QGraphicsItem::ItemIsPanel);
+ QGraphicsRectItem *rect3 = new QGraphicsRectItem;
+ rect3->setFlag(QGraphicsItem::ItemIsPanel);
+
+ // Test normal activation.
+ QVERIFY(!rect2->isActive());
+ scene.addItem(rect2);
+ QVERIFY(rect2->isActive()); // first panel item is activated
+ scene.addItem(rect3);
+ QVERIFY(!rect3->isActive()); // second panel item is _not_ activated
+ rect3->setActive(true);
+ QVERIFY(rect3->isActive());
+ scene.removeItem(rect3);
+ QVERIFY(!rect3->isActive()); // no panel is active anymore
+ QCOMPARE(scene.activePanel(), (QGraphicsItem *)0);
+ scene.addItem(rect3);
+ QVERIFY(rect3->isActive()); // second panel item is activated
+
+ // Test pending activation.
+ scene.removeItem(rect3);
+ rect2->setActive(true);
+ QVERIFY(rect2->isActive()); // first panel item is activated
+ rect3->setActive(true);
+ QVERIFY(!rect3->isActive()); // not active (yet)
+ scene.addItem(rect3);
+ QVERIFY(rect3->isActive()); // now becomes active
+
+ // Test pending deactivation.
+ scene.removeItem(rect3);
+ rect3->setActive(false);
+ scene.addItem(rect3);
+ QVERIFY(!rect3->isActive()); // doesn't become active
+
+ // Child of panel activation.
+ rect3->setActive(true);
+ QGraphicsRectItem *rect4 = new QGraphicsRectItem;
+ rect4->setFlag(QGraphicsItem::ItemIsPanel);
+ QGraphicsRectItem *rect5 = new QGraphicsRectItem(rect4);
+ QGraphicsRectItem *rect6 = new QGraphicsRectItem(rect5);
+ scene.addItem(rect4);
+ QCOMPARE(scene.activePanel(), (QGraphicsItem *)rect3);
+ scene.removeItem(rect4);
+ rect6->setActive(true);
+ scene.addItem(rect4);
+ QVERIFY(rect4->isActive());
+ QVERIFY(rect5->isActive());
+ QVERIFY(rect6->isActive());
+ QCOMPARE(scene.activePanel(), (QGraphicsItem *)rect4);
+ scene.removeItem(rect4); // no active panel
+ rect6->setActive(false);
+ scene.addItem(rect4);
+ QVERIFY(!rect4->isActive());
+ QVERIFY(!rect5->isActive());
+ QVERIFY(!rect6->isActive());
+ QCOMPARE(scene.activePanel(), (QGraphicsItem *)0);
+
+ // Controlling auto-activation when the scene changes activation.
+ rect4->setActive(true);
+ QApplication::sendEvent(&scene, &deactivate);
+ QVERIFY(!scene.isActive());
+ QVERIFY(!rect4->isActive());
+ rect4->setActive(false);
+ QApplication::sendEvent(&scene, &activate);
+ QVERIFY(scene.isActive());
+ QVERIFY(!scene.activePanel());
+ QVERIFY(!rect4->isActive());
+}
+
+void tst_QGraphicsItem::setActivePanelOnInactiveScene()
+{
+ QGraphicsScene scene;
+ QGraphicsRectItem *item = scene.addRect(QRectF());
+ QGraphicsRectItem *panel = scene.addRect(QRectF());
+ panel->setFlag(QGraphicsItem::ItemIsPanel);
+
+ EventSpy itemActivateSpy(&scene, item, QEvent::WindowActivate);
+ EventSpy itemDeactivateSpy(&scene, item, QEvent::WindowDeactivate);
+ EventSpy panelActivateSpy(&scene, panel, QEvent::WindowActivate);
+ EventSpy panelDeactivateSpy(&scene, panel, QEvent::WindowDeactivate);
+ EventSpy sceneActivationChangeSpy(&scene, QEvent::ActivationChange);
+
+ scene.setActivePanel(panel);
+ QCOMPARE(scene.activePanel(), (QGraphicsItem *)0);
+ QCOMPARE(itemActivateSpy.count(), 0);
+ QCOMPARE(itemDeactivateSpy.count(), 0);
+ QCOMPARE(panelActivateSpy.count(), 0);
+ QCOMPARE(panelDeactivateSpy.count(), 0);
+ QCOMPARE(sceneActivationChangeSpy.count(), 0);
+}
+
+void tst_QGraphicsItem::activationOnShowHide()
+{
+ QGraphicsScene scene;
+ QEvent activate(QEvent::WindowActivate);
+ QApplication::sendEvent(&scene, &activate);
+
+ QGraphicsRectItem *rootPanel = scene.addRect(QRectF());
+ rootPanel->setFlag(QGraphicsItem::ItemIsPanel);
+ rootPanel->setActive(true);
+
+ QGraphicsRectItem *subPanel = new QGraphicsRectItem;
+ subPanel->setFlag(QGraphicsItem::ItemIsPanel);
+
+ // Reparenting onto an active panel auto-activates the child panel.
+ subPanel->setParentItem(rootPanel);
+ QVERIFY(subPanel->isActive());
+ QVERIFY(!rootPanel->isActive());
+
+ // Hiding an active child panel will reactivate the parent panel.
+ subPanel->hide();
+ QVERIFY(rootPanel->isActive());
+
+ // Showing a child panel will auto-activate it.
+ subPanel->show();
+ QVERIFY(subPanel->isActive());
+ QVERIFY(!rootPanel->isActive());
+
+ // Adding an unrelated panel doesn't affect activation.
+ QGraphicsRectItem *otherPanel = new QGraphicsRectItem;
+ otherPanel->setFlag(QGraphicsItem::ItemIsPanel);
+ scene.addItem(otherPanel);
+ QVERIFY(subPanel->isActive());
+
+ // Showing an unrelated panel doesn't affect activation.
+ otherPanel->hide();
+ otherPanel->show();
+ QVERIFY(subPanel->isActive());
+
+ // Add a non-panel item.
+ QGraphicsRectItem *otherItem = new QGraphicsRectItem;
+ scene.addItem(otherItem);
+ otherItem->setActive(true);
+ QVERIFY(otherItem->isActive());
+
+ // Reparent a panel onto an active non-panel item.
+ subPanel->setParentItem(otherItem);
+ QVERIFY(subPanel->isActive());
+
+ // Showing a child panel of a non-panel item will activate it.
+ subPanel->hide();
+ QVERIFY(!subPanel->isActive());
+ QVERIFY(otherItem->isActive());
+ subPanel->show();
+ QVERIFY(subPanel->isActive());
+
+ // Hiding a toplevel active panel will pass activation back
+ // to the non-panel items.
+ rootPanel->setActive(true);
+ rootPanel->hide();
+ QVERIFY(!rootPanel->isActive());
+ QVERIFY(otherItem->isActive());
+}
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index fe25399..65e6e56 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -352,12 +352,12 @@ void tst_QGraphicsWidget::activation()
QEvent activateEvent(QEvent::WindowActivate);
QApplication::sendEvent(&scene, &activateEvent);
- QVERIFY(widget->isActiveWindow());
- QVERIFY(!window1->isActiveWindow());
+ QVERIFY(!widget->isActiveWindow());
+ QVERIFY(window1->isActiveWindow());
QVERIFY(!window2->isActiveWindow());
scene.setActiveWindow(window1);
- QVERIFY(widget->isActiveWindow());
+ QVERIFY(!widget->isActiveWindow());
QVERIFY(window1->isActiveWindow());
QVERIFY(!window2->isActiveWindow());
@@ -1483,6 +1483,7 @@ void tst_QGraphicsWidget::updateFocusChainWhenChildDie()
w->setParentItem(parent);
//We don't crash perfect
QVERIFY(w);
+ QTest::mouseMove(view.viewport());
QTest::mouseClick(view.viewport(), Qt::LeftButton, 0);
QTRY_COMPARE(qApp->activeWindow(), static_cast<QWidget *>(&view));
QTRY_COMPARE(scene.focusItem(), static_cast<QGraphicsItem *>(w));
diff --git a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
index 6549be8..419eb71 100644
--- a/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
+++ b/tests/auto/qhttpnetworkconnection/tst_qhttpnetworkconnection.cpp
@@ -189,7 +189,9 @@ void tst_QHttpNetworkConnection::head()
QCOMPARE(reply->statusCode(), statusCode);
QCOMPARE(reply->reasonPhrase(), statusString);
- QCOMPARE(reply->contentLength(), qint64(contentLength));
+ // only check it if it is set
+ if (reply->contentLength() != -1)
+ QCOMPARE(reply->contentLength(), qint64(contentLength));
QVERIFY(reply->isFinished());
@@ -249,7 +251,9 @@ void tst_QHttpNetworkConnection::get()
QCOMPARE(reply->statusCode(), statusCode);
QCOMPARE(reply->reasonPhrase(), statusString);
- QCOMPARE(reply->contentLength(), qint64(contentLength));
+ // only check it if it is set
+ if (reply->contentLength() != -1)
+ QCOMPARE(reply->contentLength(), qint64(contentLength));
stopWatch.start();
QByteArray ba;
diff --git a/tests/auto/qicon/tst_qicon.cpp b/tests/auto/qicon/tst_qicon.cpp
index b614ab9..bacf7a5 100644
--- a/tests/auto/qicon/tst_qicon.cpp
+++ b/tests/auto/qicon/tst_qicon.cpp
@@ -609,8 +609,7 @@ void tst_QIcon::task184901_badCache()
void tst_QIcon::fromTheme()
{
- const QString prefix = QLatin1String(SRCDIR) + QLatin1String("/");
- QString searchPath = prefix + QLatin1String("/icons");
+ QString searchPath = QLatin1String(":/icons");
QIcon::setThemeSearchPaths(QStringList() << searchPath);
QVERIFY(QIcon::themeSearchPaths().size() == 1);
QCOMPARE(searchPath, QIcon::themeSearchPaths()[0]);
diff --git a/tests/auto/qicon/tst_qicon.qrc b/tests/auto/qicon/tst_qicon.qrc
index 1e1a030..7925a33 100644
--- a/tests/auto/qicon/tst_qicon.qrc
+++ b/tests/auto/qicon/tst_qicon.qrc
@@ -2,5 +2,19 @@
<qresource prefix="/">
<file>image.png</file>
<file>rect.png</file>
+<file>./icons/testtheme/16x16/actions/appointment-new.png</file>
+<file>./icons/testtheme/22x22/actions/appointment-new.png</file>
+<file>./icons/testtheme/32x32/actions/appointment-new.png</file>
+<file>./icons/testtheme/index.theme</file>
+<file>./icons/testtheme/scalable/actions/svg-only.svg</file>
+<file>./icons/themeparent/16x16/actions/address-book-new.png</file>
+<file>./icons/themeparent/16x16/actions/appointment-new.png</file>
+<file>./icons/themeparent/22x22/actions/address-book-new.png</file>
+<file>./icons/themeparent/22x22/actions/appointment-new.png</file>
+<file>./icons/themeparent/32x32/actions/address-book-new.png</file>
+<file>./icons/themeparent/32x32/actions/appointment-new.png</file>
+<file>./icons/themeparent/index.theme</file>
+<file>./icons/themeparent/scalable/actions/address-book-new.svg</file>
+<file>./icons/themeparent/scalable/actions/appointment-new.svg</file>
</qresource>
</RCC>
diff --git a/tests/auto/qimagereader/images/qt.gif b/tests/auto/qimagereader/images/qt.gif
new file mode 100644
index 0000000..e0a5a80
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt.gif
Binary files differ
diff --git a/tests/auto/qimagereader/images/qt1.gif b/tests/auto/qimagereader/images/qt1.gif
new file mode 100644
index 0000000..0ce910c
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt1.gif
Binary files differ
diff --git a/tests/auto/qimagereader/images/qt2.gif b/tests/auto/qimagereader/images/qt2.gif
new file mode 100644
index 0000000..993a315
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt2.gif
Binary files differ
diff --git a/tests/auto/qimagereader/images/qt3.gif b/tests/auto/qimagereader/images/qt3.gif
new file mode 100644
index 0000000..7391678
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt3.gif
Binary files differ
diff --git a/tests/auto/qimagereader/images/qt4.gif b/tests/auto/qimagereader/images/qt4.gif
new file mode 100644
index 0000000..41109a9
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt4.gif
Binary files differ
diff --git a/tests/auto/qimagereader/images/qt5.gif b/tests/auto/qimagereader/images/qt5.gif
new file mode 100644
index 0000000..5a3fb54
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt5.gif
Binary files differ
diff --git a/tests/auto/qimagereader/images/qt6.gif b/tests/auto/qimagereader/images/qt6.gif
new file mode 100644
index 0000000..f22e7c9
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt6.gif
Binary files differ
diff --git a/tests/auto/qimagereader/images/qt7.gif b/tests/auto/qimagereader/images/qt7.gif
new file mode 100644
index 0000000..a315671
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt7.gif
Binary files differ
diff --git a/tests/auto/qimagereader/images/qt8.gif b/tests/auto/qimagereader/images/qt8.gif
new file mode 100644
index 0000000..2a7d09e
--- /dev/null
+++ b/tests/auto/qimagereader/images/qt8.gif
Binary files differ
diff --git a/tests/auto/qimagereader/qimagereader.qrc b/tests/auto/qimagereader/qimagereader.qrc
index c6b963b..11b9406 100644
--- a/tests/auto/qimagereader/qimagereader.qrc
+++ b/tests/auto/qimagereader/qimagereader.qrc
@@ -1,5 +1,5 @@
-<!DOCTYPE RCC><RCC version="1.0">
- <qresource>
+<RCC>
+ <qresource prefix="/" >
<file>images/16bpp.bmp</file>
<file>images/4bpp-rle.bmp</file>
<file>images/YCbCr_cmyk.jpg</file>
@@ -48,5 +48,14 @@
<file>images/tst7.png</file>
<file>images/transparent.xpm</file>
<file>images/trolltech.gif</file>
+ <file>images/qt.gif</file>
+ <file>images/qt1.gif</file>
+ <file>images/qt2.gif</file>
+ <file>images/qt3.gif</file>
+ <file>images/qt4.gif</file>
+ <file>images/qt5.gif</file>
+ <file>images/qt6.gif</file>
+ <file>images/qt7.gif</file>
+ <file>images/qt8.gif</file>
</qresource>
</RCC>
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 27c6925..a325a33 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -140,6 +140,7 @@ private slots:
#if defined QTEST_HAVE_GIF
void gifHandlerBugs();
+ void animatedGif();
#endif
void readCorruptImage_data();
@@ -710,6 +711,18 @@ void tst_QImageReader::gifHandlerBugs()
QCOMPARE(im1.convertToFormat(QImage::Format_ARGB32), im2.convertToFormat(QImage::Format_ARGB32));
}
}
+
+void tst_QImageReader::animatedGif()
+{
+ QImageReader io(prefix + "qt.gif");
+ QImage image= io.read();
+ int i=0;
+ while(!image.isNull()){
+ QString frameName = QString(prefix + "qt%1.gif").arg(++i);
+ QCOMPARE(image, QImage(frameName));
+ image=io.read();
+ }
+}
#endif
class Server : public QObject
diff --git a/tests/auto/qmake/testdata/include_function/main.cpp b/tests/auto/qmake/testdata/include_function/main.cpp
index 0a8e3d3..61d8808 100644
--- a/tests/auto/qmake/testdata/include_function/main.cpp
+++ b/tests/auto/qmake/testdata/include_function/main.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
int main(int /*argc*/, char ** /*argv*/)
{
return 0;
diff --git a/tests/auto/qmargins/qmargins.pro b/tests/auto/qmargins/qmargins.pro
new file mode 100644
index 0000000..5a6aa4f
--- /dev/null
+++ b/tests/auto/qmargins/qmargins.pro
@@ -0,0 +1,3 @@
+load(qttest_p4)
+SOURCES += tst_qmargins.cpp
+QT = core
diff --git a/tests/auto/qmargins/tst_qmargins.cpp b/tests/auto/qmargins/tst_qmargins.cpp
new file mode 100644
index 0000000..6ee2495
--- /dev/null
+++ b/tests/auto/qmargins/tst_qmargins.cpp
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+#include <qmargins.h>
+
+Q_DECLARE_METATYPE(QMargins)
+
+//TESTED_CLASS=
+//TESTED_FILES=
+
+class tst_QMargins : public QObject
+{
+ Q_OBJECT
+
+public:
+ tst_QMargins();
+ virtual ~tst_QMargins();
+
+
+public slots:
+ void init();
+ void cleanup();
+private slots:
+ void getSetCheck();
+};
+
+// Testing get/set functions
+void tst_QMargins::getSetCheck()
+{
+ QMargins margins;
+ // int QMargins::width()
+ // void QMargins::setWidth(int)
+ margins.setLeft(0);
+ QCOMPARE(0, margins.left());
+ margins.setTop(INT_MIN);
+ QCOMPARE(INT_MIN, margins.top());
+ margins.setBottom(INT_MAX);
+ QCOMPARE(INT_MAX, margins.bottom());
+ margins.setRight(INT_MAX);
+ QCOMPARE(INT_MAX, margins.right());
+
+ margins = QMargins();
+ QVERIFY(margins.isNull());
+ margins.setLeft(5);
+ margins.setRight(5);
+ QVERIFY(!margins.isNull());
+ QCOMPARE(margins, QMargins(5, 0, 5, 0));
+}
+
+tst_QMargins::tst_QMargins()
+{
+}
+
+tst_QMargins::~tst_QMargins()
+{
+}
+
+void tst_QMargins::init()
+{
+}
+
+void tst_QMargins::cleanup()
+{
+}
+
+
+
+QTEST_APPLESS_MAIN(tst_QMargins)
+#include "tst_qmargins.moc"
diff --git a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
index 52e967f..a223d1c 100644
--- a/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
+++ b/tests/auto/qnetworkreply/tst_qnetworkreply.cpp
@@ -1366,8 +1366,10 @@ void tst_QNetworkReply::getFromHttp()
QCOMPARE(reply->url(), request.url());
QCOMPARE(reply->error(), QNetworkReply::NoError);
QCOMPARE(reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(), 200);
-
- QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), reference.size());
+ QCOMPARE(reply->size(), reference.size());
+ // only compare when the header is set.
+ if (reply->header(QNetworkRequest::ContentLengthHeader).isValid())
+ QCOMPARE(reply->header(QNetworkRequest::ContentLengthHeader).toLongLong(), reference.size());
QCOMPARE(reply->readAll(), reference.readAll());
}
diff --git a/tests/auto/qpainterpath/tst_qpainterpath.cpp b/tests/auto/qpainterpath/tst_qpainterpath.cpp
index 26c1f9b..9c4cbc4 100644
--- a/tests/auto/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/qpainterpath/tst_qpainterpath.cpp
@@ -1145,8 +1145,9 @@ void tst_QPainterPath::testToFillPolygons()
path.lineTo(QPointF(70, 100));
path.lineTo(QPointF(40, 100));
- QPolygonF polygon = path.toFillPolygons(QMatrix()).first();
- QCOMPARE(polygon.count(QPointF(70, 50)), 2);
+ const QList<QPolygonF> polygons = path.toFillPolygons();
+ QCOMPARE(polygons.size(), 2);
+ QCOMPARE(polygons.first().count(QPointF(70, 50)), 0);
}
void tst_QPainterPath::connectPathDuplicatePoint()
diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp
index 02ab1cc..7752a4f 100644
--- a/tests/auto/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/qpixmap/tst_qpixmap.cpp
@@ -95,6 +95,9 @@ private slots:
void fromImage_data();
void fromImage();
+ void fromUninitializedImage_data();
+ void fromUninitializedImage();
+
void convertFromImage_data();
void convertFromImage();
@@ -318,6 +321,32 @@ void tst_QPixmap::fromImage()
QCOMPARE(result, image);
}
+
+void tst_QPixmap::fromUninitializedImage_data()
+{
+ QTest::addColumn<QImage::Format>("format");
+
+ QTest::newRow("Format_Mono") << QImage::Format_Mono;
+ QTest::newRow("Format_MonoLSB") << QImage::Format_MonoLSB;
+ QTest::newRow("Format_Indexed8") << QImage::Format_Indexed8;
+ QTest::newRow("Format_RGB32") << QImage::Format_RGB32;
+ QTest::newRow("Format_ARGB32") << QImage::Format_ARGB32;
+ QTest::newRow("Format_ARGB32_Premultiplied") << QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("Format_RGB16") << QImage::Format_RGB16;
+}
+
+void tst_QPixmap::fromUninitializedImage()
+{
+ QFETCH(QImage::Format, format);
+
+ QImage image(100, 100, format);
+ QPixmap pix = QPixmap::fromImage(image);
+
+ // it simply shouldn't crash...
+ QVERIFY(true);
+
+}
+
void tst_QPixmap::convertFromImage_data()
{
QTest::addColumn<QImage>("img1");
diff --git a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
index 68f0620..8fe6839 100644
--- a/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
+++ b/tests/auto/qscriptengineagent/tst_qscriptengineagent.cpp
@@ -155,7 +155,7 @@ struct ScriptEngineEvent
lineNumber(lineNumber)
{ }
- ScriptEngineEvent(Type type, qint64 scriptId = -1)
+ ScriptEngineEvent(Type type, qint64 scriptId = -777)
: type(type), scriptId(scriptId)
{ }
@@ -1593,8 +1593,6 @@ void tst_QScriptEngineAgent::exceptionThrowAndCatch()
{
spy->clear();
eng.evaluate("try { throw new Error('ciao'); } catch (e) { }");
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "Some events are missing when JIT is enabled", Abort);
QCOMPARE(spy->count(), 2);
QCOMPARE(spy->at(0).type, ScriptEngineEvent::ExceptionThrow);
@@ -1606,6 +1604,8 @@ void tst_QScriptEngineAgent::exceptionThrowAndCatch()
QCOMPARE(spy->at(1).type, ScriptEngineEvent::ExceptionCatch);
QCOMPARE(spy->at(1).scriptId, spy->at(0).scriptId);
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "Exception value is not passed in exceptionCatch event when JIT is enabled", Continue);
QVERIFY(spy->at(1).value.strictlyEquals(spy->at(0).value));
}
}
@@ -1728,8 +1728,6 @@ void tst_QScriptEngineAgent::eventOrder_throwAndCatch()
{
spy->clear();
eng.evaluate("try { throw new Error('ciao') } catch (e) { void(e); }");
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "One event is missing when JIT is enabled", Abort);
QCOMPARE(spy->count(), 12);
// load
QCOMPARE(spy->at(0).type, ScriptEngineEvent::ScriptLoad);
@@ -1751,6 +1749,8 @@ void tst_QScriptEngineAgent::eventOrder_throwAndCatch()
QVERIFY(spy->at(7).hasExceptionHandler);
// catch
QCOMPARE(spy->at(8).type, ScriptEngineEvent::ExceptionCatch);
+ if (qt_script_isJITEnabled())
+ QEXPECT_FAIL("", "Exception value is not passed in exceptionCatch event when JIT is enabled", Continue);
QVERIFY(spy->at(8).value.isError());
// void(e)
QCOMPARE(spy->at(9).type, ScriptEngineEvent::PositionChange);
@@ -1914,8 +1914,6 @@ void tst_QScriptEngineAgent::eventOrder_throwCatchFinally()
{
spy->clear();
eng.evaluate("try { throw 1; } catch(e) { i = e; } finally { i = 2; }");
- if (qt_script_isJITEnabled())
- QEXPECT_FAIL("", "One event is missing when JIT is enabled", Abort);
QCOMPARE(spy->count(), 9);
// load
@@ -2100,6 +2098,7 @@ void tst_QScriptEngineAgent::syntaxError()
i = 2;
QCOMPARE(spy->at(i).type, ScriptEngineEvent::ContextPush);
+ QEXPECT_FAIL("","The test is broken, contextPush event do not provide scriptId", Continue);
QVERIFY(spy->at(i).scriptId == -1);
i = 3;
QCOMPARE(spy->at(i).type, ScriptEngineEvent::FunctionEntry);
@@ -2109,6 +2108,7 @@ void tst_QScriptEngineAgent::syntaxError()
QVERIFY(spy->at(i).scriptId == -1);
i = 5;
QCOMPARE(spy->at(i).type, ScriptEngineEvent::ContextPop);
+ QEXPECT_FAIL("","The test is broken, contextPop event do not provide scriptId", Continue);
QVERIFY(spy->at(i).scriptId == -1);
i = 6;
QCOMPARE(spy->at(i).type, ScriptEngineEvent::ExceptionThrow);
diff --git a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
index a6b887a..e9a0670 100644
--- a/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
+++ b/tests/auto/qsqldatabase/tst_qsqldatabase.cpp
@@ -180,6 +180,8 @@ private slots:
void odbc_uintfield();
void odbc_bindBoolean_data() { generic_data("QODBC"); }
void odbc_bindBoolean();
+ void odbc_testqGetString_data() { generic_data("QODBC"); }
+ void odbc_testqGetString();
void oci_serverDetach_data() { generic_data("QOCI"); }
void oci_serverDetach(); // For task 154518
@@ -347,6 +349,7 @@ void tst_QSqlDatabase::dropTestTables(QSqlDatabase db)
<< qTableName("numericfields")
<< qTableName("qtest_ibaseblobs")
<< qTableName("qtestBindBool")
+ << qTableName("testqGetString")
<< qTableName("qtest_sqlguid")
<< qTableName("uint_table")
<< qTableName("uint_test")
@@ -2024,6 +2027,44 @@ void tst_QSqlDatabase::odbc_bindBoolean()
QCOMPARE(q.value(1).toBool(), false);
}
+void tst_QSqlDatabase::odbc_testqGetString()
+{
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+
+ QSqlQuery q(db);
+ QVERIFY_SQL(q, exec("CREATE TABLE " + qTableName("testqGetString") + "(id int, vcvalue varchar(65538))"));
+
+ QString largeString;
+ largeString.fill('A', 65536);
+
+ // Bind and insert
+ QVERIFY_SQL(q, prepare("INSERT INTO " + qTableName("testqGetString") + " VALUES(?, ?)"));
+ q.bindValue(0, 1);
+ q.bindValue(1, largeString);
+ QVERIFY_SQL(q, exec());
+ q.bindValue(0, 2);
+ q.bindValue(1, largeString+QLatin1Char('B'));
+ QVERIFY_SQL(q, exec());
+ q.bindValue(0, 3);
+ q.bindValue(1, largeString+QLatin1Char('B')+QLatin1Char('C'));
+ QVERIFY_SQL(q, exec());
+
+ // Retrive
+ QVERIFY_SQL(q, exec("SELECT id, vcvalue FROM " + qTableName("testqGetString") + " ORDER BY id"));
+ QVERIFY_SQL(q, next());
+ QCOMPARE(q.value(0).toInt(), 1);
+ QCOMPARE(q.value(1).toString().length(), 65536);
+ QVERIFY_SQL(q, next());
+ QCOMPARE(q.value(0).toInt(), 2);
+ QCOMPARE(q.value(1).toString().length(), 65537);
+ QVERIFY_SQL(q, next());
+ QCOMPARE(q.value(0).toInt(), 3);
+ QCOMPARE(q.value(1).toString().length(), 65538);
+}
+
+
void tst_QSqlDatabase::mysql_multiselect()
{
QFETCH(QString, dbName);
diff --git a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
index add48c4..4dfb6b9 100644
--- a/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
+++ b/tests/auto/qsslcertificate/tst_qsslcertificate.cpp
@@ -267,6 +267,8 @@ void tst_QSslCertificate::compareCertificates(
QCOMPARE(cert1.alternateSubjectNames(), cert2.alternateSubjectNames());
QCOMPARE(cert1.effectiveDate(), cert2.effectiveDate());
QCOMPARE(cert1.expiryDate(), cert2.expiryDate());
+ QCOMPARE(cert1.version(), cert2.version());
+ QCOMPARE(cert1.serialNumber(), cert2.serialNumber());
// ### add more functions here ...
}
@@ -677,7 +679,9 @@ void tst_QSslCertificate::certInfo()
QCOMPARE(cert.subjectInfo("C"), QString("NO"));
QCOMPARE(cert.subjectInfo("ST"), QString());
- QCOMPARE(cert.version(), QByteArray());
+ QCOMPARE(cert.version(), QByteArray::number(1));
+ QCOMPARE(cert.serialNumber(), QByteArray::number(17));
+
QCOMPARE(cert.toPem().constData(), (const char*)pem);
QCOMPARE(cert.toDer(), QByteArray::fromHex(der));
diff --git a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
index b797c39..5a84cc1 100644
--- a/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
+++ b/tests/auto/qtemporaryfile/tst_qtemporaryfile.cpp
@@ -93,6 +93,8 @@ private slots:
void renameFdLeak();
void reOpenThroughQFile();
void keepOpenMode();
+ void resetTemplateAfterError();
+ void setTemplateAfterOpen();
public:
};
@@ -476,5 +478,85 @@ void tst_QTemporaryFile::keepOpenMode()
}
}
+void tst_QTemporaryFile::resetTemplateAfterError()
+{
+ // calling setFileTemplate on a failed open
+
+ QString tempPath = QDir::tempPath();
+
+ QString const fileTemplate("destination/qt_temp_file_test.XXXXXX");
+ QString const fileTemplate2(tempPath + "/qt_temp_file_test.XXXXXX");
+
+ QVERIFY2( QDir(tempPath).exists() || QDir().mkpath(tempPath), "Test precondition" );
+ QVERIFY2( !QFile::exists("destination"), "Test precondition" );
+ QVERIFY2( !QFile::exists(fileTemplate2) || QFile::remove(fileTemplate2), "Test precondition" );
+
+ QFile file(fileTemplate2);
+ QByteArray fileContent("This file is intentionally NOT left empty.");
+
+ QVERIFY( file.open(QIODevice::ReadWrite | QIODevice::Truncate) );
+ QCOMPARE( file.write(fileContent), (qint64)fileContent.size() );
+ QVERIFY( file.flush() );
+
+ QString fileName;
+ {
+ QTemporaryFile temp;
+
+ QVERIFY( temp.fileName().isEmpty() );
+ QVERIFY( !temp.fileTemplate().isEmpty() );
+
+ temp.setFileTemplate( fileTemplate );
+
+ QVERIFY( temp.fileName().isEmpty() );
+ QCOMPARE( temp.fileTemplate(), fileTemplate );
+
+ QVERIFY( !temp.open() );
+
+ QVERIFY( temp.fileName().isEmpty() );
+ QCOMPARE( temp.fileTemplate(), fileTemplate );
+
+ temp.setFileTemplate( fileTemplate2 );
+ QVERIFY( temp.open() );
+
+ fileName = temp.fileName();
+ QVERIFY( QFile::exists(fileName) );
+ QVERIFY( !fileName.isEmpty() );
+ QVERIFY2( fileName != fileTemplate2,
+ ("Generated name shouldn't be same as template: " + fileTemplate2).toLocal8Bit().constData() );
+ }
+
+ QVERIFY( !QFile::exists(fileName) );
+
+ file.seek(0);
+ QCOMPARE( QString(file.readAll()), QString(fileContent) );
+ QVERIFY( file.remove() );
+}
+
+void tst_QTemporaryFile::setTemplateAfterOpen()
+{
+ QTemporaryFile temp;
+
+ QVERIFY( temp.fileName().isEmpty() );
+ QVERIFY( !temp.fileTemplate().isEmpty() );
+
+ QVERIFY( temp.open() );
+
+ QString const fileName = temp.fileName();
+ QString const newTemplate("funny-path/funny-name-XXXXXX.tmp");
+
+ QVERIFY( !fileName.isEmpty() );
+ QVERIFY( QFile::exists(fileName) );
+ QVERIFY( !temp.fileTemplate().isEmpty() );
+ QVERIFY( temp.fileTemplate() != newTemplate );
+
+ temp.close(); // QTemporaryFile::setFileTemplate will assert on isOpen() up to 4.5.2
+ temp.setFileTemplate(newTemplate);
+ QCOMPARE( temp.fileTemplate(), newTemplate );
+
+ QVERIFY( temp.open() );
+ QCOMPARE( temp.fileName(), fileName );
+ QCOMPARE( temp.fileTemplate(), newTemplate );
+}
+
QTEST_MAIN(tst_QTemporaryFile)
#include "tst_qtemporaryfile.moc"
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index ef43c3a..6709807 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -233,6 +233,7 @@ private slots:
void task239271_addRowsWithFirstColumnHidden();
void task254234_proxySort();
void task248022_changeSelection();
+ void task245654_changeModelAndExpandAll();
};
class QtTestModel: public QAbstractItemModel
@@ -3463,6 +3464,35 @@ void tst_QTreeView::task248022_changeSelection()
QCOMPARE(view.selectionModel()->selectedIndexes().count(), list.count());
}
+void tst_QTreeView::task245654_changeModelAndExpandAll()
+{
+ QTreeView view;
+ QStandardItemModel *model = new QStandardItemModel;
+ QStandardItem *top = new QStandardItem("top");
+ QStandardItem *sub = new QStandardItem("sub");
+ top->appendRow(sub);
+ model->appendRow(top);
+ view.setModel(model);
+ view.expandAll();
+ QApplication::processEvents();
+ QVERIFY(view.isExpanded(top->index()));
+
+ //now let's try to delete the model
+ //then repopulate and expand again
+ delete model;
+ model = new QStandardItemModel;
+ top = new QStandardItem("top");
+ sub = new QStandardItem("sub");
+ top->appendRow(sub);
+ model->appendRow(top);
+ view.setModel(model);
+ view.expandAll();
+ QApplication::processEvents();
+ QVERIFY(view.isExpanded(top->index()));
+
+}
+
+
QTEST_MAIN(tst_QTreeView)
#include "tst_qtreeview.moc"
diff --git a/tests/auto/xmlpatternsview/view/FunctionSignaturesView.cpp b/tests/auto/xmlpatternsview/view/FunctionSignaturesView.cpp
index 9fe9db3..4ba7311 100644
--- a/tests/auto/xmlpatternsview/view/FunctionSignaturesView.cpp
+++ b/tests/auto/xmlpatternsview/view/FunctionSignaturesView.cpp
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#include "DebugExpressionFactory.h"
diff --git a/tests/auto/xmlpatternsview/view/MainWindow.cpp b/tests/auto/xmlpatternsview/view/MainWindow.cpp
index 6a47641..b05dd3c 100644
--- a/tests/auto/xmlpatternsview/view/MainWindow.cpp
+++ b/tests/auto/xmlpatternsview/view/MainWindow.cpp
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#include <QCloseEvent>
#include <QFileDialog>
diff --git a/tests/auto/xmlpatternsview/view/TestCaseView.cpp b/tests/auto/xmlpatternsview/view/TestCaseView.cpp
index 8d274c1..1631d45 100644
--- a/tests/auto/xmlpatternsview/view/TestCaseView.cpp
+++ b/tests/auto/xmlpatternsview/view/TestCaseView.cpp
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#include <QDate>
#include <QtDebug>
diff --git a/tests/auto/xmlpatternsview/view/TestResultView.cpp b/tests/auto/xmlpatternsview/view/TestResultView.cpp
index 1024482..a91fe9f 100644
--- a/tests/auto/xmlpatternsview/view/TestResultView.cpp
+++ b/tests/auto/xmlpatternsview/view/TestResultView.cpp
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#include <QHeaderView>
diff --git a/tests/auto/xmlpatternsview/view/TreeSortFilter.cpp b/tests/auto/xmlpatternsview/view/TreeSortFilter.cpp
index ec3d40b..d916397 100644
--- a/tests/auto/xmlpatternsview/view/TreeSortFilter.cpp
+++ b/tests/auto/xmlpatternsview/view/TreeSortFilter.cpp
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#include <QtDebug>
diff --git a/tests/auto/xmlpatternsview/view/UserTestCase.cpp b/tests/auto/xmlpatternsview/view/UserTestCase.cpp
index 01ee2df..1e47007 100644
--- a/tests/auto/xmlpatternsview/view/UserTestCase.cpp
+++ b/tests/auto/xmlpatternsview/view/UserTestCase.cpp
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#include <QCoreApplication>
#include <QDate>
diff --git a/tests/auto/xmlpatternsview/view/XDTItemItem.cpp b/tests/auto/xmlpatternsview/view/XDTItemItem.cpp
index f571a23..ec747b7 100644
--- a/tests/auto/xmlpatternsview/view/XDTItemItem.cpp
+++ b/tests/auto/xmlpatternsview/view/XDTItemItem.cpp
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#include <QList>
#include <QPointer>
diff --git a/tests/auto/xmlpatternsview/view/main.cpp b/tests/auto/xmlpatternsview/view/main.cpp
index c543258..1091f83 100644
--- a/tests/auto/xmlpatternsview/view/main.cpp
+++ b/tests/auto/xmlpatternsview/view/main.cpp
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#include <QtDebug>
diff --git a/tests/auto/xmlpatternsxqts/lib/ASTItem.h b/tests/auto/xmlpatternsxqts/lib/ASTItem.h
index 9c23ecc..d81d0eb 100644
--- a/tests/auto/xmlpatternsxqts/lib/ASTItem.h
+++ b/tests/auto/xmlpatternsxqts/lib/ASTItem.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_ASTItem_H
#define PatternistSDK_ASTItem_H
diff --git a/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.h b/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.h
index 98325e8..5b396cd 100644
--- a/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.h
+++ b/tests/auto/xmlpatternsxqts/lib/DebugExpressionFactory.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_DebugExpressionFactory_H
#define PatternistSDK_DebugExpressionFactory_H
diff --git a/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.h b/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.h
index 4afdc10..7ec85bf 100644
--- a/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.h
+++ b/tests/auto/xmlpatternsxqts/lib/ExpressionNamer.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_ExpressionNamer_H
#define PatternistSDK_ExpressionNamer_H
diff --git a/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.h b/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.h
index 18415c7..c16fcb0 100644
--- a/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.h
+++ b/tests/auto/xmlpatternsxqts/lib/ExternalSourceLoader.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_ExternalSourceLoader_H
#define PatternistSDK_ExternalSourceLoader_H
diff --git a/tests/auto/xmlpatternsxqts/lib/Global.h b/tests/auto/xmlpatternsxqts/lib/Global.h
index 6cd2e56..8403059 100644
--- a/tests/auto/xmlpatternsxqts/lib/Global.h
+++ b/tests/auto/xmlpatternsxqts/lib/Global.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_Global_H
#define PatternistSDK_Global_H
diff --git a/tests/auto/xmlpatternsxqts/lib/ResultThreader.h b/tests/auto/xmlpatternsxqts/lib/ResultThreader.h
index e7be8d8..1eb6381 100644
--- a/tests/auto/xmlpatternsxqts/lib/ResultThreader.h
+++ b/tests/auto/xmlpatternsxqts/lib/ResultThreader.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_ResultThreader_H
#define PatternistSDK_ResultThreader_H
diff --git a/tests/auto/xmlpatternsxqts/lib/TestBaseLine.h b/tests/auto/xmlpatternsxqts/lib/TestBaseLine.h
index b0d2d08..462608c 100644
--- a/tests/auto/xmlpatternsxqts/lib/TestBaseLine.h
+++ b/tests/auto/xmlpatternsxqts/lib/TestBaseLine.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_TestBaseLine_H
#define PatternistSDK_TestBaseLine_H
diff --git a/tests/auto/xmlpatternsxqts/lib/TestCase.h b/tests/auto/xmlpatternsxqts/lib/TestCase.h
index 4949a67..f81c7d2 100644
--- a/tests/auto/xmlpatternsxqts/lib/TestCase.h
+++ b/tests/auto/xmlpatternsxqts/lib/TestCase.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_TestCase_H
#define PatternistSDK_TestCase_H
diff --git a/tests/auto/xmlpatternsxqts/lib/TestResult.h b/tests/auto/xmlpatternsxqts/lib/TestResult.h
index cc7c730..353bcf8 100644
--- a/tests/auto/xmlpatternsxqts/lib/TestResult.h
+++ b/tests/auto/xmlpatternsxqts/lib/TestResult.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_TestResult_H
#define PatternistSDK_TestResult_H
diff --git a/tests/auto/xmlpatternsxqts/lib/TestResultHandler.h b/tests/auto/xmlpatternsxqts/lib/TestResultHandler.h
index 0f58dab..539960f 100644
--- a/tests/auto/xmlpatternsxqts/lib/TestResultHandler.h
+++ b/tests/auto/xmlpatternsxqts/lib/TestResultHandler.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_TestResultHandler_H
#define PatternistSDK_TestResultHandler_H
diff --git a/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.h b/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.h
index eea4b88..db5f860 100644
--- a/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.h
+++ b/tests/auto/xmlpatternsxqts/lib/TestSuiteHandler.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_TestSuiteHandler_H
#define PatternistSDK_TestSuiteHandler_H
diff --git a/tests/auto/xmlpatternsxqts/lib/Worker.h b/tests/auto/xmlpatternsxqts/lib/Worker.h
index 28c67db..b4e30b3 100644
--- a/tests/auto/xmlpatternsxqts/lib/Worker.h
+++ b/tests/auto/xmlpatternsxqts/lib/Worker.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_Worker_H
#define PatternistSDK_Worker_H
diff --git a/tests/auto/xmlpatternsxqts/lib/XMLWriter.h b/tests/auto/xmlpatternsxqts/lib/XMLWriter.h
index e90f0ba..ce2c961 100644
--- a/tests/auto/xmlpatternsxqts/lib/XMLWriter.h
+++ b/tests/auto/xmlpatternsxqts/lib/XMLWriter.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_XMLWriter_H
#define PatternistSDK_XMLWriter_H
diff --git a/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.h b/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.h
index c5db141..9652550 100644
--- a/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.h
+++ b/tests/auto/xmlpatternsxqts/lib/XQTSTestCase.h
@@ -38,47 +38,6 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Patternist project on Qt Labs.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-***************************************************************************
-*/
#ifndef PatternistSDK_XQTSTestCase_H
#define PatternistSDK_XQTSTestCase_H