summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp13
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp3
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp3
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp7
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp11
-rw-r--r--tests/auto/widgets/widgets/qcalendarwidget/qcalendarwidget.pro3
-rw-r--r--tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp2
-rw-r--r--tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp5
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp6
9 files changed, 22 insertions, 31 deletions
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index af76b1c3c1..ee7ec7ba57 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -4338,9 +4338,16 @@ void tst_QGraphicsView::task255529_transformationAnchorMouseAndViewportMargins()
QPointF newMouseScenePos = view.mapToScene(mouseViewPos);
qreal slack = 1;
- QEXPECT_FAIL("", "QTBUG-22455", Abort);
- QVERIFY(qAbs(newMouseScenePos.x() - mouseScenePos.x()) < slack);
- QVERIFY(qAbs(newMouseScenePos.y() - mouseScenePos.y()) < slack);
+
+ const qreal dx = qAbs(newMouseScenePos.x() - mouseScenePos.x());
+ const qreal dy = qAbs(newMouseScenePos.y() - mouseScenePos.y());
+ const QByteArray message = QString::fromLatin1("QTBUG-22455, distance: dx=%1, dy=%2 slack=%3 (%4).").
+ arg(dx).arg(dy).arg(slack).arg(qApp->style()->metaObject()->className()).toLocal8Bit();
+ // This is highly unstable (observed to pass on Windows and some Linux configurations).
+#ifdef Q_OS_MAC
+ QEXPECT_FAIL("", message.constData(), Abort);
+#endif
+ QVERIFY2(dx < slack && dy < slack, message.constData());
#endif
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 0a2d0cd2f8..c6b2b49d98 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -1158,9 +1158,6 @@ void tst_QGraphicsWidget::initStyleOption()
QCOMPARE(hasFocus, focus);
bool isUnderMouse = option.state & QStyle::State_MouseOver;
#ifndef Q_OS_WINCE
-# if !defined(Q_OS_MAC) && !defined(Q_OS_WIN)
- QEXPECT_FAIL("all", "QTBUG-22457", Abort);
-# endif
QCOMPARE(isUnderMouse, underMouse);
#endif
// if (layoutDirection != Qt::LeftToRight)
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index f139eac275..9bb08edcce 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -1830,10 +1830,11 @@ void tst_QListView::taskQTBUG_2233_scrollHiddenItems()
QStringListModel model(&view);
QStringList list;
for (int i = 0; i < rowCount; ++i)
- list << QString::fromAscii("Item %1").arg(i);
+ list << QString::number(i);
model.setStringList(list);
view.setModel(&model);
+ view.setUniformItemSizes(true);
view.setViewMode(QListView::ListMode);
for (int i = 0; i < rowCount / 2; ++i)
view.setRowHidden(2 * i, true);
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index caf0f1f80d..dab9dd7690 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -5693,7 +5693,6 @@ private:
void tst_QWidget::childEvents()
{
EventRecorder::EventList expected;
- bool accessibilityEnabled = false;
// Move away the cursor; otherwise it might result in an enter event if it's
// inside the widget when the widget is shown.
@@ -5735,8 +5734,6 @@ void tst_QWidget::childEvents()
<< qMakePair(&widget, QEvent::Resize)
<< qMakePair(&widget, QEvent::Show);
- if (accessibilityEnabled)
- expected << qMakePair(&widget, QEvent::AccessibilityPrepare);
expected << qMakePair(&widget, QEvent::ShowToParent);
QCOMPARE(spy.eventList(), expected);
spy.clear();
@@ -5820,8 +5817,6 @@ void tst_QWidget::childEvents()
<< qMakePair(&widget, QEvent::Resize)
<< qMakePair(&widget, QEvent::Show);
- if (accessibilityEnabled)
- expected << qMakePair(&widget, QEvent::AccessibilityPrepare);
expected << qMakePair(&widget, QEvent::ShowToParent);
QCOMPARE(spy.eventList(), expected);
spy.clear();
@@ -5908,8 +5903,6 @@ void tst_QWidget::childEvents()
<< qMakePair(&widget, QEvent::Resize)
<< qMakePair(&widget, QEvent::Show);
- if (accessibilityEnabled)
- expected << qMakePair(&widget, QEvent::AccessibilityPrepare);
expected << qMakePair(&widget, QEvent::ShowToParent);
QCOMPARE(spy.eventList(), expected);
spy.clear();
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 1201b0f1da..544923a1c3 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -555,11 +555,11 @@ void tst_QStyleSheetStyle::layoutSpacing()
void tst_QStyleSheetStyle::qproperty()
{
QPushButton pb;
- pb.setStyleSheet("QPushButton { qproperty-text: hello; qproperty-checkable: true; qproperty-checked: 1}");
+ pb.setStyleSheet("QPushButton { qproperty-text: hello; qproperty-checkable: 1; qproperty-checked: false}");
pb.ensurePolished();
QCOMPARE(pb.text(), QString("hello"));
QCOMPARE(pb.isCheckable(), true);
- QCOMPARE(pb.isChecked(), true);
+ QCOMPARE(pb.isChecked(), false);
}
namespace ns {
@@ -781,10 +781,6 @@ void tst_QStyleSheetStyle::focusColors()
+ " did not contain background color #e8ff66, using style "
+ QString::fromLatin1(qApp->style()->metaObject()->className()))
.toLocal8Bit().constData());
-#ifdef Q_OS_MAC
- if (widget == widgets.first())
- QEXPECT_FAIL("", "Failure only for first widget, the QPushButton, see QTBUG-23686", Continue);
-#endif
QVERIFY2(testForColors(image, QColor(0xff, 0x00, 0x84)),
(QString::fromLatin1(widget->metaObject()->className())
+ " did not contain text color #ff0084, using style "
@@ -882,8 +878,7 @@ void tst_QStyleSheetStyle::hoverColors()
(QString::fromLatin1(widget->metaObject()->className())
+ " did not contain background color #e8ff66").toLocal8Bit().constData());
#ifdef Q_OS_MAC
- if (qobject_cast<QPushButton *>(widget)
- || qobject_cast<QComboBox *>(widget))
+ if (qobject_cast<QComboBox *>(widget))
QEXPECT_FAIL("", "Failure only for QPushButton and QComboBox, see QTBUG-23686", Continue);
#endif
QVERIFY2(testForColors(image, QColor(0xff, 0x00, 0x84)),
diff --git a/tests/auto/widgets/widgets/qcalendarwidget/qcalendarwidget.pro b/tests/auto/widgets/widgets/qcalendarwidget/qcalendarwidget.pro
index 127d78596a..f16110cbd1 100644
--- a/tests/auto/widgets/widgets/qcalendarwidget/qcalendarwidget.pro
+++ b/tests/auto/widgets/widgets/qcalendarwidget/qcalendarwidget.pro
@@ -2,6 +2,3 @@ CONFIG += testcase
TARGET = tst_qcalendarwidget
QT += widgets testlib
SOURCES += tst_qcalendarwidget.cpp
-
-# QTBUG-23615 - unstable test
-linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test
diff --git a/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp b/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp
index 4f95f80525..4857900dc8 100644
--- a/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp
+++ b/tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp
@@ -175,6 +175,8 @@ void tst_QCalendarWidget::buttonClickCheck()
QSize size = object.sizeHint();
object.setGeometry(0,0,size.width(), size.height());
object.show();
+ QTest::qWaitForWindowShown(&object);
+ object.activateWindow();
QDate selectedDate(2005, 1, 1);
//click on the month buttons
diff --git a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
index 0f07546559..c6a039cb37 100644
--- a/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
+++ b/tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
@@ -1435,6 +1435,11 @@ void MoveSeparator::apply(QMainWindow *mw) const
}
QVERIFY(!path.isEmpty());
+ // For QTBUG-15689:
+ // Following commands is used to simulate user move action. A better way should
+ // use QMainWindowLayout::startSeparatorMove/separatorMove/endSeparatorMove,
+ // but then we will need real start/end position coordinates.
+ l->layoutState.dockAreaLayout.fallbackToSizeHints = false;
l->layoutState.dockAreaLayout.separatorMove(path, QPoint(0, 0), QPoint(delta, delta));
}
#endif
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 4fffd74491..473c5e05ec 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -562,9 +562,6 @@ void tst_QMenu::tearOff()
QTest::mouseClick(menu, Qt::LeftButton, 0, QPoint(3, 3), 10);
QTest::qWait(100);
-#ifndef Q_OS_MAC
- QEXPECT_FAIL("", "QTBUG-22565", Abort);
-#endif
QVERIFY(menu->isTearOffMenuVisible());
QPointer<QMenu> torn = 0;
foreach (QWidget *w, QApplication::allWidgets()) {
@@ -783,9 +780,6 @@ void tst_QMenu::task258920_mouseBorder()
#ifdef Q_OS_WINCE_WM
QSKIP("Mouse move related signals for Windows Mobile unavailable");
#endif
- // ### fixme: Check platforms
- QSKIP("QTBUG-20753 QCursor::setPos() / QTest::mouseMove() doesn't work on qpa");
-
Menu258920 menu;
// For styles which inherit from QWindowsStyle, styleHint(QStyle::SH_Menu_MouseTracking) is true.
menu.setMouseTracking(true);