diff options
Diffstat (limited to 'tests/auto/widgets')
6 files changed, 122 insertions, 12 deletions
diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp index eee227fc2f..eee649847f 100644 --- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp @@ -1048,12 +1048,12 @@ void tst_QFiledialog::setMimeTypeFilters_data() QTest::addColumn<QString>("expectedSelectedMimeTypeFilter"); const auto headerMime = QStringLiteral("text/x-chdr"); - const auto jsonMime = QStringLiteral("application/json"); + const auto pdfMime = QStringLiteral("application/pdf"); const auto zipMime = QStringLiteral("application/zip"); QTest::newRow("single mime filter (C header file)") << QStringList {headerMime} << headerMime << headerMime; - QTest::newRow("single mime filter (JSON file)") << QStringList {jsonMime} << jsonMime << jsonMime; - QTest::newRow("multiple mime filters") << QStringList {jsonMime, zipMime} << jsonMime << jsonMime; + QTest::newRow("single mime filter (JSON file)") << QStringList {pdfMime} << pdfMime << pdfMime; + QTest::newRow("multiple mime filters") << QStringList {pdfMime, zipMime} << pdfMime << pdfMime; } void tst_QFiledialog::setMimeTypeFilters() @@ -1067,6 +1067,10 @@ void tst_QFiledialog::setMimeTypeFilters() fd.selectMimeTypeFilter(targetMimeTypeFilter); QCOMPARE(fd.selectedMimeTypeFilter(), expectedSelectedMimeTypeFilter); + + auto *filters = fd.findChild<QComboBox*>("fileTypeCombo"); + filters->setCurrentIndex(filters->count() - 1); + QCOMPARE(fd.selectedMimeTypeFilter(), mimeTypeFilters.last()); } void tst_QFiledialog::setEmptyNameFilter() diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index 8ec8f0e3c8..e880640b6b 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -43,6 +43,7 @@ #include <qtreewidget.h> #include <qdebug.h> #include <qscreen.h> +#include <qdesktopwidget.h> typedef QList<int> IntList; @@ -244,6 +245,7 @@ private slots: void testMinMaxSectionSize(); void sizeHintCrash(); void testResetCachedSizeHint(); + void statusTips(); protected: void setupTestData(bool use_reset_model = false); @@ -270,12 +272,20 @@ public: int rowCount(const QModelIndex&) const override { return rows; } int columnCount(const QModelIndex&) const override { return cols; } bool isEditable(const QModelIndex &) const { return true; } - - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const { - if (role == Qt::DisplayRole) - return m_bMultiLine ? QString("%1\n%1").arg(section) : QString::number(section); - return QAbstractTableModel::headerData(section, orientation, role); + if (section < 0 || (role != Qt::DisplayRole && role != Qt::StatusTipRole)) + return QVariant(); + const int row = (orientation == Qt::Vertical ? section : 0); + const int col = (orientation == Qt::Horizontal ? section : 0); + if (orientation == Qt::Vertical && row >= rows) + return QVariant(); + if (orientation == Qt::Horizontal && col >= cols) + return QVariant(); + if (m_bMultiLine) + return QString("%1\n%1").arg(section); + return QLatin1Char('[') + QString::number(row) + QLatin1Char(',') + + QString::number(col) + QLatin1String(",0] -- Header"); } QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const override { @@ -3368,5 +3378,54 @@ void tst_QHeaderView::testResetCachedSizeHint() } +class StatusTipHeaderView : public QHeaderView +{ +public: + StatusTipHeaderView(Qt::Orientation orientation = Qt::Horizontal, QWidget *parent = 0) : + QHeaderView(orientation, parent), gotStatusTipEvent(false) {} + bool gotStatusTipEvent; + QString statusTipText; +protected: + bool event(QEvent *e) + { + if (e->type() == QEvent::StatusTip) { + gotStatusTipEvent = true; + statusTipText = static_cast<QStatusTipEvent *>(e)->tip(); + } + return QHeaderView::event(e); + } +}; + +void tst_QHeaderView::statusTips() +{ + StatusTipHeaderView headerView; + QtTestModel model; + model.rows = model.cols = 5; + headerView.setModel(&model); + headerView.viewport()->setMouseTracking(true); + headerView.setGeometry(QRect(QPoint(QApplication::desktop()->geometry().center() - QPoint(250, 250)), + QSize(500, 500))); + headerView.show(); + qApp->setActiveWindow(&headerView); + QVERIFY(QTest::qWaitForWindowActive(&headerView)); + + // Ensure it is moved away first and then moved to the relevant section + QTest::mouseMove(QApplication::desktop(), + headerView.rect().bottomLeft() + QPoint(20, 20)); + QPoint centerPoint = QRect(headerView.sectionPosition(0), headerView.y(), + headerView.sectionSize(0), headerView.height()).center(); + QTest::mouseMove(headerView.windowHandle(), centerPoint); + QTRY_VERIFY(headerView.gotStatusTipEvent); + QCOMPARE(headerView.statusTipText, QLatin1String("[0,0,0] -- Header")); + + headerView.gotStatusTipEvent = false; + headerView.statusTipText.clear(); + centerPoint = QRect(headerView.sectionPosition(1), headerView.y(), + headerView.sectionSize(1), headerView.height()).center(); + QTest::mouseMove(headerView.windowHandle(), centerPoint); + QTRY_VERIFY(headerView.gotStatusTipEvent); + QCOMPARE(headerView.statusTipText, QLatin1String("[0,1,0] -- Header")); +} + QTEST_MAIN(tst_QHeaderView) #include "tst_qheaderview.moc" diff --git a/tests/auto/widgets/kernel/qapplication/test/test.pro b/tests/auto/widgets/kernel/qapplication/test/test.pro index 76411a9ebe..8ade4d8364 100644 --- a/tests/auto/widgets/kernel/qapplication/test/test.pro +++ b/tests/auto/widgets/kernel/qapplication/test/test.pro @@ -9,20 +9,20 @@ builtin_testdata: DEFINES += BUILTIN_TESTDATA TESTDATA = ../test/test.pro ../tmp/README ../modal -!winrt: SUBPROGRAMS = desktopsettingsaware modal +!android:!winrt: SUBPROGRAMS = desktopsettingsaware modal debug_and_release { CONFIG(debug, debug|release) { TARGET = ../../debug/tst_qapplication - !winrt: TEST_HELPER_INSTALLS = ../debug/helper + !android:!winrt: TEST_HELPER_INSTALLS = ../debug/helper for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../debug/$${file}" } else { TARGET = ../../release/tst_qapplication - !winrt: TEST_HELPER_INSTALLS = ../release/helper + !android:!winrt: TEST_HELPER_INSTALLS = ../release/helper for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../release/$${file}" } } else { TARGET = ../tst_qapplication - !winrt: TEST_HELPER_INSTALLS = ../helper + !android:!winrt: TEST_HELPER_INSTALLS = ../helper for(file, SUBPROGRAMS): TEST_HELPER_INSTALLS += "../$${file}" } diff --git a/tests/auto/widgets/widgets/qframe/BLACKLIST b/tests/auto/widgets/widgets/qframe/BLACKLIST new file mode 100644 index 0000000000..3a28dd1239 --- /dev/null +++ b/tests/auto/widgets/widgets/qframe/BLACKLIST @@ -0,0 +1,3 @@ +# QTBUG-69064 +[testPainting] +android diff --git a/tests/auto/widgets/widgets/qgroupbox/BLACKLIST b/tests/auto/widgets/widgets/qgroupbox/BLACKLIST new file mode 100644 index 0000000000..62ba05797e --- /dev/null +++ b/tests/auto/widgets/widgets/qgroupbox/BLACKLIST @@ -0,0 +1,13 @@ +# QTBUG-69083 +[clicked:hit nothing, checkable] +android +[clicked:hit frame, checkable] +android +[clicked:hit nothing, checkable, but unchecked] +android +[clicked:hit frame, checkable, but unchecked] +android + +# QTBUG-69084 +[task_QTBUG_15519_propagateMouseEvents] +android diff --git a/tests/auto/widgets/widgets/qlineedit/BLACKLIST b/tests/auto/widgets/widgets/qlineedit/BLACKLIST new file mode 100644 index 0000000000..537c81413e --- /dev/null +++ b/tests/auto/widgets/widgets/qlineedit/BLACKLIST @@ -0,0 +1,31 @@ +# QTBUG-69111 +[undo_keypressevents:Inserts,moving,selection, delete and undo] +android + +# QTBUG-69112 +[inlineCompletion] +android + +# QTBUG-69116 +[leftKeyOnSelectedText] +android + +# QTBUG-69113 +[textMargin] +android + +# QTBUG-69119 +[task174640_editingFinished] +android + +# QTBUG-69118 +[task210502_caseInsensitiveInlineCompletion] +android + +# QTBUG-69114 +[QTBUG697_paletteCurrentColorGroup] +android + +# QTBUG-69115 +[testQuickSelectionWithMouse] +android |