summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result2
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result4
-rw-r--r--tests/auto/macplist/tst_macplist.cpp1
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp2
-rw-r--r--tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp4
-rw-r--r--tests/auto/qgl/tst_qgl.cpp10
-rw-r--r--tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp8
-rw-r--r--tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp11
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp226
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp11
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp58
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp10
-rw-r--r--tests/auto/qgroupbox/tst_qgroupbox.cpp1
-rw-r--r--tests/auto/qimagereader/tst_qimagereader.cpp82
-rw-r--r--tests/auto/qkeysequence/qkeysequence.pro4
-rw-r--r--tests/auto/qkeysequence/qkeysequence.qrc6
-rw-r--r--tests/auto/qkeysequence/qt_de.qmbin0 -> 186240 bytes
-rw-r--r--tests/auto/qkeysequence/tst_qkeysequence.cpp4
-rw-r--r--tests/auto/qlineedit/tst_qlineedit.cpp1
-rw-r--r--tests/auto/qprocess/tst_qprocess.cpp2
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp38
-rw-r--r--tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp61
-rw-r--r--tests/auto/qtimer/tst_qtimer.cpp12
-rw-r--r--tests/auto/qtoolbar/tst_qtoolbar.cpp8
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp5
-rw-r--r--tests/auto/uic/tst_uic.cpp18
-rw-r--r--tests/auto/uic/uic.pro2
-rw-r--r--tests/auto/uic3/baseline/customwidgeteditor.ui.err68
-rw-r--r--tests/auto/uic3/baseline/dbconnections.ui.err10
-rw-r--r--tests/auto/uic3/baseline/gotolinedialog.ui.err2
-rw-r--r--tests/auto/uic3/baseline/listboxeditor.ui.42
-rw-r--r--tests/auto/uic3/baseline/mainwindowwizard.ui.err24
-rw-r--r--tests/auto/uic3/baseline/paletteeditor.ui.err12
-rw-r--r--tests/auto/uic3/baseline/paletteeditoradvanced.ui.err20
-rw-r--r--tests/auto/uic3/baseline/paletteeditoradvancedbase.ui.err16
-rw-r--r--tests/auto/uic3/baseline/richtextfontdialog.ui.err2
-rw-r--r--tests/auto/uic3/baseline/settingsdialog.ui.err2
-rw-r--r--tests/auto/uic3/baseline/wizardeditor.ui.42
-rw-r--r--tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro2
-rw-r--r--tests/manual/qcursor/allcursors/allcursors.pro16
-rw-r--r--tests/manual/qcursor/allcursors/main.cpp13
-rw-r--r--tests/manual/qcursor/allcursors/mainwindow.cpp43
-rw-r--r--tests/manual/qcursor/allcursors/mainwindow.h28
-rw-r--r--tests/manual/qcursor/allcursors/mainwindow.ui210
-rw-r--r--tests/manual/qcursor/grab_override/data/monkey_on_64x64.pngbin0 -> 3479 bytes
-rw-r--r--tests/manual/qcursor/grab_override/grab_override.pro18
-rw-r--r--tests/manual/qcursor/grab_override/images.qrc6
-rw-r--r--tests/manual/qcursor/grab_override/main.cpp13
-rw-r--r--tests/manual/qcursor/grab_override/mainwindow.cpp100
-rw-r--r--tests/manual/qcursor/grab_override/mainwindow.h35
-rw-r--r--tests/manual/qcursor/grab_override/mainwindow.ui97
-rw-r--r--tests/manual/qcursor/qcursor.pro3
53 files changed, 1220 insertions, 121 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result
index f2d109b..d3a5fdf 100644
--- a/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/backslashes/project.ts.result
@@ -4,7 +4,7 @@
<context>
<name>QApplication</name>
<message>
- <location filename="../src/main.cpp" line="10"/>
+ <location filename="../src/main.cpp" line="51"/>
<source>QT_LAYOUT_DIRECTION</source>
<comment>Translate this string to the string &apos;LTR&apos; in left-to-right languages or to &apos;RTL&apos; in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout.</comment>
<translation type="unfinished"></translation>
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before
index 1ad6ec8..6a1f625 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before
+++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before
@@ -3,18 +3,18 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="project.ui" line="15"/>
+ <location filename="project.ui" line="57"/>
<source>Qt Assistant - Find text</source>
<!--should be changed to unfinished, since we are changing the sourcetext in the UI file-->
<translation>Qt Assistant - Finn tekst</translation>
</message>
<message>
- <location filename="project.ui" line="18"/>
+ <location filename="project.ui" line="60"/>
<source>300px</source>
<translation>300px</translation>
</message>
<message>
- <location filename="project.ui" line="21"/>
+ <location filename="project.ui" line="63"/>
<source>400px</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result
index 93adae4..b27d239 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result
@@ -4,12 +4,12 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="project.ui" line="48"/>
+ <location filename="project.ui" line="55"/>
<source>Qt Assistant - Finn text</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
- <location filename="project.ui" line="51"/>
+ <location filename="project.ui" line="58"/>
<source>Finn tekst - Der Bjørn möchte auch mal.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/macplist/tst_macplist.cpp b/tests/auto/macplist/tst_macplist.cpp
index 7a2b1d8..aa52b95 100644
--- a/tests/auto/macplist/tst_macplist.cpp
+++ b/tests/auto/macplist/tst_macplist.cpp
@@ -171,7 +171,6 @@ void tst_MacPlist::test_plist()
QVERIFY(dir.cdUp());
QVERIFY(dir.cdUp());
QVERIFY(dir.cdUp());
- QVERIFY(dir.cdUp());
QVERIFY(dir.cd(QLatin1String("app")));
QVERIFY(dir.cd(QLatin1String("app.app")));
QVERIFY(dir.cd(QLatin1String("Contents")));
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index 810be04..da97c7d 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -2371,7 +2371,7 @@ void tst_QComboBox::task260974_menuItemRectangleForComboBoxPopup()
comboBox.showPopup();
QTest::qWait(100);
- QVERIFY(style.discoveredRect.width() <= comboBox.width());
+ QTRY_VERIFY(style.discoveredRect.width() <= comboBox.width());
}
}
diff --git a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
index e7bb93f..502e983 100644
--- a/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
+++ b/tests/auto/qdoublespinbox/tst_qdoublespinbox.cpp
@@ -775,9 +775,11 @@ void tst_QDoubleSpinBox::editingFinished()
layout->addWidget(box2);
testFocusWidget->show();
+ QApplication::setActiveWindow(testFocusWidget);
QTest::qWait(10);
- QTRY_VERIFY(box->isActiveWindow());
+ QTRY_VERIFY(testFocusWidget->isActiveWindow());
box->setFocus();
+ QTRY_VERIFY(box->hasFocus());
QSignalSpy editingFinishedSpy1(box, SIGNAL(editingFinished()));
QSignalSpy editingFinishedSpy2(box2, SIGNAL(editingFinished()));
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index a0b8b5d..60a3f87 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -683,8 +683,16 @@ void tst_QGL::openGLVersionCheck()
// However, the complicated parts are in openGLVersionFlags(const QString &versionString)
// tested above
+#if defined(QT_OPENGL_ES_1)
+ QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Common_Version_1_0);
+#elif defined(QT_OPENGL_ES_1_CL)
+ QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_CommonLite_Version_1_0);
+#elif defined(QT_OPENGL_ES_2)
+ QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_ES_Version_2_0);
+#else
QVERIFY(QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_1);
-#endif
+#endif //defined(QT_OPENGL_ES_1)
+#endif //QT_BUILD_INTERNAL
}
class UnclippedWidget : public QWidget
diff --git a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
index 059ad33..5bb3746 100644
--- a/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
+++ b/tests/auto/qgraphicsanchorlayout/tst_qgraphicsanchorlayout.cpp
@@ -1079,9 +1079,15 @@ void tst_QGraphicsAnchorLayout::delete_anchor()
QVERIFY(anchor1);
QGraphicsAnchor *anchor2 = l->anchor(w3, Qt::AnchorRight, l, Qt::AnchorRight);
QVERIFY(anchor2);
+ QGraphicsAnchor *anchor3 = l->anchor(l, Qt::AnchorRight, w3, Qt::AnchorRight);
+ QVERIFY(anchor3);
+ QGraphicsAnchor *anchor4 = l->anchor(l, Qt::AnchorRight, w3, Qt::AnchorRight);
+ QVERIFY(anchor4);
- // should be the same object
+ // should all be the same object
QCOMPARE(anchor1, anchor2);
+ QCOMPARE(anchor2, anchor3);
+ QCOMPARE(anchor3, anchor4);
// check if removal works
delete anchor1;
diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
index d5205cd..ba3783b 100644
--- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -41,6 +41,7 @@
#include <QtTest/QtTest>
+#include <QtGui/qdesktopwidget.h>
#include <QtGui/qgraphicseffect.h>
#include <QtGui/qgraphicsview.h>
#include <QtGui/qgraphicsscene.h>
@@ -369,6 +370,11 @@ void tst_QGraphicsEffect::opacity()
void tst_QGraphicsEffect::grayscale()
{
+ if (qApp->desktop()->depth() < 24) {
+ QSKIP("Test only works on 32 bit displays", SkipAll);
+ return;
+ }
+
QGraphicsScene scene(0, 0, 100, 100);
QGraphicsRectItem *item = scene.addRect(0, 0, 50, 50);
@@ -412,6 +418,11 @@ void tst_QGraphicsEffect::grayscale()
void tst_QGraphicsEffect::colorize()
{
+ if (qApp->desktop()->depth() < 24) {
+ QSKIP("Test only works on 32 bit displays", SkipAll);
+ return;
+ }
+
QGraphicsScene scene(0, 0, 100, 100);
QGraphicsRectItem *item = scene.addRect(0, 0, 50, 50);
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 5e8f4c4..fa163d8 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -246,6 +246,7 @@ private slots:
void itemClipsToShape();
void itemClipsChildrenToShape();
void itemClipsChildrenToShape2();
+ void itemClipsChildrenToShape3();
void itemClipsTextChildToShape();
void itemClippingDiscovery();
void ancestorFlags();
@@ -293,6 +294,8 @@ private slots:
void setActivePanelOnInactiveScene();
void activationOnShowHide();
void moveWhileDeleting();
+ void ensureDirtySceneTransform();
+ void focusScope();
// task specific tests below me
void task141694_textItemEnsureVisible();
@@ -5048,6 +5051,37 @@ void tst_QGraphicsItem::itemClipsChildrenToShape2()
#endif
}
+void tst_QGraphicsItem::itemClipsChildrenToShape3()
+{
+ // Construct a scene with nested children, each 50 pixels offset from the elder.
+ // Set a top-level clipping flag
+ QGraphicsScene scene;
+ QGraphicsRectItem *parent = scene.addRect( 0, 0, 150, 150 );
+ QGraphicsRectItem *child = scene.addRect( 0, 0, 150, 150 );
+ QGraphicsRectItem *grandchild = scene.addRect( 0, 0, 150, 150 );
+ child->setParentItem(parent);
+ grandchild->setParentItem(child);
+ child->setPos( 50, 50 );
+ grandchild->setPos( 50, 50 );
+ parent->setFlag(QGraphicsItem::ItemClipsChildrenToShape);
+
+ QCOMPARE(scene.itemAt(25,25), (QGraphicsItem *)parent);
+ QCOMPARE(scene.itemAt(75,75), (QGraphicsItem *)child);
+ QCOMPARE(scene.itemAt(125,125), (QGraphicsItem *)grandchild);
+ QCOMPARE(scene.itemAt(175,175), (QGraphicsItem *)0);
+
+ // Move child to fully overlap the parent. The grandchild should
+ // now occupy two-thirds of the scene
+ child->prepareGeometryChange();
+ child->setPos( 0, 0 );
+
+ QCOMPARE(scene.itemAt(25,25), (QGraphicsItem *)child);
+ QCOMPARE(scene.itemAt(75,75), (QGraphicsItem *)grandchild);
+ QCOMPARE(scene.itemAt(125,125), (QGraphicsItem *)grandchild);
+ QCOMPARE(scene.itemAt(175,175), (QGraphicsItem *)0);
+}
+
+
void tst_QGraphicsItem::itemClipsTextChildToShape()
{
// Construct a scene with a rect that clips its children, with one text
@@ -7665,6 +7699,11 @@ void tst_QGraphicsItem::subFocus()
QVERIFY(!rect->hasFocus());
QVERIFY(!rect2->hasFocus());
QVERIFY(rect3->hasFocus());
+
+ delete rect2;
+ QCOMPARE(text->focusItem(), (QGraphicsItem *)0);
+ QCOMPARE(text2->focusItem(), (QGraphicsItem *)0);
+ QCOMPARE(rect->focusItem(), (QGraphicsItem *)0);
}
void tst_QGraphicsItem::focusProxyDeletion()
@@ -8156,5 +8195,192 @@ void tst_QGraphicsItem::moveWhileDeleting()
delete rect;
}
+class MyRectItem : public QGraphicsWidget
+{
+ Q_OBJECT
+public:
+ MyRectItem(QGraphicsItem *parent = 0) : QGraphicsWidget(parent)
+ {
+
+ }
+
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
+ {
+ painter->setBrush(brush);
+ painter->drawRect(boundingRect());
+ }
+ void move()
+ {
+ setPos(-100,-100);
+ topLevel->collidingItems(Qt::IntersectsItemBoundingRect);
+ }
+public:
+ QGraphicsItem *topLevel;
+ QBrush brush;
+};
+
+
+void tst_QGraphicsItem::ensureDirtySceneTransform()
+{
+ QGraphicsScene scene;
+
+ MyRectItem *topLevel = new MyRectItem;
+ topLevel->setGeometry(0, 0, 100, 100);
+ topLevel->setPos(-50, -50);
+ topLevel->brush = QBrush(QColor(Qt::black));
+ scene.addItem(topLevel);
+
+ MyRectItem *parent = new MyRectItem;
+ parent->topLevel = topLevel;
+ parent->setGeometry(0, 0, 100, 100);
+ parent->setPos(0, 0);
+ parent->brush = QBrush(QColor(Qt::magenta));
+ parent->setObjectName("parent");
+ scene.addItem(parent);
+
+ MyRectItem *child = new MyRectItem(parent);
+ child->setGeometry(0, 0, 80, 80);
+ child->setPos(10, 10);
+ child->setObjectName("child");
+ child->brush = QBrush(QColor(Qt::blue));
+
+ MyRectItem *child2 = new MyRectItem(parent);
+ child2->setGeometry(0, 0, 80, 80);
+ child2->setPos(15, 15);
+ child2->setObjectName("child2");
+ child2->brush = QBrush(QColor(Qt::green));
+
+ MyRectItem *child3 = new MyRectItem(parent);
+ child3->setGeometry(0, 0, 80, 80);
+ child3->setPos(20, 20);
+ child3->setObjectName("child3");
+ child3->brush = QBrush(QColor(Qt::gray));
+
+ QGraphicsView view(&scene);
+ view.show();
+ QTRY_COMPARE(QApplication::activeWindow(), &view);
+
+ //We move the parent
+ parent->move();
+ QApplication::processEvents();
+
+ //We check if all items moved
+ QCOMPARE(child->pos(), QPointF(10, 10));
+ QCOMPARE(child2->pos(), QPointF(15, 15));
+ QCOMPARE(child3->pos(), QPointF(20, 20));
+
+ QCOMPARE(child->sceneBoundingRect(), QRectF(-90, -90, 80, 80));
+ QCOMPARE(child2->sceneBoundingRect(), QRectF(-85, -85, 80, 80));
+ QCOMPARE(child3->sceneBoundingRect(), QRectF(-80, -80, 80, 80));
+
+ QCOMPARE(child->sceneTransform(), QTransform::fromTranslate(-90, -90));
+ QCOMPARE(child2->sceneTransform(), QTransform::fromTranslate(-85, -85));
+ QCOMPARE(child3->sceneTransform(), QTransform::fromTranslate(-80, -80));
+}
+
+void tst_QGraphicsItem::focusScope()
+{
+ // ItemIsFocusScope is an internal feature (for now).
+ QGraphicsScene scene;
+
+ QGraphicsRectItem *scope3 = new QGraphicsRectItem;
+ scope3->setData(0, "scope3");
+ scope3->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsFocusScope);
+ scope3->setFocus();
+ QVERIFY(!scope3->focusScopeItem());
+ QCOMPARE(scope3->focusItem(), (QGraphicsItem *)scope3);
+
+ QGraphicsRectItem *scope2 = new QGraphicsRectItem;
+ scope2->setData(0, "scope2");
+ scope2->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsFocusScope);
+ scope2->setFocus();
+ QVERIFY(!scope2->focusScopeItem());
+ scope3->setParentItem(scope2);
+ QCOMPARE(scope2->focusScopeItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope2->focusItem(), (QGraphicsItem *)scope3);
+
+ QGraphicsRectItem *scope1 = new QGraphicsRectItem;
+ scope1->setData(0, "scope1");
+ scope1->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsFocusScope);
+ scope1->setFocus();
+ QVERIFY(!scope1->focusScopeItem());
+ scope2->setParentItem(scope1);
+
+ QCOMPARE(scope1->focusItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope2->focusItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope3->focusItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope1->focusScopeItem(), (QGraphicsItem *)scope2);
+ QCOMPARE(scope2->focusScopeItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope3->focusScopeItem(), (QGraphicsItem *)0);
+
+ scene.addItem(scope1);
+
+ QEvent windowActivate(QEvent::WindowActivate);
+ qApp->sendEvent(&scene, &windowActivate);
+ scene.setFocus();
+
+ QCOMPARE(scope1->focusItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope2->focusItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope3->focusItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope1->focusScopeItem(), (QGraphicsItem *)scope2);
+ QCOMPARE(scope2->focusScopeItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope3->focusScopeItem(), (QGraphicsItem *)0);
+
+ QVERIFY(scope3->hasFocus());
+
+ scope3->hide();
+ QVERIFY(scope2->hasFocus());
+ scope2->hide();
+ QVERIFY(scope1->hasFocus());
+ scope2->show();
+ QVERIFY(scope2->hasFocus());
+ scope3->show();
+ QVERIFY(scope3->hasFocus());
+ scope1->hide();
+ QVERIFY(!scope3->hasFocus());
+ scope1->show();
+ QVERIFY(scope3->hasFocus());
+ scope3->clearFocus();
+ QVERIFY(scope2->hasFocus());
+ scope2->clearFocus();
+ QVERIFY(scope1->hasFocus());
+ scope2->hide();
+ scope2->show();
+ QVERIFY(!scope2->hasFocus());
+ QVERIFY(scope3->hasFocus());
+
+ QGraphicsRectItem *rect4 = new QGraphicsRectItem;
+ rect4->setData(0, "rect4");
+ rect4->setParentItem(scope3);
+
+ QGraphicsRectItem *rect5 = new QGraphicsRectItem;
+ rect5->setData(0, "rect5");
+ rect5->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsFocusScope);
+ rect5->setFocus();
+ rect5->setParentItem(rect4);
+ QCOMPARE(scope3->focusScopeItem(), (QGraphicsItem *)rect5);
+ QVERIFY(rect5->hasFocus());
+
+ rect4->setParentItem(0);
+ QCOMPARE(scope3->focusScopeItem(), (QGraphicsItem *)0);
+ QVERIFY(!scope3->hasFocus());
+
+ QGraphicsRectItem *rectA = new QGraphicsRectItem;
+ QGraphicsRectItem *scopeA = new QGraphicsRectItem(rectA);
+ scopeA->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsFocusScope);
+ scopeA->setFocus();
+ QGraphicsRectItem *scopeB = new QGraphicsRectItem(scopeA);
+ scopeB->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsFocusScope);
+ scopeB->setFocus();
+
+ scene.addItem(rectA);
+ QVERIFY(rect5->hasFocus());
+ QVERIFY(!scopeB->hasFocus());
+
+ scopeA->setFocus();
+ QVERIFY(scopeB->hasFocus());
+ QCOMPARE(scopeB->focusItem(), (QGraphicsItem *)scopeB);
+}
+
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 626a691..32b4420 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -1316,6 +1316,7 @@ void tst_QGraphicsProxyWidget::paintEvent()
//make sure we flush all the paint events
QTest::qWait(250);
+ QTRY_VERIFY(proxy.paintCount > 1);
proxy.paintCount = 0;
w->update();
@@ -1507,7 +1508,7 @@ void tst_QGraphicsProxyWidget::scrollUpdate()
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&view);
#endif
- QTRY_COMPARE(view.npaints, 1);
+ QTRY_VERIFY(view.npaints >= 1);
QTest::qWait(20);
widget->paintEventRegion = QRegion();
widget->npaints = 0;
@@ -2071,6 +2072,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexTwoWidgets()
QApplication::setActiveWindow(&window);
window.activateWindow();
QTest::qWait(125);
+ QTRY_COMPARE(QApplication::activeWindow(), &window);
leftDial->setFocus();
QTest::qWait(125);
@@ -2207,6 +2209,7 @@ void tst_QGraphicsProxyWidget::setFocus_simpleWidget()
QApplication::setActiveWindow(&window);
window.activateWindow();
QTest::qWait(125);
+ QTRY_COMPARE(QApplication::activeWindow(), &window);
leftDial->setFocus();
QTest::qWait(125);
@@ -2279,6 +2282,7 @@ void tst_QGraphicsProxyWidget::setFocus_simpleTwoWidgets()
QApplication::setActiveWindow(&window);
window.activateWindow();
QTest::qWait(125);
+ QTRY_COMPARE(QApplication::activeWindow(), &window);
leftDial->setFocus();
QTest::qWait(125);
@@ -2358,6 +2362,7 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets()
QApplication::setActiveWindow(&window);
window.activateWindow();
QTest::qWait(125);
+ QTRY_COMPARE(QApplication::activeWindow(), &window);
leftDial->setFocus();
QTest::qWait(125);
@@ -3350,7 +3355,9 @@ void tst_QGraphicsProxyWidget::clickFocus()
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&view);
#endif
- QTest::qWait(250);
+ QApplication::setActiveWindow(&view);
+ QTest::qWait(25);
+ QTRY_COMPARE(QApplication::activeWindow(), &view);
QVERIFY(!proxy->hasFocus());
QVERIFY(!proxy->widget()->hasFocus());
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index 6998684..07d7cce 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -264,6 +264,8 @@ private slots:
void inputMethod_data();
void inputMethod();
void dispatchHoverOnPress();
+ void initialFocus_data();
+ void initialFocus();
// task specific tests below me
void task139710_bspTreeCrash();
@@ -3822,5 +3824,61 @@ void tst_QGraphicsScene::dispatchHoverOnPress()
}
}
+void tst_QGraphicsScene::initialFocus_data()
+{
+ QTest::addColumn<bool>("activeScene");
+ QTest::addColumn<bool>("explicitSetFocus");
+ QTest::addColumn<bool>("isPanel");
+ QTest::addColumn<bool>("shouldHaveFocus");
+
+ QTest::newRow("inactive scene, normal item") << false << false << false << false;
+ QTest::newRow("inactive scene, panel item") << false << false << true << false;
+ QTest::newRow("inactive scene, normal item, explicit focus") << false << true << false << true;
+ QTest::newRow("inactive scene, panel, explicit focus") << false << true << true << true;
+ QTest::newRow("active scene, normal item") << true << false << false << false;
+ QTest::newRow("active scene, panel item") << true << false << true << false;
+ QTest::newRow("active scene, normal item, explicit focus") << true << true << false << true;
+ QTest::newRow("active scene, panel, explicit focus") << true << true << true << true;
+}
+
+void tst_QGraphicsScene::initialFocus()
+{
+ QFETCH(bool, activeScene);
+ QFETCH(bool, explicitSetFocus);
+ QFETCH(bool, isPanel);
+ QFETCH(bool, shouldHaveFocus);
+
+ QGraphicsRectItem *rect = new QGraphicsRectItem;
+ rect->setFlag(QGraphicsItem::ItemIsFocusable);
+ QVERIFY(!rect->hasFocus());
+
+ if (isPanel)
+ rect->setFlag(QGraphicsItem::ItemIsPanel);
+
+ // Setting focus on an item before adding to the scene will ensure
+ // it gets focus when the scene is activated.
+ if (explicitSetFocus)
+ rect->setFocus();
+
+ QGraphicsScene scene;
+ QVERIFY(!scene.isActive());
+
+ if (activeScene) {
+ QEvent windowActivate(QEvent::WindowActivate);
+ qApp->sendEvent(&scene, &windowActivate);
+ scene.setFocus();
+ }
+
+ scene.addItem(rect);
+
+ if (!activeScene) {
+ QEvent windowActivate(QEvent::WindowActivate);
+ qApp->sendEvent(&scene, &windowActivate);
+ scene.setFocus();
+ }
+
+ QCOMPARE(rect->hasFocus(), shouldHaveFocus);
+}
+
QTEST_MAIN(tst_QGraphicsScene)
#include "tst_qgraphicsscene.moc"
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 6c1ac54..5cb9173 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -3072,9 +3072,11 @@ void tst_QGraphicsView::scrollAfterResize_data()
QTest::addColumn<QTransform>("x2");
QTest::addColumn<QTransform>("x3");
- int frameWidth = qApp->style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
- int extent = qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent);
- int inside = qApp->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents);
+ QPlastiqueStyle style;
+
+ int frameWidth = style.pixelMetric(QStyle::PM_DefaultFrameWidth);
+ int extent = style.pixelMetric(QStyle::PM_ScrollBarExtent);
+ int inside = style.styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents);
int viewportWidth = 300;
int scrollBarIndent = viewportWidth - extent - (inside ? 4 : 2)*frameWidth;
@@ -3095,7 +3097,9 @@ void tst_QGraphicsView::scrollAfterResize()
QFETCH(QTransform, x2);
QFETCH(QTransform, x3);
+ QPlastiqueStyle style;
QGraphicsView view;
+ view.setStyle(&style);
if (reverse)
view.setLayoutDirection(Qt::RightToLeft);
diff --git a/tests/auto/qgroupbox/tst_qgroupbox.cpp b/tests/auto/qgroupbox/tst_qgroupbox.cpp
index 5773804..20eec7e 100644
--- a/tests/auto/qgroupbox/tst_qgroupbox.cpp
+++ b/tests/auto/qgroupbox/tst_qgroupbox.cpp
@@ -467,6 +467,7 @@ void tst_QGroupBox::propagateFocus()
QGroupBox box;
QLineEdit lineEdit(&box);
box.show();
+ QApplication::setActiveWindow(&box);
box.setFocus();
QTest::qWait(250);
QTRY_COMPARE(qApp->focusWidget(), static_cast<QWidget*>(&lineEdit));
diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp
index 8630021..c0d5051 100644
--- a/tests/auto/qimagereader/tst_qimagereader.cpp
+++ b/tests/auto/qimagereader/tst_qimagereader.cpp
@@ -167,6 +167,10 @@ private slots:
void task255627_setNullScaledSize_data();
void task255627_setNullScaledSize();
+
+ void testIgnoresFormatAndExtension_data();
+ void testIgnoresFormatAndExtension();
+
};
static const QLatin1String prefix(SRCDIR "/images/");
@@ -225,6 +229,7 @@ void tst_QImageReader::readImage_data()
QTest::newRow("PPM: runners") << QString("runners.ppm") << true << QByteArray("ppm");
QTest::newRow("PPM: test") << QString("test.ppm") << true << QByteArray("ppm");
QTest::newRow("XBM: gnus") << QString("gnus.xbm") << true << QByteArray("xbm");
+
#if defined QTEST_HAVE_JPEG
QTest::newRow("JPEG: beavis") << QString("beavis.jpg") << true << QByteArray("jpeg");
#endif
@@ -714,13 +719,14 @@ void tst_QImageReader::gifHandlerBugs()
void tst_QImageReader::animatedGif()
{
- QImageReader io(prefix + "qt.gif");
- QImage image= io.read();
- int i=0;
+ QImageReader io(":images/qt.gif");
+ QImage image = io.read();
+ QVERIFY(!image.isNull());
+ int i = 0;
while(!image.isNull()){
- QString frameName = QString(prefix + "qt%1.gif").arg(++i);
+ QString frameName = QString(":images/qt%1.gif").arg(++i);
QCOMPARE(image, QImage(frameName));
- image=io.read();
+ image = io.read();
}
}
#endif
@@ -1495,5 +1501,71 @@ void tst_QImageReader::pixelCompareWithBaseline()
}
}
+
+void tst_QImageReader::testIgnoresFormatAndExtension_data()
+{
+ QTest::addColumn<QString>("name");
+ QTest::addColumn<QString>("extension");
+ QTest::addColumn<QString>("expected");
+
+ QTest::newRow("black.png") << "black" << "png" << "png";
+ QTest::newRow("black.xpm") << "black" << "xpm" << "xpm";
+ QTest::newRow("colorful.bmp") << "colorful" << "bmp" << "bmp";
+ QTest::newRow("image.ppm") << "image" << "ppm" << "ppm";
+ QTest::newRow("image.pbm") << "image" << "pbm" << "pbm";
+ QTest::newRow("image.pgm") << "image" << "pgm" << "pgm";
+
+#if defined QTEST_HAVE_GIF
+ QTest::newRow("bat1.gif") << "bat1" << "gif" << "gif";
+#endif
+
+#if defined QTEST_HAVE_JPEG
+ QTest::newRow("beavis.jpg") << "beavis" << "jpg" << "jpeg";
+#endif
+
+#if defined QTEST_HAVE_MNG
+ QTest::newRow("fire.mng") << "fire" << "mng" << "mng";
+#endif
+
+#if defined QTEST_HAVE_TIFF
+ QTest::newRow("image_100dpi.tif") << "image_100dpi" << "tif" << "tiff";
+#endif
+}
+
+
+void tst_QImageReader::testIgnoresFormatAndExtension()
+{
+ QFETCH(QString, name);
+ QFETCH(QString, extension);
+ QFETCH(QString, expected);
+
+ QList<QByteArray> formats = QImageReader::supportedImageFormats();
+ QString fileNameBase = "images/" + name + ".";
+
+ foreach (const QByteArray &f, formats) {
+ if (f == extension)
+ continue;
+ QFile tmp(QDir::tempPath() + "/" + name + "_" + expected + "." + f);
+
+ QFile::copy(fileNameBase + extension, QFileInfo(tmp).absoluteFilePath());
+
+ QString format;
+ QImage image;
+ {
+ // image reader needs to be scoped for the remove() to work..
+ QImageReader r;
+ r.setFileName(QFileInfo(tmp).absoluteFilePath());
+ r.setDecideFormatFromContent(true);
+ format = r.format();
+ r.read(&image);
+ }
+
+ tmp.remove();
+
+ QVERIFY(!image.isNull());
+ QCOMPARE(format, expected);
+ }
+}
+
QTEST_MAIN(tst_QImageReader)
#include "tst_qimagereader.moc"
diff --git a/tests/auto/qkeysequence/qkeysequence.pro b/tests/auto/qkeysequence/qkeysequence.pro
index 6566340..bd85402 100644
--- a/tests/auto/qkeysequence/qkeysequence.pro
+++ b/tests/auto/qkeysequence/qkeysequence.pro
@@ -1,6 +1,4 @@
load(qttest_p4)
SOURCES += tst_qkeysequence.cpp
-TRANSLATIONS += keys_de.ts
-
-
+RESOURCES += qkeysequence.qrc \ No newline at end of file
diff --git a/tests/auto/qkeysequence/qkeysequence.qrc b/tests/auto/qkeysequence/qkeysequence.qrc
new file mode 100644
index 0000000..e224faa
--- /dev/null
+++ b/tests/auto/qkeysequence/qkeysequence.qrc
@@ -0,0 +1,6 @@
+<RCC>
+ <qresource>
+ <file>keys_de.qm</file>
+ <file>qt_de.qm</file>
+ </qresource>
+</RCC>
diff --git a/tests/auto/qkeysequence/qt_de.qm b/tests/auto/qkeysequence/qt_de.qm
new file mode 100644
index 0000000..595e4d7
--- /dev/null
+++ b/tests/auto/qkeysequence/qt_de.qm
Binary files differ
diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp
index 88d1d55..1c257bf 100644
--- a/tests/auto/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp
@@ -166,9 +166,9 @@ tst_QKeySequence::~tst_QKeySequence()
void tst_QKeySequence::initTestCase()
{
ourTranslator = new QTranslator(this);
- ourTranslator->load(QLatin1String("keys_de"), ".");
+ ourTranslator->load(":/keys_de");
qtTranslator = new QTranslator(this);
- qtTranslator->load(QLatin1String("qt_de"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
+ qtTranslator->load(":/qt_de");
}
void tst_QKeySequence::operatorQString_data()
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp
index 3a81212..1417e69 100644
--- a/tests/auto/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/qlineedit/tst_qlineedit.cpp
@@ -339,6 +339,7 @@ void tst_QLineEdit::initTestCase()
testWidget->resize(200,50);
testWidget->show();
+ QApplication::setActiveWindow(testWidget);
#ifdef Q_WS_X11
// to be safe and avoid failing setFocus with window managers
qt_x11_wait_for_window_manager(testWidget);
diff --git a/tests/auto/qprocess/tst_qprocess.cpp b/tests/auto/qprocess/tst_qprocess.cpp
index 0291f66..cff6487 100644
--- a/tests/auto/qprocess/tst_qprocess.cpp
+++ b/tests/auto/qprocess/tst_qprocess.cpp
@@ -1164,7 +1164,7 @@ void tst_QProcess::softExitInSlots()
SoftExitProcess proc(i);
proc.start(appName);
proc.write("OLEBOLE", 8); // include the \0
- QTestEventLoop::instance().enterLoop(1);
+ QTestEventLoop::instance().enterLoop(10);
QCOMPARE(proc.state(), QProcess::NotRunning);
QVERIFY(proc.waitedForFinished);
}
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index 4bea26d..eb95d611c 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -191,6 +191,9 @@ private slots:
void task_233829_data() { generic_data("QPSQL"); }
void task_233829();
+ void sqlServerReturn0_data() { generic_data(); }
+ void sqlServerReturn0();
+
private:
// returns all database connections
@@ -312,6 +315,13 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db )
tablenames << qTableName( "task_250026" );
tablenames << qTableName( "task_234422" );
+ if (tst_Databases::isSqlServer( db )) {
+ QSqlQuery q( db );
+ q.exec("DROP PROCEDURE " + qTableName("test141895_proc"));
+ }
+
+ tablenames << qTableName("test141895");
+
tst_Databases::safeDropTables( db, tablenames );
}
@@ -2808,5 +2818,33 @@ void tst_QSqlQuery::task_233829()
QVERIFY_SQL(q,exec());
}
+void tst_QSqlQuery::sqlServerReturn0()
+{
+ QFETCH( QString, dbName );
+ QSqlDatabase db = QSqlDatabase::database( dbName );
+ CHECK_DATABASE( db );
+ if (!tst_Databases::isSqlServer( db ))
+ QSKIP("SQL Server specific test", SkipSingle);
+
+ QString tableName(qTableName("test141895")), procName(qTableName("test141895_proc"));
+ QSqlQuery q( db );
+ q.exec("DROP TABLE " + tableName);
+ q.exec("DROP PROCEDURE " + procName);
+ QVERIFY_SQL(q, exec("CREATE TABLE "+tableName+" (id integer)"));
+ QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (1)"));
+ QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (2)"));
+ QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (2)"));
+ QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (3)"));
+ QVERIFY_SQL(q, exec("INSERT INTO "+tableName+" (id) VALUES (1)"));
+ QVERIFY_SQL(q, exec("CREATE PROCEDURE "+procName+
+ " AS "
+ "SELECT * FROM "+tableName+" WHERE ID = 2 "
+ "RETURN 0"));
+
+ QVERIFY_SQL(q, exec("{CALL "+procName+"}"));
+
+ QVERIFY_SQL(q, next());
+}
+
QTEST_MAIN( tst_QSqlQuery )
#include "tst_qsqlquery.moc"
diff --git a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
index 75b5190..073afae 100644
--- a/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
+++ b/tests/auto/qsqltablemodel/tst_qsqltablemodel.cpp
@@ -119,6 +119,11 @@ private slots:
void tableModifyWithBlank_data() { generic_data(); }
void tableModifyWithBlank(); // For mail task
+ void removeColumnAndRow_data() { generic_data(); }
+ void removeColumnAndRow(); // task 256032
+
+ void insertBeforeDelete_data() { generic_data(); }
+ void insertBeforeDelete();
private:
void generic_data(const QString& engine=QString());
};
@@ -989,5 +994,61 @@ void tst_QSqlTableModel::tableModifyWithBlank()
QCOMPARE(model.record(0).value(1).toString(), QLatin1String("col1ModelData"));
}
+void tst_QSqlTableModel::removeColumnAndRow()
+{
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+
+ QSqlTableModel model(0, db);
+ model.setTable(qTableName("test"));
+ model.setEditStrategy(QSqlTableModel::OnManualSubmit);
+ QVERIFY_SQL(model, select());
+ QCOMPARE(model.rowCount(), 3);
+ QCOMPARE(model.columnCount(), 3);
+
+ QVERIFY(model.removeColumn(0));
+ QVERIFY(model.removeRow(0));
+ QVERIFY(model.submitAll());
+ QCOMPARE(model.rowCount(), 2);
+ QCOMPARE(model.columnCount(), 2);
+
+ // check with another table because the model has been modified
+ // but not the sql table
+ QSqlTableModel model2(0, db);
+ model2.setTable(qTableName("test"));
+ QVERIFY_SQL(model2, select());
+ QCOMPARE(model2.rowCount(), 2);
+ QCOMPARE(model2.columnCount(), 3);
+}
+
+void tst_QSqlTableModel::insertBeforeDelete()
+{
+ QFETCH(QString, dbName);
+ QSqlDatabase db = QSqlDatabase::database(dbName);
+ CHECK_DATABASE(db);
+
+ QSqlQuery q(db);
+ QVERIFY_SQL( q, exec("insert into " + qTableName("test") + " values(9, 'andrew', 9)"));
+ QVERIFY_SQL( q, exec("insert into " + qTableName("test") + " values(10, 'justin', 10)"));
+
+ QSqlTableModel model(0, db);
+ model.setTable(qTableName("test"));
+ model.setEditStrategy(QSqlTableModel::OnManualSubmit);
+ QVERIFY_SQL(model, select());
+
+ qDebug() << model.rowCount();
+
+ QSqlRecord rec = model.record();
+ rec.setValue(0, 4);
+ rec.setValue(1, QString("bill"));
+ rec.setValue(2, 4);
+ QVERIFY_SQL(model, insertRecord(4, rec));
+
+ QVERIFY_SQL(model, removeRow(5));
+ QVERIFY_SQL(model, submitAll());
+ QCOMPARE(model.rowCount(), 5);
+}
+
QTEST_MAIN(tst_QSqlTableModel)
#include "tst_qsqltablemodel.moc"
diff --git a/tests/auto/qtimer/tst_qtimer.cpp b/tests/auto/qtimer/tst_qtimer.cpp
index a55c1c6..0877500 100644
--- a/tests/auto/qtimer/tst_qtimer.cpp
+++ b/tests/auto/qtimer/tst_qtimer.cpp
@@ -88,6 +88,7 @@ private slots:
void timerFiresOnlyOncePerProcessEvents_data();
void timerFiresOnlyOncePerProcessEvents();
void timerIdPersistsAfterThreadExit();
+ void cancelLongTimer();
};
class TimerHelper : public QObject
@@ -602,5 +603,16 @@ void tst_QTimer::timerIdPersistsAfterThreadExit()
QVERIFY((timerId & 0xffffff) != (thread.timerId & 0xffffff));
}
+void tst_QTimer::cancelLongTimer()
+{
+ QTimer timer;
+ timer.setSingleShot(true);
+ timer.start(1000 * 60 * 60); //set timer for 1 hour (which would overflow Symbian RTimer)
+ QCoreApplication::processEvents();
+ QVERIFY(timer.isActive()); //if the timer completes immediately with an error, then this will fail
+ timer.stop();
+ QVERIFY(!timer.isActive());
+}
+
QTEST_MAIN(tst_QTimer)
#include "tst_qtimer.moc"
diff --git a/tests/auto/qtoolbar/tst_qtoolbar.cpp b/tests/auto/qtoolbar/tst_qtoolbar.cpp
index 90d7cf4..e4f317c 100644
--- a/tests/auto/qtoolbar/tst_qtoolbar.cpp
+++ b/tests/auto/qtoolbar/tst_qtoolbar.cpp
@@ -55,6 +55,8 @@
#include <qlineedit.h>
#include <qkeysequence.h>
+#include "../../shared/util.h"
+
//TESTED_FILES=
QT_FORWARD_DECLARE_CLASS(QAction)
@@ -973,12 +975,14 @@ void tst_QToolBar::accel()
QSignalSpy spy(action, SIGNAL(triggered(bool)));
mw.show();
- QTest::qWait(1000);
+ QApplication::setActiveWindow(&mw);
+ QTest::qWait(100);
+ QTRY_COMPARE(QApplication::activeWindow(), &mw);
QTest::keyClick(&mw, Qt::Key_T, Qt::AltModifier);
QTest::qWait(300);
- QCOMPARE(spy.count(), 1);
+ QTRY_COMPARE(spy.count(), 1);
#ifdef Q_WS_MAC
qt_set_sequence_auto_mnemonic(false);
#endif
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 86caddb..04b7b39 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -9236,13 +9236,15 @@ void tst_QWidget::destroyBackingStore()
w.reset();
w.update();
- QApplication::processEvents();
delete qt_widget_private(&w)->topData()->backingStore;
qt_widget_private(&w)->topData()->backingStore = 0;
qt_widget_private(&w)->topData()->backingStore = new QWidgetBackingStore(&w);
w.update();
QApplication::processEvents();
+#ifdef Q_WS_QWS
+ QApplication::processEvents();
+#endif
QCOMPARE(w.numPaintEvents, 1);
// Check one more time, because the second time around does more caching.
@@ -9293,6 +9295,7 @@ void tst_QWidget::inputFocus_task257832()
if (!context)
QSKIP("No input context", SkipSingle);
widget->setFocus();
+ widget->winId(); // make sure, widget has been created
context->setFocusWidget(widget);
QCOMPARE(context->focusWidget(), static_cast<QWidget*>(widget));
widget->setReadOnly(true);
diff --git a/tests/auto/uic/tst_uic.cpp b/tests/auto/uic/tst_uic.cpp
index c4759e2..60367b9 100644
--- a/tests/auto/uic/tst_uic.cpp
+++ b/tests/auto/uic/tst_uic.cpp
@@ -55,16 +55,16 @@ class tst_uic : public QObject
public:
tst_uic();
-
+
private Q_SLOTS:
void initTestCase();
-
+
void run();
void run_data() const;
void compare();
void compare_data() const;
-
+
void cleanupTestCase();
private:
@@ -105,8 +105,8 @@ void tst_uic::initTestCase()
qDebug() << msg;
process.terminate();
- QCOMPARE(QFileInfo(QLatin1String("baseline")).exists(), true);
- QCOMPARE(QFileInfo(QLatin1String("generated_ui")).exists(), true);
+ QCOMPARE(QFileInfo(QLatin1String(SRCDIR "baseline")).exists(), true);
+ QCOMPARE(QFileInfo(QLatin1String(SRCDIR "generated_ui")).exists(), true);
}
void tst_uic::run()
@@ -163,23 +163,23 @@ void tst_uic::compare()
QFile genFile(generatedFile);
if (!orgFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QString err(QLatin1String("Could not read file: %1..."));
+ QString err(QLatin1String("Could not read file: %1..."));
QFAIL(err.arg(orgFile.fileName()).toUtf8());
}
if (!genFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
- QString err(QLatin1String("Could not read file: %1..."));
+ QString err(QLatin1String("Could not read file: %1..."));
QFAIL(err.arg(genFile.fileName()).toUtf8());
}
originalFile = orgFile.readAll();
originalFile.replace(QRegExp(QLatin1String("Created:.{0,25}[\\d]{4,4}")), "");
originalFile.replace(QRegExp(QLatin1String("by: Qt User Interface Compiler version [.\\d]{5,5}")), "");
-
+
generatedFile = genFile.readAll();
generatedFile.replace(QRegExp(QLatin1String("Created:.{0,25}[\\d]{4,4}")), "");
generatedFile.replace(QRegExp(QLatin1String("by: Qt User Interface Compiler version [.\\d]{5,5}")), "");
-
+
QCOMPARE(generatedFile, originalFile);
}
diff --git a/tests/auto/uic/uic.pro b/tests/auto/uic/uic.pro
index 411a993..355cb56 100644
--- a/tests/auto/uic/uic.pro
+++ b/tests/auto/uic/uic.pro
@@ -5,4 +5,4 @@ SOURCES += tst_uic.cpp
TARGET = tst_uic
# This test is not run on wince (I think)
-DEFINES += SRCDIR=\\\"$$PWD\\\"
+DEFINES += SRCDIR=\\\"$$PWD/\\\"
diff --git a/tests/auto/uic3/baseline/customwidgeteditor.ui.err b/tests/auto/uic3/baseline/customwidgeteditor.ui.err
index df2b7a9..bf66c02 100644
--- a/tests/auto/uic3/baseline/customwidgeteditor.ui.err
+++ b/tests/auto/uic3/baseline/customwidgeteditor.ui.err
@@ -1,34 +1,34 @@
-uic3: slot `currentWidgetChanged(Q3ListBoxItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1114 Column: 16
-uic3: slot `currentWidgetChanged(Q3ListBoxItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1120 Column: 16
-uic3: slot `addWidgetClicked()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1126 Column: 16
-uic3: slot `deleteWidgetClicked()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1132 Column: 16
-uic3: slot `classNameChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1138 Column: 16
-uic3: slot `headerFileChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1144 Column: 16
-uic3: slot `widthChanged(int)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1150 Column: 16
-uic3: slot `heightChanged(int)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1156 Column: 16
-uic3: slot `pixmapChoosen()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1162 Column: 16
-uic3: slot `includePolicyChanged(int)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1168 Column: 16
-uic3: slot `chooseHeader()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1174 Column: 16
-uic3: slot `closeClicked()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1180 Column: 16
-uic3: slot `currentSignalChanged(Q3ListBoxItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1186 Column: 16
-uic3: slot `currentSignalChanged(Q3ListBoxItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1192 Column: 16
-uic3: slot `removeSignal()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1198 Column: 16
-uic3: slot `signalNameChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1204 Column: 16
-uic3: slot `currentSlotChanged(Q3ListViewItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1210 Column: 16
-uic3: slot `currentSlotChanged(Q3ListViewItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1216 Column: 16
-uic3: slot `removeSlot()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1222 Column: 16
-uic3: slot `slotNameChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1228 Column: 16
-uic3: slot `slotAccessChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1234 Column: 16
-uic3: slot `currentPropertyChanged(Q3ListViewItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1240 Column: 16
-uic3: slot `currentPropertyChanged(Q3ListViewItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1246 Column: 16
-uic3: slot `removeProperty()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1252 Column: 16
-uic3: slot `propertyNameChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1258 Column: 16
-uic3: slot `propertyTypeChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1264 Column: 16
-uic3: slot `loadDescription()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1270 Column: 16
-uic3: slot `saveDescription()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1276 Column: 16
-uic3: slot `horDataChanged(int)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1282 Column: 16
-uic3: slot `verDataChanged(int)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1288 Column: 16
-uic3: slot `addProperty()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1294 Column: 16
-uic3: slot `widgetIsContainer(bool)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1300 Column: 16
-uic3: slot `addSignal()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1306 Column: 16
-uic3: slot `addSlot()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1312 Column: 16
+uic3: slot `currentWidgetChanged(Q3ListBoxItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1122 Column: 16
+uic3: slot `currentWidgetChanged(Q3ListBoxItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1128 Column: 16
+uic3: slot `addWidgetClicked()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1134 Column: 16
+uic3: slot `deleteWidgetClicked()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1140 Column: 16
+uic3: slot `classNameChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1146 Column: 16
+uic3: slot `headerFileChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1152 Column: 16
+uic3: slot `widthChanged(int)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1158 Column: 16
+uic3: slot `heightChanged(int)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1164 Column: 16
+uic3: slot `pixmapChoosen()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1170 Column: 16
+uic3: slot `includePolicyChanged(int)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1176 Column: 16
+uic3: slot `chooseHeader()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1182 Column: 16
+uic3: slot `closeClicked()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1188 Column: 16
+uic3: slot `currentSignalChanged(Q3ListBoxItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1194 Column: 16
+uic3: slot `currentSignalChanged(Q3ListBoxItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1200 Column: 16
+uic3: slot `removeSignal()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1206 Column: 16
+uic3: slot `signalNameChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1212 Column: 16
+uic3: slot `currentSlotChanged(Q3ListViewItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1218 Column: 16
+uic3: slot `currentSlotChanged(Q3ListViewItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1224 Column: 16
+uic3: slot `removeSlot()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1230 Column: 16
+uic3: slot `slotNameChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1236 Column: 16
+uic3: slot `slotAccessChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1242 Column: 16
+uic3: slot `currentPropertyChanged(Q3ListViewItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1248 Column: 16
+uic3: slot `currentPropertyChanged(Q3ListViewItem*)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1254 Column: 16
+uic3: slot `removeProperty()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1260 Column: 16
+uic3: slot `propertyNameChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1266 Column: 16
+uic3: slot `propertyTypeChanged(QString)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1272 Column: 16
+uic3: slot `loadDescription()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1278 Column: 16
+uic3: slot `saveDescription()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1284 Column: 16
+uic3: slot `horDataChanged(int)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1290 Column: 16
+uic3: slot `verDataChanged(int)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1296 Column: 16
+uic3: slot `addProperty()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1302 Column: 16
+uic3: slot `widgetIsContainer(bool)' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1308 Column: 16
+uic3: slot `addSignal()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1314 Column: 16
+uic3: slot `addSlot()' for widget `CustomWidgetEditorBase' of type `QDialog' is not supported; connection may fail. Line: 1320 Column: 16
diff --git a/tests/auto/uic3/baseline/dbconnections.ui.err b/tests/auto/uic3/baseline/dbconnections.ui.err
index d9d726a..416f0dc 100644
--- a/tests/auto/uic3/baseline/dbconnections.ui.err
+++ b/tests/auto/uic3/baseline/dbconnections.ui.err
@@ -1,5 +1,5 @@
-uic3: slot `newConnection()' for widget `DatabaseConnectionBase' of type `QDialog' is not supported; connection may fail. Line: 282 Column: 16
-uic3: slot `deleteConnection()' for widget `DatabaseConnectionBase' of type `QDialog' is not supported; connection may fail. Line: 288 Column: 16
-uic3: slot `doConnect()' for widget `DatabaseConnectionBase' of type `QDialog' is not supported; connection may fail. Line: 294 Column: 16
-uic3: slot `currentConnectionChanged(QString)' for widget `DatabaseConnectionBase' of type `QDialog' is not supported; connection may fail. Line: 300 Column: 16
-uic3: slot `currentConnectionChanged(QString)' for widget `DatabaseConnectionBase' of type `QDialog' is not supported; connection may fail. Line: 306 Column: 16
+uic3: slot `newConnection()' for widget `DatabaseConnectionBase' of type `QDialog' is not supported; connection may fail. Line: 290 Column: 16
+uic3: slot `deleteConnection()' for widget `DatabaseConnectionBase' of type `QDialog' is not supported; connection may fail. Line: 296 Column: 16
+uic3: slot `doConnect()' for widget `DatabaseConnectionBase' of type `QDialog' is not supported; connection may fail. Line: 302 Column: 16
+uic3: slot `currentConnectionChanged(QString)' for widget `DatabaseConnectionBase' of type `QDialog' is not supported; connection may fail. Line: 308 Column: 16
+uic3: slot `currentConnectionChanged(QString)' for widget `DatabaseConnectionBase' of type `QDialog' is not supported; connection may fail. Line: 314 Column: 16
diff --git a/tests/auto/uic3/baseline/gotolinedialog.ui.err b/tests/auto/uic3/baseline/gotolinedialog.ui.err
index 6d40b7a..aab52a6 100644
--- a/tests/auto/uic3/baseline/gotolinedialog.ui.err
+++ b/tests/auto/uic3/baseline/gotolinedialog.ui.err
@@ -1 +1 @@
-uic3: slot `gotoLine()' for widget `GotoLineDialog' of type `QDialog' is not supported; connection may fail. Line: 165 Column: 31
+uic3: slot `gotoLine()' for widget `GotoLineDialog' of type `QDialog' is not supported; connection may fail. Line: 173 Column: 31
diff --git a/tests/auto/uic3/baseline/listboxeditor.ui.4 b/tests/auto/uic3/baseline/listboxeditor.ui.4
index c641e0e..8de9fa7 100644
--- a/tests/auto/uic3/baseline/listboxeditor.ui.4
+++ b/tests/auto/uic3/baseline/listboxeditor.ui.4
@@ -7,7 +7,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the autotests of the Qt Toolkit.
+** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/tests/auto/uic3/baseline/mainwindowwizard.ui.err b/tests/auto/uic3/baseline/mainwindowwizard.ui.err
index 28fc54e..53ba5ff 100644
--- a/tests/auto/uic3/baseline/mainwindowwizard.ui.err
+++ b/tests/auto/uic3/baseline/mainwindowwizard.ui.err
@@ -1,12 +1,12 @@
-uic3: slot `currentToolbarChanged(QString)' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 656 Column: 31
-uic3: slot `toolbarAddAction()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 662 Column: 31
-uic3: slot `toolbarRemoveAction()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 668 Column: 31
-uic3: slot `toolbarActionUp()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 674 Column: 31
-uic3: slot `toolbarActionDown()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 680 Column: 31
-uic3: slot `pageSelected(QString)' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 686 Column: 31
-uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 692 Column: 31
-uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 698 Column: 31
-uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 704 Column: 31
-uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 710 Column: 31
-uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 716 Column: 31
-uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 722 Column: 31
+uic3: slot `currentToolbarChanged(QString)' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 664 Column: 31
+uic3: slot `toolbarAddAction()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 670 Column: 31
+uic3: slot `toolbarRemoveAction()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 676 Column: 31
+uic3: slot `toolbarActionUp()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 682 Column: 31
+uic3: slot `toolbarActionDown()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 688 Column: 31
+uic3: slot `pageSelected(QString)' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 694 Column: 31
+uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 700 Column: 31
+uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 706 Column: 31
+uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 712 Column: 31
+uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 718 Column: 31
+uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 724 Column: 31
+uic3: slot `currentSettingChanged()' for widget `MainWindowWizardBase' of type `Q3Wizard' is not supported; connection may fail. Line: 730 Column: 31
diff --git a/tests/auto/uic3/baseline/paletteeditor.ui.err b/tests/auto/uic3/baseline/paletteeditor.ui.err
index 7cc2345..13b1bd9 100644
--- a/tests/auto/uic3/baseline/paletteeditor.ui.err
+++ b/tests/auto/uic3/baseline/paletteeditor.ui.err
@@ -1,9 +1,9 @@
-uic3: slot `onChoose2ndMainColor()' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 439 Column: 16
-uic3: slot `paletteSelected(int)' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 445 Column: 16
-uic3: slot `onTune()' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 451 Column: 16
-uic3: slot `onChooseMainColor()' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 469 Column: 16
-uic3: slot `onChooseMainColor()' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 475 Column: 16
-uic3: slot `onChoose2ndMainColor()' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 481 Column: 16
+uic3: slot `onChoose2ndMainColor()' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 447 Column: 16
+uic3: slot `paletteSelected(int)' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 453 Column: 16
+uic3: slot `onTune()' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 459 Column: 16
+uic3: slot `onChooseMainColor()' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 477 Column: 16
+uic3: slot `onChooseMainColor()' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 483 Column: 16
+uic3: slot `onChoose2ndMainColor()' for widget `PaletteEditorBase' of type `QDialog' is not supported; connection may fail. Line: 489 Column: 16
uic3: flag 'AlignAuto' for widget 'Q3GroupBox' is not supported
uic3: flag 'AlignAuto' for widget 'QLabel' is not supported
uic3: flag 'AlignAuto' for widget 'QLabel' is not supported
diff --git a/tests/auto/uic3/baseline/paletteeditoradvanced.ui.err b/tests/auto/uic3/baseline/paletteeditoradvanced.ui.err
index 5ee7fe3..c6922c0 100644
--- a/tests/auto/uic3/baseline/paletteeditoradvanced.ui.err
+++ b/tests/auto/uic3/baseline/paletteeditoradvanced.ui.err
@@ -1,12 +1,12 @@
-uic3: slot `paletteSelected(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 656 Column: 16
-uic3: slot `onCentral(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 662 Column: 16
-uic3: slot `onChoosePixmap()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 668 Column: 16
-uic3: slot `onChooseCentralColor()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 674 Column: 16
-uic3: slot `onChooseEffectColor()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 680 Column: 16
-uic3: slot `onEffect(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 686 Column: 16
-uic3: slot `onToggleBuildEffects(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 692 Column: 16
-uic3: slot `showHelp()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 698 Column: 16
-uic3: slot `onToggleBuildInactive(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 716 Column: 16
-uic3: slot `onToggleBuildDisabled(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 722 Column: 16
+uic3: slot `paletteSelected(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 664 Column: 16
+uic3: slot `onCentral(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 670 Column: 16
+uic3: slot `onChoosePixmap()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 676 Column: 16
+uic3: slot `onChooseCentralColor()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 682 Column: 16
+uic3: slot `onChooseEffectColor()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 688 Column: 16
+uic3: slot `onEffect(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 694 Column: 16
+uic3: slot `onToggleBuildEffects(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 700 Column: 16
+uic3: slot `showHelp()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 706 Column: 16
+uic3: slot `onToggleBuildInactive(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 724 Column: 16
+uic3: slot `onToggleBuildDisabled(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 730 Column: 16
uic3: enumerator 'MShape' for widget 'QLabel' is not supported
uic3: enumerator 'MShadow' for widget 'QLabel' is not supported
diff --git a/tests/auto/uic3/baseline/paletteeditoradvancedbase.ui.err b/tests/auto/uic3/baseline/paletteeditoradvancedbase.ui.err
index d5a5c3d..67ab03b 100644
--- a/tests/auto/uic3/baseline/paletteeditoradvancedbase.ui.err
+++ b/tests/auto/uic3/baseline/paletteeditoradvancedbase.ui.err
@@ -1,10 +1,10 @@
-uic3: slot `paletteSelected(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 599 Column: 16
-uic3: slot `onCentral(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 605 Column: 16
-uic3: slot `onChooseCentralColor()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 611 Column: 16
-uic3: slot `onChooseEffectColor()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 617 Column: 16
-uic3: slot `onEffect(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 623 Column: 16
-uic3: slot `onToggleBuildEffects(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 629 Column: 16
-uic3: slot `onToggleBuildInactive(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 647 Column: 16
-uic3: slot `onToggleBuildDisabled(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 653 Column: 16
+uic3: slot `paletteSelected(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 607 Column: 16
+uic3: slot `onCentral(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 613 Column: 16
+uic3: slot `onChooseCentralColor()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 619 Column: 16
+uic3: slot `onChooseEffectColor()' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 625 Column: 16
+uic3: slot `onEffect(int)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 631 Column: 16
+uic3: slot `onToggleBuildEffects(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 637 Column: 16
+uic3: slot `onToggleBuildInactive(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 655 Column: 16
+uic3: slot `onToggleBuildDisabled(bool)' for widget `PaletteEditorAdvancedBase' of type `QDialog' is not supported; connection may fail. Line: 661 Column: 16
uic3: enumerator 'MShape' for widget 'QLabel' is not supported
uic3: enumerator 'MShadow' for widget 'QLabel' is not supported
diff --git a/tests/auto/uic3/baseline/richtextfontdialog.ui.err b/tests/auto/uic3/baseline/richtextfontdialog.ui.err
index c873980..32922b0 100644
--- a/tests/auto/uic3/baseline/richtextfontdialog.ui.err
+++ b/tests/auto/uic3/baseline/richtextfontdialog.ui.err
@@ -1 +1 @@
-uic3: property `paletteBackgroundColor' for widget `colorButton' of type `QToolButton' is not supported. Line: 193 Column: 63
+uic3: property `paletteBackgroundColor' for widget `colorButton' of type `QToolButton' is not supported. Line: 201 Column: 63
diff --git a/tests/auto/uic3/baseline/settingsdialog.ui.err b/tests/auto/uic3/baseline/settingsdialog.ui.err
index 2fe5907..a3bb5e8 100644
--- a/tests/auto/uic3/baseline/settingsdialog.ui.err
+++ b/tests/auto/uic3/baseline/settingsdialog.ui.err
@@ -1 +1 @@
-uic3: property `paletteBackgroundColor' for widget `colorButton' of type `QToolButton' is not supported. Line: 161 Column: 75
+uic3: property `paletteBackgroundColor' for widget `colorButton' of type `QToolButton' is not supported. Line: 169 Column: 75
diff --git a/tests/auto/uic3/baseline/wizardeditor.ui.4 b/tests/auto/uic3/baseline/wizardeditor.ui.4
index c0fdf61..ebf2e91 100644
--- a/tests/auto/uic3/baseline/wizardeditor.ui.4
+++ b/tests/auto/uic3/baseline/wizardeditor.ui.4
@@ -7,7 +7,7 @@
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
-** This file is part of the autotests of the Qt Toolkit.
+** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
diff --git a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro
index 4978c35..531e48b 100644
--- a/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro
+++ b/tests/auto/xmlpatternsschemats/xmlpatternsschemats.pro
@@ -14,7 +14,7 @@ if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
win32:PATTERNIST_SDK = $${PATTERNIST_SDK}d
else: PATTERNIST_SDK = $${PATTERNIST_SDK}_debug
}
-LIBS += -l$$PATTERNIST_SDK
+LIBS += -l$$PATTERNIST_SDK -lQtXml
INCLUDEPATH += $$QT_SOURCE_TREE/tests/auto/xmlpatternsxqts/lib/ \
$$QT_BUILD_TREE/include/QtXmlPatterns/private \
diff --git a/tests/manual/qcursor/allcursors/allcursors.pro b/tests/manual/qcursor/allcursors/allcursors.pro
new file mode 100644
index 0000000..8e7da30
--- /dev/null
+++ b/tests/manual/qcursor/allcursors/allcursors.pro
@@ -0,0 +1,16 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2009-08-05T17:13:23
+#
+#-------------------------------------------------
+
+TARGET = tst_allcursors
+TEMPLATE = app
+
+
+SOURCES += main.cpp\
+ mainwindow.cpp
+
+HEADERS += mainwindow.h
+
+FORMS += mainwindow.ui
diff --git a/tests/manual/qcursor/allcursors/main.cpp b/tests/manual/qcursor/allcursors/main.cpp
new file mode 100644
index 0000000..9fb7510
--- /dev/null
+++ b/tests/manual/qcursor/allcursors/main.cpp
@@ -0,0 +1,13 @@
+#include <QtGui/QApplication>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ MainWindow w;
+ w.showFullScreen();
+#ifdef QT_KEYPAD_NAVIGATION
+ QApplication::setNavigationMode(Qt::NavigationModeCursorForceVisible);
+#endif
+ return a.exec();
+}
diff --git a/tests/manual/qcursor/allcursors/mainwindow.cpp b/tests/manual/qcursor/allcursors/mainwindow.cpp
new file mode 100644
index 0000000..0046ddb
--- /dev/null
+++ b/tests/manual/qcursor/allcursors/mainwindow.cpp
@@ -0,0 +1,43 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+#include <QTimer>
+#include <QBitmap>
+#include <QImage>
+#include <QPainter>
+#include <QKeyEvent>
+#include <QPoint>
+
+MainWindow::MainWindow(QWidget *parent) :
+ QMainWindow(parent), ui(new Ui::MainWindow)
+{
+ ui->setupUi(this);
+}
+
+MainWindow::~MainWindow()
+{
+ delete ui;
+}
+
+void MainWindow::keyPressEvent(QKeyEvent* event)
+{
+ QPoint off(0, 0);
+ switch (event->key()) {
+ case Qt::Key_Up:
+ off.setY(-4);
+ break;
+ case Qt::Key_Down:
+ off.setY(4);
+ break;
+ case Qt::Key_Left:
+ off.setX(-4);
+ break;
+ case Qt::Key_Right:
+ off.setX(4);
+ break;
+ default:
+ return QMainWindow::keyPressEvent(event);
+ }
+ off += QCursor::pos();
+ QCursor::setPos(off);
+}
diff --git a/tests/manual/qcursor/allcursors/mainwindow.h b/tests/manual/qcursor/allcursors/mainwindow.h
new file mode 100644
index 0000000..e5c731c
--- /dev/null
+++ b/tests/manual/qcursor/allcursors/mainwindow.h
@@ -0,0 +1,28 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui/QMainWindow>
+
+class QTimer;
+
+namespace Ui
+{
+ class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+private:
+ void keyPressEvent(QKeyEvent* event);
+
+private:
+ Ui::MainWindow *ui;
+};
+
+#endif // MAINWINDOW_H
diff --git a/tests/manual/qcursor/allcursors/mainwindow.ui b/tests/manual/qcursor/allcursors/mainwindow.ui
new file mode 100644
index 0000000..55ff78c
--- /dev/null
+++ b/tests/manual/qcursor/allcursors/mainwindow.ui
@@ -0,0 +1,210 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>240</width>
+ <height>320</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Arrow</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLabel" name="label_2">
+ <property name="cursor">
+ <cursorShape>UpArrowCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>up arrow</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QLabel" name="label_3">
+ <property name="cursor">
+ <cursorShape>CrossCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>cross</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="cursor">
+ <cursorShape>WaitCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>wait</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="label_5">
+ <property name="cursor">
+ <cursorShape>IBeamCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>ibeam</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QLabel" name="label_6">
+ <property name="cursor">
+ <cursorShape>SizeVerCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>sizever</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="cursor">
+ <cursorShape>SizeHorCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>sizehor</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="label_8">
+ <property name="cursor">
+ <cursorShape>SizeFDiagCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>sizebdiag</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QLabel" name="label_9">
+ <property name="cursor">
+ <cursorShape>SizeBDiagCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>sizefdiag</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QLabel" name="label_10">
+ <property name="cursor">
+ <cursorShape>SizeAllCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>sizeall</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1">
+ <widget class="QLabel" name="label_11">
+ <property name="cursor">
+ <cursorShape>BlankCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>blank</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2">
+ <widget class="QLabel" name="label_12">
+ <property name="cursor">
+ <cursorShape>SplitVCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>splitv</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_13">
+ <property name="cursor">
+ <cursorShape>SplitHCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>splith</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QLabel" name="label_14">
+ <property name="cursor">
+ <cursorShape>PointingHandCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>pointhand</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2">
+ <widget class="QLabel" name="label_15">
+ <property name="cursor">
+ <cursorShape>ForbiddenCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>forbidden</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label_16">
+ <property name="cursor">
+ <cursorShape>WhatsThisCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>whatsthis</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QLabel" name="label_19">
+ <property name="cursor">
+ <cursorShape>BusyCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>busy</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <widget class="QLabel" name="label_17">
+ <property name="cursor">
+ <cursorShape>OpenHandCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>openhand</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
+ <widget class="QLabel" name="label_18">
+ <property name="cursor">
+ <cursorShape>ClosedHandCursor</cursorShape>
+ </property>
+ <property name="text">
+ <string>closehand</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/tests/manual/qcursor/grab_override/data/monkey_on_64x64.png b/tests/manual/qcursor/grab_override/data/monkey_on_64x64.png
new file mode 100644
index 0000000..990f604
--- /dev/null
+++ b/tests/manual/qcursor/grab_override/data/monkey_on_64x64.png
Binary files differ
diff --git a/tests/manual/qcursor/grab_override/grab_override.pro b/tests/manual/qcursor/grab_override/grab_override.pro
new file mode 100644
index 0000000..c0f69be
--- /dev/null
+++ b/tests/manual/qcursor/grab_override/grab_override.pro
@@ -0,0 +1,18 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2009-08-05T17:13:23
+#
+#-------------------------------------------------
+
+TARGET = t_cursors
+TEMPLATE = app
+
+
+SOURCES += main.cpp\
+ mainwindow.cpp
+
+HEADERS += mainwindow.h
+
+FORMS += mainwindow.ui
+
+RESOURCES += images.qrc
diff --git a/tests/manual/qcursor/grab_override/images.qrc b/tests/manual/qcursor/grab_override/images.qrc
new file mode 100644
index 0000000..1d0cb92
--- /dev/null
+++ b/tests/manual/qcursor/grab_override/images.qrc
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC>
+<RCC version="1.0">
+ <qresource prefix="/">
+ <file>data/monkey_on_64x64.png</file>
+ </qresource>
+</RCC>
diff --git a/tests/manual/qcursor/grab_override/main.cpp b/tests/manual/qcursor/grab_override/main.cpp
new file mode 100644
index 0000000..9fb7510
--- /dev/null
+++ b/tests/manual/qcursor/grab_override/main.cpp
@@ -0,0 +1,13 @@
+#include <QtGui/QApplication>
+#include "mainwindow.h"
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ MainWindow w;
+ w.showFullScreen();
+#ifdef QT_KEYPAD_NAVIGATION
+ QApplication::setNavigationMode(Qt::NavigationModeCursorForceVisible);
+#endif
+ return a.exec();
+}
diff --git a/tests/manual/qcursor/grab_override/mainwindow.cpp b/tests/manual/qcursor/grab_override/mainwindow.cpp
new file mode 100644
index 0000000..27dd0e7
--- /dev/null
+++ b/tests/manual/qcursor/grab_override/mainwindow.cpp
@@ -0,0 +1,100 @@
+#include "mainwindow.h"
+#include "ui_mainwindow.h"
+
+#include <QTimer>
+#include <QBitmap>
+#include <QImage>
+#include <QPainter>
+#include <QKeyEvent>
+
+MainWindow::MainWindow(QWidget *parent) :
+ QMainWindow(parent), ui(new Ui::MainWindow)
+{
+ ui->setupUi(this);
+ QPixmap pix(":/data/monkey_on_64x64.png");
+
+ QImage mask(16, 16, QImage::Format_MonoLSB);
+ QImage bw(16, 16, QImage::Format_MonoLSB);
+ mask.fill(0);
+ bw.fill(0);
+ for (int x = 0; x < 16; x++) {
+ bw.setPixel(x, x, 1);
+ bw.setPixel(x, 15 - x, 1);
+ mask.setPixel(x, x, 1);
+ mask.setPixel(x, 15 - x, 1);
+ if (x > 0 && x < 15) {
+ mask.setPixel(x - 1, x, 1);
+ mask.setPixel(x + 1, x, 1);
+ mask.setPixel(x - 1, 15 - x, 1);
+ mask.setPixel(x + 1, 15 - x, 1);
+ }
+ }
+
+ ccurs = QCursor(pix);
+ bcurs = QCursor(QBitmap::fromImage(bw), QBitmap::fromImage(mask));
+ ui->label->setCursor(ccurs);
+
+ timer = new QTimer(this);
+ connect(timer, SIGNAL(timeout()), this, SLOT(toggleOverrideCursor()));
+ timer->start(2000);
+
+ override = 0;
+}
+
+MainWindow::~MainWindow()
+{
+ delete timer;
+ delete ui;
+}
+
+void MainWindow::toggleOverrideCursor()
+{
+ switch (override) {
+ case 0:
+ QApplication::setOverrideCursor(Qt::BusyCursor);
+ break;
+ case 1:
+ QApplication::restoreOverrideCursor();
+ break;
+ case 2:
+ ui->label->grabMouse(Qt::ForbiddenCursor);
+ break;
+ case 3:
+ case 5:
+ ui->label->releaseMouse();
+ break;
+ case 4:
+ ui->label->grabMouse();
+ break;
+ case 6:
+ ui->label->setCursor(bcurs);
+ break;
+ case 7:
+ ui->label->setCursor(ccurs);
+ break;
+ }
+ override = (override + 1) % 8;
+}
+
+void MainWindow::keyPressEvent(QKeyEvent* event)
+{
+ QPoint off(0, 0);
+ switch (event->key()) {
+ case Qt::Key_Up:
+ off.setY(-4);
+ break;
+ case Qt::Key_Down:
+ off.setY(4);
+ break;
+ case Qt::Key_Left:
+ off.setX(-4);
+ break;
+ case Qt::Key_Right:
+ off.setX(4);
+ break;
+ default:
+ return QMainWindow::keyPressEvent(event);
+ }
+ off += QCursor::pos();
+ QCursor::setPos(off);
+}
diff --git a/tests/manual/qcursor/grab_override/mainwindow.h b/tests/manual/qcursor/grab_override/mainwindow.h
new file mode 100644
index 0000000..0b1f694
--- /dev/null
+++ b/tests/manual/qcursor/grab_override/mainwindow.h
@@ -0,0 +1,35 @@
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui/QMainWindow>
+
+class QTimer;
+
+namespace Ui
+{
+ class MainWindow;
+}
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ MainWindow(QWidget *parent = 0);
+ ~MainWindow();
+
+private slots:
+ void toggleOverrideCursor();
+
+private:
+ void keyPressEvent(QKeyEvent* event);
+
+ Ui::MainWindow *ui;
+ QTimer *timer;
+ int override;
+
+ QCursor ccurs;
+ QCursor bcurs;
+};
+
+#endif // MAINWINDOW_H
diff --git a/tests/manual/qcursor/grab_override/mainwindow.ui b/tests/manual/qcursor/grab_override/mainwindow.ui
new file mode 100644
index 0000000..bf35536
--- /dev/null
+++ b/tests/manual/qcursor/grab_override/mainwindow.ui
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>240</width>
+ <height>320</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>MainWindow</string>
+ </property>
+ <widget class="QWidget" name="centralWidget">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QSplitter" name="splitter_2">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="midLineWidth">
+ <number>1</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <widget class="QLabel" name="label">
+ <property name="frameShape">
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="text">
+ <string>Custom</string>
+ </property>
+ </widget>
+ <widget class="QSplitter" name="splitter">
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="midLineWidth">
+ <number>1</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QLabel" name="label_2">
+ <property name="cursor">
+ <cursorShape>ForbiddenCursor</cursorShape>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="text">
+ <string>Forbidden</string>
+ </property>
+ </widget>
+ <widget class="QLabel" name="label_3">
+ <property name="cursor">
+ <cursorShape>WaitCursor</cursorShape>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="text">
+ <string>Wait</string>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menuBar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>240</width>
+ <height>21</height>
+ </rect>
+ </property>
+ </widget>
+ <widget class="QToolBar" name="mainToolBar">
+ <attribute name="toolBarArea">
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak">
+ <bool>false</bool>
+ </attribute>
+ </widget>
+ <widget class="QStatusBar" name="statusBar"/>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/tests/manual/qcursor/qcursor.pro b/tests/manual/qcursor/qcursor.pro
new file mode 100644
index 0000000..af082a4
--- /dev/null
+++ b/tests/manual/qcursor/qcursor.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+
+SUBDIRS = allcursors grab_override