diff options
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r-- | tests/auto/widgets/dialogs/qfontdialog/BLACKLIST | 4 | ||||
-rw-r--r-- | tests/auto/widgets/effects/qpixmapfilter/noise.png | bin | 7517 -> 6305 bytes | |||
-rw-r--r-- | tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST | 6 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/BLACKLIST | 3 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 66 | ||||
-rw-r--r-- | tests/auto/widgets/styles/qstyle/tst_qstyle.cpp | 48 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qcombobox/qtlogoinverted.png | bin | 2827 -> 2297 bytes | |||
-rw-r--r-- | tests/auto/widgets/widgets/qmdisubwindow/BLACKLIST | 2 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qmenu/BLACKLIST | 3 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp | 13 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp | 13 |
11 files changed, 140 insertions, 18 deletions
diff --git a/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST b/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST index 5fd026537e..669ec50978 100644 --- a/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST +++ b/tests/auto/widgets/dialogs/qfontdialog/BLACKLIST @@ -1,7 +1,3 @@ [task256466_wrongStyle] opensuse-13.1 rhel-7.1 -[setFont] -ubuntu-14.04 -redhatenterpriselinuxworkstation-6.6 -rhel-7.1 diff --git a/tests/auto/widgets/effects/qpixmapfilter/noise.png b/tests/auto/widgets/effects/qpixmapfilter/noise.png Binary files differindex 1bebaf528e..c8433602b2 100644 --- a/tests/auto/widgets/effects/qpixmapfilter/noise.png +++ b/tests/auto/widgets/effects/qpixmapfilter/noise.png diff --git a/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST b/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST index 14c41711ac..7f55c2dae0 100644 --- a/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST +++ b/tests/auto/widgets/gestures/qgesturerecognizer/BLACKLIST @@ -1,8 +1,2 @@ [panGesture:Two finger] xcb -[swipeGesture:SmallDirectionChange] -rhel-7.1 -[swipeGesture:Line] -rhel-7.1 -[pinchGesture:Standard] -rhel-7.1 diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index 8d18d40e05..4563da8d48 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -32,7 +32,6 @@ osx osx [widgetAt] osx -rhel-7.1 [sheetOpacity] osx [resizeEvent] @@ -65,10 +64,8 @@ osx osx [taskQTBUG_4055_sendSyntheticEnterLeave] osx -rhel-7.1 [syntheticEnterLeave] osx -rhel-7.1 [maskedUpdate] osx [hideWhenFocusWidgetIsChild] diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index ae48445363..1a9d7ec4d2 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -456,6 +456,8 @@ private slots: void qmlSetParentHelper(); + void testForOutsideWSRangeFlag(); + private: bool ensureScreenSize(int width, int height); QWidget *testWidget; @@ -10544,5 +10546,69 @@ void tst_QWidget::qmlSetParentHelper() #endif } +void tst_QWidget::testForOutsideWSRangeFlag() +{ + // QTBUG-49445 + { + QWidget widget; + widget.resize(0, 0); + widget.show(); + QTest::qWait(100); // Wait for a while... + QVERIFY(!widget.windowHandle()->isExposed()); // The window should not be visible + QVERIFY(widget.isVisible()); // The widget should be in visible state + } + { + QWidget widget; + + QWidget native(&widget); + native.setAttribute(Qt::WA_NativeWindow); + native.resize(0, 0); + + widget.show(); + QVERIFY(QTest::qWaitForWindowExposed(&widget)); + QVERIFY(!native.windowHandle()->isExposed()); + } + { + QWidget widget; + QWidget native(&widget); + + widget.show(); + QVERIFY(QTest::qWaitForWindowExposed(&widget)); + QVERIFY(native.isVisible()); + + native.resize(0, 0); + native.setAttribute(Qt::WA_NativeWindow); + QTest::qWait(100); // Wait for a while... + QVERIFY(!native.windowHandle()->isExposed()); + } + + // QTBUG-48321 + { + QWidget widget; + + QWidget native(&widget); + native.setAttribute(Qt::WA_NativeWindow); + + widget.show(); + QVERIFY(QTest::qWaitForWindowExposed(&widget)); + QVERIFY(native.windowHandle()->isExposed()); + + native.resize(0, 0); + QTest::qWait(100); // Wait for a while... + QVERIFY(!native.windowHandle()->isExposed()); + } + + // QTBUG-51788 + { + QWidget widget; + widget.setLayout(new QGridLayout); + widget.layout()->addWidget(new QLineEdit); + widget.resize(0, 0); + widget.show(); + // The layout should change the size, so the widget must be visible! + QVERIFY(QTest::qWaitForWindowExposed(&widget)); + } +} + QTEST_MAIN(tst_QWidget) #include "tst_qwidget.moc" diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index f667d6f8fb..37b72cc99c 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -124,6 +124,8 @@ private slots: void defaultFont(); void testDrawingShortcuts(); void testFrameOnlyAroundContents(); + + void testProxyCalled(); private: void lineUpLayoutTest(QStyle *); QWidget *testWidget; @@ -789,5 +791,51 @@ void tst_QStyle::testFrameOnlyAroundContents() } +class ProxyTest: public QProxyStyle +{ + Q_OBJECT +public: + ProxyTest(QStyle *style = 0) + :QProxyStyle(style) + , called(false) + {} + + void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w) const Q_DECL_OVERRIDE { + called = true; + return QProxyStyle::drawPrimitive(pe, opt, p, w); + } + mutable bool called; +}; + + +void tst_QStyle::testProxyCalled() +{ + QToolButton b; + b.setArrowType(Qt::DownArrow); + QStyleOptionToolButton opt; + opt.init(&b); + opt.features |= QStyleOptionToolButton::Arrow; + QPixmap surface(QSize(200, 200)); + QPainter painter(&surface); + + QStringList keys = QStyleFactory::keys(); + QVector<QStyle*> styles; + styles.reserve(keys.size() + 1); + + styles << new QCommonStyle(); + + Q_FOREACH (const QString &key, keys) { + styles << QStyleFactory::create(key); + } + + Q_FOREACH (QStyle *style, styles) { + ProxyTest testStyle; + testStyle.setBaseStyle(style); + style->drawControl(QStyle::CE_ToolButtonLabel, &opt, &painter, &b); + QVERIFY(testStyle.called); + delete style; + } +} + QTEST_MAIN(tst_QStyle) #include "tst_qstyle.moc" diff --git a/tests/auto/widgets/widgets/qcombobox/qtlogoinverted.png b/tests/auto/widgets/widgets/qcombobox/qtlogoinverted.png Binary files differindex 61efb2f001..af150a697b 100644 --- a/tests/auto/widgets/widgets/qcombobox/qtlogoinverted.png +++ b/tests/auto/widgets/widgets/qcombobox/qtlogoinverted.png diff --git a/tests/auto/widgets/widgets/qmdisubwindow/BLACKLIST b/tests/auto/widgets/widgets/qmdisubwindow/BLACKLIST deleted file mode 100644 index a10cf663d0..0000000000 --- a/tests/auto/widgets/widgets/qmdisubwindow/BLACKLIST +++ /dev/null @@ -1,2 +0,0 @@ -[setSystemMenu] -rhel-7.1 diff --git a/tests/auto/widgets/widgets/qmenu/BLACKLIST b/tests/auto/widgets/widgets/qmenu/BLACKLIST index dbc3e26837..de49d5ff45 100644 --- a/tests/auto/widgets/widgets/qmenu/BLACKLIST +++ b/tests/auto/widgets/widgets/qmenu/BLACKLIST @@ -1,5 +1,2 @@ [task258920_mouseBorder] osx -rhel-7.1 -[pushButtonPopulateOnAboutToShow] -rhel-7.1 diff --git a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp index 63f3522214..6ad13cd781 100644 --- a/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp +++ b/tests/auto/widgets/widgets/qplaintextedit/tst_qplaintextedit.cpp @@ -149,6 +149,7 @@ private slots: #ifndef QT_NO_CONTEXTMENU void contextMenu(); #endif + void inputMethodCursorRect(); private: void createSelection(); @@ -1722,5 +1723,17 @@ void tst_QPlainTextEdit::contextMenu() } #endif // QT_NO_CONTEXTMENU +// QTBUG-51923: Verify that the cursor rectangle returned by the input +// method query correctly reflects the viewport offset. +void tst_QPlainTextEdit::inputMethodCursorRect() +{ + ed->setPlainText("Line1\nLine2Line3\nLine3"); + ed->moveCursor(QTextCursor::End); + const QRectF cursorRect = ed->cursorRect(); + const QVariant cursorRectV = ed->inputMethodQuery(Qt::ImCursorRectangle); + QCOMPARE(cursorRectV.type(), QVariant::RectF); + QCOMPARE(cursorRectV.toRect(), cursorRect.toRect()); +} + QTEST_MAIN(tst_QPlainTextEdit) #include "tst_qplaintextedit.moc" diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index 26ccc08f9b..f1ebfda88b 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -186,6 +186,7 @@ private slots: void inputMethodQuery(); void inputMethodQueryImHints_data(); void inputMethodQueryImHints(); + void inputMethodCursorRect(); void highlightLongLine(); @@ -2468,6 +2469,18 @@ void tst_QTextEdit::inputMethodQueryImHints() QCOMPARE(static_cast<Qt::InputMethodHints>(value.toInt()), hints); } +// QTBUG-51923: Verify that the cursor rectangle returned by the input +// method query correctly reflects the viewport offset. +void tst_QTextEdit::inputMethodCursorRect() +{ + ed->setPlainText("Line1\nLine2Line3\nLine3"); + ed->moveCursor(QTextCursor::End); + const QRectF cursorRect = ed->cursorRect(); + const QVariant cursorRectV = ed->inputMethodQuery(Qt::ImCursorRectangle); + QCOMPARE(cursorRectV.type(), QVariant::RectF); + QCOMPARE(cursorRectV.toRect(), cursorRect.toRect()); +} + void tst_QTextEdit::highlightLongLine() { QTextEdit edit; |