summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-14 08:38:42 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-14 08:38:42 (GMT)
commitb371999d3e9c207047be6afda89d008b6cf04763 (patch)
tree7e2da63139dfc732edcfac73f13ee2b4d998d540 /tests/auto
parent4af9cc043370846c52ec21cf874696ee650394c1 (diff)
parent0711bb704ef5cdd20d5079418c256e3502258613 (diff)
downloadQt-b371999d3e9c207047be6afda89d008b6cf04763.zip
Qt-b371999d3e9c207047be6afda89d008b6cf04763.tar.gz
Qt-b371999d3e9c207047be6afda89d008b6cf04763.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (55 commits) Revert "Removed double setting of _WIN32_WINNT" Revert "removed a few warnings on wince builds" removed a few warnings on wince builds Removed double setting of _WIN32_WINNT QTreeView: remove dead code. doc: Clarify effect of QFont::NoFontMerging Revert "Implement heightForWidth support for QTabWidget and QStackedLayout." build fix for S60 Improve handling of QAction in soft key manager Remove useless assert qdrawhelper: fix optim in 2245641ba QSlider and StyleSheet: fix one pixel error while drawing the SliderAddPage accelerate QWindowsPipeWriter for bigger chunks of data Fix antialiasing with transformed text in OpenGL2 paint engine Fix flattening of largely scaled, thin, dashed beziers. Increased the precision used to flatten beziers Fix QT_NO_MOVIE Fix compile error with QT_NO_ACTION in QtGui Fix QT_NO_COMPLETER Fix QT_NO_FSCOMPLETER ...
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp12
-rw-r--r--tests/auto/qpathclipper/tst_qpathclipper.cpp29
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp32
3 files changed, 73 insertions, 0 deletions
diff --git a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
index bf4ea5f..195f8b6 100644
--- a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
+++ b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
@@ -721,11 +721,13 @@ void tst_QDialogButtonBox::testDefaultButton_data()
static int softKeyCount(QWidget *widget)
{
int softkeyCount = 0;
+#ifndef QT_NO_ACTION
QList<QAction *> actions = widget->actions();
foreach (QAction *action, actions) {
if (action->softKeyRole() != QAction::NoSoftKey)
softkeyCount++;
}
+#endif
return softkeyCount;
}
@@ -737,14 +739,18 @@ void tst_QDialogButtonBox::testS60SoftKeys()
buttonBox.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
dialog.show();
+#ifndef QT_NO_ACTION
QCOMPARE( softKeyCount(&dialog), 2);
+#endif
QDialog dialog2(0);
QDialogButtonBox buttonBox2(&dialog2);
buttonBox2.setStandardButtons(QDialogButtonBox::Cancel);
dialog2.show();
+#ifndef QT_NO_ACTION
QCOMPARE( softKeyCount(&dialog2), 1);
+#endif
#else
QSKIP("S60-specific test", SkipAll );
@@ -759,21 +765,27 @@ void tst_QDialogButtonBox::testSoftKeyReparenting()
buttonBox->addButton(QDialogButtonBox::Ok);
buttonBox->addButton(QDialogButtonBox::Cancel);
+#ifndef QT_NO_ACTION
QCOMPARE(softKeyCount(&dialog), 0);
QCOMPARE(softKeyCount(buttonBox), 2);
+#endif
// Were the softkeys re-parented correctly?
dialog.setLayout(new QVBoxLayout);
dialog.layout()->addWidget(buttonBox);
+#ifndef QT_NO_ACTION
QCOMPARE(softKeyCount(&dialog), 2);
QCOMPARE(softKeyCount(buttonBox), 0);
+#endif
// Softkeys are only added to QDialog, not QWidget
QWidget *nested = new QWidget;
nested->setLayout(new QVBoxLayout);
nested->layout()->addWidget(buttonBox);
+#ifndef QT_NO_ACTION
QCOMPARE(softKeyCount(nested), 0);
QCOMPARE(softKeyCount(buttonBox), 2);
+#endif
}
#endif
diff --git a/tests/auto/qpathclipper/tst_qpathclipper.cpp b/tests/auto/qpathclipper/tst_qpathclipper.cpp
index 38d253a..db5a13e 100644
--- a/tests/auto/qpathclipper/tst_qpathclipper.cpp
+++ b/tests/auto/qpathclipper/tst_qpathclipper.cpp
@@ -95,6 +95,8 @@ private slots:
void task209056();
void task251909();
+
+ void qtbug3778();
};
Q_DECLARE_METATYPE(QPainterPath)
@@ -1346,6 +1348,33 @@ void tst_QPathClipper::task251909()
QVERIFY(result.elementCount() <= 5);
}
+void tst_QPathClipper::qtbug3778()
+{
+ QPainterPath path1;
+ path1.moveTo(200, 3.22409e-5);
+ // e-5 and higher leads to a bug
+ // Using 3.22409e-4 starts to work correctly
+ path1.lineTo(0, 0);
+ path1.lineTo(1.07025e-13, 1450);
+ path1.lineTo(750, 950);
+ path1.lineTo(950, 750);
+ path1.lineTo(200, 3.22409e-13);
+
+ QPainterPath path2;
+ path2.moveTo(0, 0);
+ path2.lineTo(200, 800);
+ path2.lineTo(600, 1500);
+ path2.lineTo(1500, 1400);
+ path2.lineTo(1900, 1200);
+ path2.lineTo(2000, 1000);
+ path2.lineTo(1400, 0);
+ path2.lineTo(0, 0);
+
+ QPainterPath p12 = path1.intersected(path2);
+
+ QVERIFY(p12.contains(QPointF(100, 100)));
+}
+
QTEST_APPLESS_MAIN(tst_QPathClipper)
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index 2de189d..75a4c62 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -215,6 +215,7 @@ private slots:
void addRowsWhileSectionsAreHidden();
void filterProxyModelCrash();
void styleOptionViewItem();
+ void keyboardNavigationWithDisabled();
// task-specific tests:
void task174627_moveLeftToRoot();
@@ -3753,5 +3754,36 @@ void tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint()
QTRY_VERIFY(view.painted > 0);
}
+void tst_QTreeView::keyboardNavigationWithDisabled()
+{
+ QTreeView view;
+ QStandardItemModel model(90, 0);
+ for (int i = 0; i < 90; i ++) {
+ model.setItem(i, new QStandardItem(QString::number(i)));
+ model.item(i)->setEnabled(i%6 == 0);
+ }
+ view.setModel(&model);
+
+ view.resize(200, view.visualRect(model.index(0,0)).height()*10);
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QTest::qWaitForWindowShown(&view);
+ QTRY_VERIFY(view.isActiveWindow());
+
+ view.setCurrentIndex(model.index(1, 0));
+ QTest::keyClick(view.viewport(), Qt::Key_Up);
+ QCOMPARE(view.currentIndex(), model.index(0, 0));
+ QTest::keyClick(view.viewport(), Qt::Key_Down);
+ QCOMPARE(view.currentIndex(), model.index(6, 0));
+ QTest::keyClick(view.viewport(), Qt::Key_PageDown);
+ QCOMPARE(view.currentIndex(), model.index(18, 0));
+ QTest::keyClick(view.viewport(), Qt::Key_Down);
+ QCOMPARE(view.currentIndex(), model.index(24, 0));
+ QTest::keyClick(view.viewport(), Qt::Key_PageUp);
+ QCOMPARE(view.currentIndex(), model.index(12, 0));
+ QTest::keyClick(view.viewport(), Qt::Key_Up);
+ QCOMPARE(view.currentIndex(), model.index(6, 0));
+}
+
QTEST_MAIN(tst_QTreeView)
#include "tst_qtreeview.moc"