diff options
Diffstat (limited to 'tests')
19 files changed, 178 insertions, 53 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index f9291a7eb3..8f97c0eb7a 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -57,16 +57,16 @@ else() endif() expect_pass(test_wrap_cpp_and_resources) -expect_pass(test_dependent_modules) +if (NOT NO_WIDGETS) + expect_pass(test_dependent_modules) + expect_pass("test(needsquoting)dirname") +endif() expect_fail(test_add_resource_options) expect_fail(test_wrap_cpp_options) -expect_pass("test(needsquoting)dirname") expect_pass(test_platform_defs_include) expect_pass(test_qtmainwin_library) -# If Qt D-Bus has been installed then run the tests for its macros. -find_package(Qt5DBus QUIET) -if (Qt5DBus_FOUND AND NOT APPLE) +if (NOT NO_DBUS) expect_pass(test_dbus_module) endif() expect_pass(test_multiple_find_package) @@ -80,30 +80,37 @@ expect_pass(test_testlib_definitions) expect_pass(test_json_plugin_includes) expect_fail(test_testlib_no_link_gui) -expect_fail(test_testlib_no_link_widgets) - execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp" "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_gui/test_testlib_no_link_gui/" ) -execute_process(COMMAND ${CMAKE_COMMAND} -E copy - "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp" - "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_widgets/test_testlib_no_link_widgets/" -) + +if (NOT NO_WIDGETS) + expect_fail(test_testlib_no_link_widgets) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/test_testlib_definitions/main.cpp" + "${CMAKE_CURRENT_BINARY_DIR}/failbuild/test_testlib_no_link_widgets/test_testlib_no_link_widgets/" + ) +endif() set(qt_module_includes Core QObject Gui QImage - Widgets QWidget Network QHostInfo - OpenGL QGLBuffer Sql QSqlError Test QTestEventList Xml QDomDocument - PrintSupport QPrintDialog ) -if (UNIX AND NOT APPLE AND NOT QNXNTO) +if (NOT NO_WIDGETS) + list(APPEND qt_module_includes + Widgets QWidget + OpenGL QGLBuffer + PrintSupport QPrintDialog + ) +endif() + +if (NOT NO_DBUS) list(APPEND qt_module_includes DBus QDBusMessage ) diff --git a/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt b/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt index 12ce93ca26..e4c7f07256 100644 --- a/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt +++ b/tests/auto/cmake/test(needsquoting)dirname/CMakeLists.txt @@ -3,13 +3,11 @@ cmake_minimum_required(VERSION 2.8) project("test(needsquoting)dirname") -find_package(Qt5Core REQUIRED) -find_package(Qt5Gui REQUIRED) find_package(Qt5Widgets REQUIRED) -include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) +include_directories(${Qt5Widgets_INCLUDE_DIRS}) -add_definitions(${Qt5Core_DEFINITIONS}) +add_definitions(${Qt5Widgets_DEFINITIONS}) set(CMAKE_INCLUDE_CURRENT_DIR ON) diff --git a/tests/auto/cmake/test_concurrent_module/CMakeLists.txt b/tests/auto/cmake/test_concurrent_module/CMakeLists.txt index efd7b725ea..7014fe51cd 100644 --- a/tests/auto/cmake/test_concurrent_module/CMakeLists.txt +++ b/tests/auto/cmake/test_concurrent_module/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8) project(test_concurrent_module) -find_package(Qt5Concurrent REQUIRED) +find_package(Qt5Concurrent 5.0.0 REQUIRED) include_directories( ${Qt5Concurrent_INCLUDE_DIRS} diff --git a/tests/auto/cmake/test_dbus_module/CMakeLists.txt b/tests/auto/cmake/test_dbus_module/CMakeLists.txt index 6bbb52697c..36480e85e8 100644 --- a/tests/auto/cmake/test_dbus_module/CMakeLists.txt +++ b/tests/auto/cmake/test_dbus_module/CMakeLists.txt @@ -3,17 +3,15 @@ cmake_minimum_required(VERSION 2.8) project(test_dbus_module) -find_package(Qt5Core REQUIRED) -find_package(Qt5DBus REQUIRED) +find_package(Qt5DBus 5.0.0 REQUIRED) include_directories( - ${Qt5Core_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS} ) -add_definitions(${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS}) +add_definitions(${Qt5DBus_DEFINITIONS}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5DBus_EXECUTABLE_COMPILE_FLAGS}") set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -33,4 +31,4 @@ qt5_add_dbus_adaptor(my_srcs ) add_executable(myobject ${my_srcs} ${moc_files}) -target_link_libraries(myobject ${Qt5DBus_LIBRARIES} ${Qt5Core_LIBRARIES}) +target_link_libraries(myobject ${Qt5DBus_LIBRARIES}) diff --git a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt index c370e8effa..cc54bf5bc3 100644 --- a/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt +++ b/tests/auto/cmake/test_testlib_definitions/CMakeLists.txt @@ -35,4 +35,6 @@ endmacro() add_subdirectory(core_only) add_subdirectory(gui) -add_subdirectory(widgets) +if(NOT NO_WIDGETS) + add_subdirectory(widgets) +endif() diff --git a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt index 4ce01938cb..bfcdd9d1d7 100644 --- a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt +++ b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt @@ -13,4 +13,4 @@ add_executable(three three.cpp) find_package(Qt5Core) qt5_use_modules(two Test) -qt5_use_modules(three Widgets Test) +qt5_use_modules(three Gui Test) diff --git a/tests/auto/cmake/test_use_modules_function/three.cpp b/tests/auto/cmake/test_use_modules_function/three.cpp index c3aff71b03..42ae910981 100644 --- a/tests/auto/cmake/test_use_modules_function/three.cpp +++ b/tests/auto/cmake/test_use_modules_function/three.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include <QtTest> -#include <QWidget> +#include <QWindow> class Three : public QObject { @@ -48,7 +48,7 @@ class Three : public QObject public: Three(QObject *parent = 0) { - QWidget *w = new QWidget; + QWindow *w = new QWindow; w->show(); } }; diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index b9b61425da..531ec68fdc 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -168,6 +168,8 @@ private slots: void scaled_QTBUG19157(); void detachOnLoad_QTBUG29639(); + + void copyOnNonAlignedBoundary(); }; static bool lenientCompare(const QPixmap &actual, const QPixmap &expected) @@ -1526,5 +1528,13 @@ void tst_QPixmap::detachOnLoad_QTBUG29639() QVERIFY(a.toImage() != b.toImage()); } +void tst_QPixmap::copyOnNonAlignedBoundary() +{ + QImage img(8, 2, QImage::Format_RGB16); + + QPixmap pm1 = QPixmap::fromImage(img, Qt::NoFormatConversion); + QPixmap pm2 = pm1.copy(QRect(5, 0, 3, 2)); // When copying second line: 2 bytes too many are read which might cause an access violation. +} + QTEST_MAIN(tst_QPixmap) #include "tst_qpixmap.moc" diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp index 4470961f7b..89807f3747 100644 --- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp @@ -208,11 +208,12 @@ static bool runHelper(const QString &program, const QStringList &arguments, QByt // Windows: Due to implementation changes, the event loop needs // to be spun since we ourselves also need to answer the // WM_DRAWCLIPBOARD message as we are in the chain of clipboard - // viewers. + // viewers. Check for running before waitForFinished() in case + // the process terminated while processEvents() was executed. bool running = true; for (int i = 0; i < 60 && running; ++i) { QGuiApplication::processEvents(QEventLoop::ExcludeUserInputEvents); - if (process.waitForFinished(500)) + if (process.state() != QProcess::Running || process.waitForFinished(500)) running = false; } if (running) { diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 2e5f43807a..6c37f1fc27 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -277,6 +277,7 @@ private slots: void drawTextWithComplexBrush(); void QTBUG26013_squareCapStroke(); void QTBUG25153_drawLine(); + void dashing_systemClip(); private: void fillData(); @@ -4458,6 +4459,43 @@ void tst_QPainter::QTBUG25153_drawLine() } } +static void dashing_systemClip_paint(QPainter *p) +{ + p->setPen(QPen(Qt::black, 1, Qt::DashLine, Qt::RoundCap, Qt::MiterJoin)); + p->drawLine(8, 8, 42, 8); + p->drawLine(42, 8, 42, 42); + p->drawLine(42, 42, 8, 42); + p->drawLine(8, 42, 8, 8); +} + +void tst_QPainter::dashing_systemClip() +{ + QImage image(50, 50, QImage::Format_RGB32); + image.fill(Qt::white); + + QPainter p(&image); + dashing_systemClip_paint(&p); + p.end(); + + QImage old = image.copy(); + + image.paintEngine()->setSystemClip(QRect(10, 0, image.width() - 10, image.height())); + + p.begin(&image); + dashing_systemClip_paint(&p); + + // doing same paint operation again with different system clip should not change the image + QCOMPARE(old, image); + + old = image; + + p.setClipRect(QRect(20, 20, 30, 30)); + dashing_systemClip_paint(&p); + + // ditto for regular clips + QCOMPARE(old, image); +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index d1ff60ea70..c94e5c7ffd 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -1641,7 +1641,14 @@ void tst_QSslSocket::setReadBufferSize_task_250027() setReadBufferSize_task_250027_handler.waitSomeMore(socket.data()); QByteArray secondRead = socket->readAll(); // second read should be some more data - QVERIFY(secondRead.size() > 0); + + int secondReadSize = secondRead.size(); + + if (secondReadSize <= 0) { + QEXPECT_FAIL("", "QTBUG-29730", Continue); + } + + QVERIFY(secondReadSize > 0); socket->close(); } diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp index 3bae5d5103..00973cf533 100644 --- a/tests/auto/opengl/qgl/tst_qgl.cpp +++ b/tests/auto/opengl/qgl/tst_qgl.cpp @@ -832,10 +832,19 @@ static void fuzzyCompareImages(const QImage &testImage, const QImage &referenceI class UnclippedWidget : public QWidget { public: + bool painted; + + UnclippedWidget() + : painted(false) + { + } + void paintEvent(QPaintEvent *) { QPainter p(this); p.fillRect(rect().adjusted(-1000, -1000, 1000, 1000), Qt::black); + + painted = true; } }; @@ -866,10 +875,8 @@ void tst_QGL::graphicsViewClipping() scene.setSceneRect(view.viewport()->rect()); QVERIFY(QTest::qWaitForWindowExposed(&view)); - #ifdef Q_OS_MAC - // The black rectangle jumps from the center to the upper left for some reason. - QTest::qWait(100); - #endif + + QTRY_VERIFY(widget->painted); QImage image = viewport->grabFrameBuffer(); QImage expected = image; diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp index 1d2a60506f..6c3591de6f 100644 --- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp @@ -221,6 +221,9 @@ private slots: void QTBUG_16967(); //clean close void QTBUG_23895_data() { generic_data("QSQLITE"); } void QTBUG_23895(); //sqlite boolean type + void QTBUG_14904_data() { generic_data("QSQLITE"); } + void QTBUG_14904(); + void QTBUG_2192_data() { generic_data(); } void QTBUG_2192(); @@ -3407,6 +3410,42 @@ void tst_QSqlQuery::QTBUG_23895() QVERIFY(!q.next()); } +/** + * Test for aliases with dots + */ +void tst_QSqlQuery::QTBUG_14904() +{ + QFETCH(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + + QSqlQuery q(db); + + QString tableName(qTableName("bug14904", __FILE__ )); + tst_Databases::safeDropTable( db, tableName ); + + q.prepare("create table " + tableName + "(val1 bool)"); + QVERIFY_SQL(q, exec()); + q.prepare("insert into " + tableName + "(val1) values(?);"); + q.addBindValue(true); + QVERIFY_SQL(q, exec()); + + QString sql="select val1 AS value1 from " + tableName; + QVERIFY_SQL(q, exec(sql)); + QVERIFY_SQL(q, next()); + + QCOMPARE(q.record().indexOf("value1"), 0); + QCOMPARE(q.record().field(0).type(), QVariant::Bool); + QCOMPARE(q.value(0).toBool(), true); + + sql="select val1 AS 'value.one' from " + tableName; + QVERIFY_SQL(q, exec(sql)); + QVERIFY_SQL(q, next()); + QCOMPARE(q.record().indexOf("value.one"), 0); // was -1 before bug fix + QCOMPARE(q.record().field(0).type(), QVariant::Bool); + QCOMPARE(q.value(0).toBool(), true); +} + void tst_QSqlQuery::QTBUG_2192() { QFETCH( QString, dbName ); @@ -3419,14 +3458,19 @@ void tst_QSqlQuery::QTBUG_2192() QSqlQuery q(db); QVERIFY_SQL(q, exec(QString("CREATE TABLE " + tableName + " (dt %1)").arg(tst_Databases::dateTimeTypeName(db)))); + QDateTime dt = QDateTime(QDate(2012, 7, 4), QTime(23, 59, 59, 999)); QVERIFY_SQL(q, prepare("INSERT INTO " + tableName + " (dt) VALUES (?)")); - q.bindValue(0, QVariant(QDateTime(QDate(2012, 7, 4), QTime(23, 59, 59, 999)))); + q.bindValue(0, dt); QVERIFY_SQL(q, exec()); - // Check if value was stored with at least second precision. QVERIFY_SQL(q, exec("SELECT dt FROM " + tableName)); QVERIFY_SQL(q, next()); - QVERIFY(q.value(0).toDateTime().msecsTo(QDateTime(QDate(2012, 7, 4), QTime(23, 59, 59, 999))) < 1000 ); + + // Check if retrieved value preserves reported precision + int precision = qMax(0, q.record().field("dt").precision()); + int diff = qAbs(q.value(0).toDateTime().msecsTo(dt)); + int keep = qMin(1000, (int)qPow(10.0, precision)); + QVERIFY(diff <= 1000 - keep); } } diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h index f12899e368..aaadcef601 100644 --- a/tests/auto/tools/moc/parse-defines.h +++ b/tests/auto/tools/moc/parse-defines.h @@ -64,7 +64,7 @@ #define PD_CLASSINFO Q_CLASSINFO -#if defined(Q_COMPILER_VARIADIC_MACROS) +#if defined(Q_COMPILER_VARIADIC_MACROS) || defined (Q_MOC_RUN) #define PD_VARARG(x, ...) x(__VA_ARGS__) #if defined(Q_CC_GNU) || defined(Q_MOC_RUN) @@ -104,7 +104,7 @@ public slots: PD_TEST_IDENTIFIER_ARG(void, combined6()) {} -#if defined(Q_COMPILER_VARIADIC_MACROS) +#if defined(Q_COMPILER_VARIADIC_MACROS) || defined (Q_MOC_RUN) PD_VARARG(void vararg1) {} PD_VARARG(void vararg2, int) {} PD_VARARG(void vararg3, int, int) {} @@ -112,6 +112,13 @@ public slots: PD_VARARGEXT(void vararg4) {} PD_VARARGEXT(void vararg5, int) {} PD_VARARGEXT(void vararg6, int, int) {} +#else + void vararg1() {} + void vararg2(int) {} + void vararg3(int,int) {} + void vararg4() {} + void vararg5(int) {} + void vararg6(int,int) {} #endif #define OUTERFUNCTION(x) x diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 5fc46d195b..3cd2f1f936 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -2902,7 +2902,6 @@ void tst_Moc::parseDefines() index = mo->indexOfSlot("combined6()"); QVERIFY(index != -1); -#if defined(Q_COMPILER_VARIADIC_MACROS) index = mo->indexOfSlot("vararg1()"); QVERIFY(index != -1); index = mo->indexOfSlot("vararg2(int)"); @@ -2915,7 +2914,6 @@ void tst_Moc::parseDefines() QVERIFY(index != -1); index = mo->indexOfSlot("vararg6(int,int)"); QVERIFY(index != -1); -#endif index = mo->indexOfSlot("INNERFUNCTION(int)"); QVERIFY(index != -1); diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp index cb403bac20..441277ef53 100644 --- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp +++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp @@ -103,6 +103,10 @@ void tst_QToolTip::task183679() QFETCH(Qt::Key, key); QFETCH(bool, visible); +#ifdef Q_OS_MAC + QSKIP("This test fails in the CI system, QTBUG-30040"); +#endif + Widget_task183679 widget; widget.show(); QApplication::setActiveWindow(&widget); diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 3d7cc14a5d..252d47f698 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -4240,8 +4240,11 @@ void tst_QWidget::isOpaque() */ void tst_QWidget::scroll() { + const int w = qMin(500, qApp->desktop()->availableGeometry().width() / 2); + const int h = qMin(500, qApp->desktop()->availableGeometry().height() / 2); + UpdateWidget updateWidget; - updateWidget.resize(500, 500); + updateWidget.resize(w, h); updateWidget.reset(); updateWidget.show(); qApp->setActiveWindow(&updateWidget); @@ -4252,8 +4255,8 @@ void tst_QWidget::scroll() updateWidget.reset(); updateWidget.scroll(10, 10); qApp->processEvents(); - QRegion dirty(QRect(0, 0, 500, 10)); - dirty += QRegion(QRect(0, 10, 10, 490)); + QRegion dirty(QRect(0, 0, w, 10)); + dirty += QRegion(QRect(0, 10, 10, h - 10)); QCOMPARE(updateWidget.paintedRegion, dirty); } @@ -4262,11 +4265,14 @@ void tst_QWidget::scroll() updateWidget.update(0, 0, 10, 10); updateWidget.scroll(0, 10); qApp->processEvents(); - QRegion dirty(QRect(0, 0, 500, 10)); + QRegion dirty(QRect(0, 0, w, 10)); dirty += QRegion(QRect(0, 10, 10, 10)); QCOMPARE(updateWidget.paintedRegion, dirty); } + if (updateWidget.width() < 200 || updateWidget.height() < 200) + QSKIP("Skip this test due to too small screen geometry."); + { updateWidget.reset(); updateWidget.update(0, 0, 100, 100); diff --git a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp index beb1d27620..bbd71a9284 100644 --- a/tests/auto/widgets/util/qscroller/tst_qscroller.cpp +++ b/tests/auto/widgets/util/qscroller/tst_qscroller.cpp @@ -153,7 +153,6 @@ void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint QCOMPARE( s1->state(), QScroller::Inactive ); QScrollerProperties sp1 = QScroller::scroller(sw)->scrollerProperties(); - int fps = 60; QTouchEvent::TouchPoint rawTouchPoint; rawTouchPoint.setId(0); @@ -192,8 +191,7 @@ void tst_QScroller::kineticScroll( tst_QScrollerWidget *sw, QPointF from, QPoint QCOMPARE( sw->receivedPrepare, true ); - QTest::qWait(1000 / fps * 2); // wait until the first scroll move - QCOMPARE( sw->receivedFirst, true ); + QTRY_COMPARE( sw->receivedFirst, true ); QCOMPARE( sw->receivedScroll, true ); QCOMPARE( sw->receivedOvershoot, false ); @@ -407,7 +405,7 @@ void tst_QScroller::scroll() QScroller *s1 = QScroller::scroller(sw); kineticScroll(sw, QPointF(500, 500), QPoint(0, 0), QPoint(100, 100), QPoint(200, 200)); // now we should be scrolling - QCOMPARE( s1->state(), QScroller::Scrolling ); + QTRY_COMPARE( s1->state(), QScroller::Scrolling ); // wait until finished, check that no further first scroll is send sw->receivedFirst = false; diff --git a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp index 92b16ac155..6ab7cb4491 100644 --- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp +++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp @@ -735,7 +735,7 @@ void tst_QDockWidget::task169808_setFloating() QSize sizeHint() const { const QRect& deskRect = qApp->desktop()->availableGeometry(); - return QSize(qMin(300, deskRect.width()), 300); + return QSize(qMin(300, deskRect.width() / 2), qMin(300, deskRect.height() / 2)); } QSize minimumSizeHint() const |