summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-16 10:00:20 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-16 10:00:20 (GMT)
commit5f184a0c3485f9c8e35d3cc7c3c2f715f0f94111 (patch)
treeab82e8e73f81342f2aaf5c26823960c7507359d3 /tests
parent7e5724b7d4632899af2e84856dd7d6f2a1771ee0 (diff)
parent7644b352297e9fd1ee271421e9ce8b7256946b12 (diff)
downloadQt-5f184a0c3485f9c8e35d3cc7c3c2f715f0f94111.zip
Qt-5f184a0c3485f9c8e35d3cc7c3c2f715f0f94111.tar.gz
Qt-5f184a0c3485f9c8e35d3cc7c3c2f715f0f94111.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-widget-team into 4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp35
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp33
2 files changed, 63 insertions, 5 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index d75cfa7..d8110e1 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -1195,6 +1195,13 @@ void tst_QTableView::moveCursorStrikesBack_data()
<< 0 << 5 << (IntList() << int(QtTestTableView::MoveNext))
<< 1 << 0;
+ QTest::newRow("Last column disabled. Task QTBUG-3878") << -1 << -1
+ << IntList()
+ << (IntList() << 6)
+ << QRect()
+ << 1 << 0 << (IntList() << int(QtTestTableView::MovePrevious))
+ << 0 << 5;
+
QTest::newRow("Span, anchor column hidden") << -1 << 1
<< IntList()
<< IntList()
@@ -1250,6 +1257,24 @@ void tst_QTableView::moveCursorStrikesBack_data()
<< QRect(1, 2, 2, 3)
<< 5 << 2 << (IntList() << int(QtTestTableView::MoveUp) << int(QtTestTableView::MoveUp))
<< 1 << 2;
+
+ IntList fullList;
+ for (int i = 0; i < 7; ++i)
+ fullList << i;
+
+ QTest::newRow("All disabled, wrap forward. Timeout => FAIL") << -1 << -1
+ << fullList
+ << fullList
+ << QRect()
+ << 1 << 0 << (IntList() << int(QtTestTableView::MoveNext))
+ << 1 << 0;
+
+ QTest::newRow("All disabled, wrap backwards. Timeout => FAIL") << -1 << -1
+ << fullList
+ << fullList
+ << QRect()
+ << 1 << 0 << (IntList() << int(QtTestTableView::MovePrevious))
+ << 1 << 0;
}
void tst_QTableView::moveCursorStrikesBack()
@@ -1272,11 +1297,6 @@ void tst_QTableView::moveCursorStrikesBack()
view.hideRow(hideRow);
view.hideColumn(hideColumn);
- foreach (int row, disableRows)
- model.disableRow(row);
- foreach (int column, disableColumns)
- model.disableColumn(column);
-
if (span.height() && span.width())
view.setSpan(span.top(), span.left(), span.height(), span.width());
view.show();
@@ -1284,6 +1304,11 @@ void tst_QTableView::moveCursorStrikesBack()
QModelIndex index = model.index(startRow, startColumn);
view.setCurrentIndex(index);
+ foreach (int row, disableRows)
+ model.disableRow(row);
+ foreach (int column, disableColumns)
+ model.disableColumn(column);
+
int newRow = -1;
int newColumn = -1;
foreach (int cursorMoveAction, cursorMoveActions) {
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index daeee3d..4cb9f72 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -69,6 +69,9 @@
#include <QtGui/qpaintengine.h>
#include <private/qbackingstore_p.h>
+#include <QtGui/QGraphicsView>
+#include <QtGui/QGraphicsProxyWidget>
+
#include "../../shared/util.h"
@@ -285,6 +288,7 @@ private slots:
#ifdef Q_WS_X11
void minAndMaxSizeWithX11BypassWindowManagerHint();
void showHideShow();
+ void clean_qt_x11_enforce_cursor();
#endif
void compatibilityChildInsertedEvents();
@@ -6048,6 +6052,35 @@ void tst_QWidget::showHideShow()
QVERIFY(w.gotExpectedMapNotify);
}
+
+void tst_QWidget::clean_qt_x11_enforce_cursor()
+{
+ {
+ QWidget window;
+ QWidget *w = new QWidget(&window);
+ QWidget *child = new QWidget(w);
+ child->setAttribute(Qt::WA_SetCursor, true);
+
+ window.show();
+ QApplication::setActiveWindow(&window);
+ QTest::qWaitForWindowShown(&window);
+ QTest::qWait(100);
+ QCursor::setPos(window.geometry().center());
+ QTest::qWait(100);
+
+ child->setFocus();
+ QApplication::processEvents();
+ QTest::qWait(100);
+
+ delete w;
+ }
+
+ QGraphicsScene scene;
+ QLineEdit *edit = new QLineEdit;
+ scene.addWidget(edit);
+
+ // If the test didn't crash, then it passed.
+}
#endif
class EventRecorder : public QObject