summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-23 10:32:42 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-23 10:32:42 (GMT)
commite1eceedaa635d0180eb798b00c3da93156d7af63 (patch)
tree04325155309fd225d68a4cf118be34c2378cb26a /tests
parent2c96aeb45320ade7e2c074433560185f16631374 (diff)
parent71be46c61c582d2f4635a1e420e44d57ddb5857a (diff)
downloadQt-e1eceedaa635d0180eb798b00c3da93156d7af63.zip
Qt-e1eceedaa635d0180eb798b00c3da93156d7af63.tar.gz
Qt-e1eceedaa635d0180eb798b00c3da93156d7af63.tar.bz2
Merge commit 'origin/4.5'
Conflicts: src/sql/drivers/psql/qsql_psql.cpp
Diffstat (limited to 'tests')
-rw-r--r--tests/arthur/data/qps/clipping_state.qps15
-rw-r--r--tests/arthur/data/qps/clipping_state_qps.pngbin5089 -> 5133 bytes
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp28
-rw-r--r--tests/auto/qwizard/tst_qwizard.cpp22
4 files changed, 65 insertions, 0 deletions
diff --git a/tests/arthur/data/qps/clipping_state.qps b/tests/arthur/data/qps/clipping_state.qps
index fd9a80a..3a66122 100644
--- a/tests/arthur/data/qps/clipping_state.qps
+++ b/tests/arthur/data/qps/clipping_state.qps
@@ -55,3 +55,18 @@ setClipping true
setBrush #6300ff00
drawRect 25 25 50 50
+
+# disable clipping followed by setClipRect
+translate 150 0
+
+setClipRect 0 0 50 50 ReplaceClip
+
+setClipping false
+
+setBrush #630000ff
+drawRect 0 0 100 100
+
+setClipRect 25 25 75 75 IntersectClip
+
+setBrush #6300ff00
+drawRect 25 25 50 50
diff --git a/tests/arthur/data/qps/clipping_state_qps.png b/tests/arthur/data/qps/clipping_state_qps.png
index 9b3dee2..28bee46 100644
--- a/tests/arthur/data/qps/clipping_state_qps.png
+++ b/tests/arthur/data/qps/clipping_state_qps.png
Binary files differ
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 6727b05..dd9a3e0 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -252,6 +252,7 @@ private slots:
void moveChild_data();
void moveChild();
+ void showAndMoveChild();
void subtractOpaqueSiblings();
@@ -5318,6 +5319,33 @@ void tst_QWidget::moveChild()
parent.color);
}
+void tst_QWidget::showAndMoveChild()
+{
+ QWidget parent(0, Qt::FramelessWindowHint);
+ parent.resize(300, 300);
+ parent.setPalette(Qt::red);
+ parent.show();
+#ifdef Q_WS_X11
+ qt_x11_wait_for_window_manager(&parent);
+#endif
+ QTest::qWait(200);
+
+ const QPoint tlwOffset = parent.geometry().topLeft();
+ QWidget child(&parent);
+ child.resize(100, 100);
+ child.setPalette(Qt::blue);
+ child.setAutoFillBackground(true);
+
+ // Ensure that the child is repainted correctly when moved right after show.
+ // NB! Do NOT processEvents() (or qWait()) in between show() and move().
+ child.show();
+ child.move(150, 150);
+ qApp->processEvents();
+
+ VERIFY_COLOR(child.geometry().translated(tlwOffset), Qt::blue);
+ VERIFY_COLOR(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset), Qt::red);
+}
+
void tst_QWidget::subtractOpaqueSiblings()
{
#ifdef QT_MAC_USE_COCOA
diff --git a/tests/auto/qwizard/tst_qwizard.cpp b/tests/auto/qwizard/tst_qwizard.cpp
index 71e1c3e..e5074b3 100644
--- a/tests/auto/qwizard/tst_qwizard.cpp
+++ b/tests/auto/qwizard/tst_qwizard.cpp
@@ -112,6 +112,7 @@ private slots:
void task161658_alignments();
void task177022_setFixedSize();
void task248107_backButton();
+ void task255350_fieldObjectDestroyed();
/*
Things that could be added:
@@ -2517,5 +2518,26 @@ void tst_QWizard::task248107_backButton()
QCOMPARE(wizard.currentPage(), &page1);
}
+class WizardPage_task255350 : public QWizardPage
+{
+public:
+ QLineEdit *lineEdit;
+ WizardPage_task255350()
+ : lineEdit(new QLineEdit)
+ {
+ registerField("dummy*", lineEdit);
+ }
+};
+
+void tst_QWizard::task255350_fieldObjectDestroyed()
+{
+ QWizard wizard;
+ WizardPage_task255350 *page = new WizardPage_task255350;
+ int id = wizard.addPage(page);
+ delete page->lineEdit;
+ wizard.removePage(id); // don't crash!
+ delete page;
+}
+
QTEST_MAIN(tst_QWizard)
#include "tst_qwizard.moc"