summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-10 04:07:12 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-10 04:07:12 (GMT)
commitf64ad3687c428644139690d565fe555ed2199aea (patch)
tree71254975baa06a8ebae38bd41c315fd16f050efb /tests/auto
parent7690bab57ef7ae6d669c6df23e9de72fd8a85d62 (diff)
parentf9d26f506b30dcdb1fc50c824f20455756d67cc4 (diff)
downloadQt-f64ad3687c428644139690d565fe555ed2199aea.zip
Qt-f64ad3687c428644139690d565fe555ed2199aea.tar.gz
Qt-f64ad3687c428644139690d565fe555ed2199aea.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: (27 commits) Fix the doc for QFrame::frameStyle Don't use texture-from-pixmap if the target isn't GL_TEXTURE_2D Add runtime check for GLX >= 1.3 before using glXCreatePixmap QDrawHelper: Reduce code duplications Improve matching X11 VisualIDs to EGL configs Remove obsolete function set_winapp_name() Speedup fetchTransformedBilinear in the fast_matrix case Allow y-interted pixmaps for brushes in GL2 paint engine Build fix for mingw Fix build with mingw (64 bit) Make configure.exe compatible with mingw 64 Adjust indentation e-Ink support cleanup Tweak the display update IOCTL calls Support 8-Track e-Ink devices Get stride from LinuxFB instead of calculating it ourselves. Use DIR_SEPARATOR when setting up variables for RCC and UIC in features. Fixed bug in QPainterPath::intersected(). Fix compile error with QT_NO_ANIMATION O(n^2) to O(n) optimization in QTreeWidget::selectedItems() ...
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qpathclipper/tst_qpathclipper.cpp29
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp32
2 files changed, 61 insertions, 0 deletions
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"