summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Mimic qmake by building our own xinputLeander Beernaert2019-10-211-1/+16
| | | | | | | | When we don't find the xinput library on the system, build it ourselves. Change-Id: I399e847513cdd1c2dcdc1d862265284002f8808a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* Regenerate all configure.json filesLeander Beernaert2019-10-214-37/+127
| | | | | Change-Id: Iabd2430adc4877859dc73f4092927a69decf0311 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Handle Library dependencies in compile testsLeander Beernaert2019-10-211-10/+21
| | | | | | | | Update configurejson2cmake.py to also write out the libraries compile tests depend on. Change-Id: I22dbc227a33b9b5d39a2198c6ee6062e7e1bf3de Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QtBuild: Use STRING type for install locationsTobias Hunger2019-10-211-15/+16
| | | | | | | | | | | | | Use STRING type for install locations as we use them relative to the CMAKE_INSTALL_PREFIX. PATH type will get expanded to absolute paths by newer CMake versions, so that breaks our logic. Change-Id: I36be1f0378c4fb07ad8db0051d540f9d243000be Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Write out a module description fileTobias Hunger2019-10-213-0/+32
| | | | | | | | | Write out a file with some JSON data to describe a module. This file contains information on how that module has been built. Change-Id: I8a604692663cbb7b76b96b97124130e30b822e4b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Convert corelib plugin testsLeander Beernaert2019-10-2127-2/+697
| | | | | Change-Id: Ia98f7945a2c5b09a9b4d59e430cf05a7fecb7d55 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add ALLOW_UNDEFINED_SYMBOLS to add_qt_pluginLeander Beernaert2019-10-211-4/+6
| | | | | | | | Allow plugins to be built with undefined symbols when ALLOW_UNDEFINED_SYMBOLS is specified. Change-Id: I6bc809e3e5257302157bf8484f850d8319674a4a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Temporarily disable automatic static linking of bearer pluginsAlexandru Croitor2019-10-182-0/+2
| | | | | | | | | | | The bearer plugins cause duplicate symbol errors when linking executables in a static build. Re-apply commit b2662b05dd078c46b82f5f041f51b0b83554113d Task-number: QTBUG-79211 Change-Id: Ie4c1359f1f4d649a22570a31634c94fd22102730 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix OpenSSL include path for QtNetwork private testsLeander Beernaert2019-10-181-0/+14
| | | | | | | | | On platforms which use OpenSSL that is not installed in a standard directory, e.g: android + vcpkg, private tests would fail to resolve the include for OpenSSL. Change-Id: I57ce6a83e3bc9a232d4285530f8619ffbfdf2f77 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Prospective fix for Boot2Qt build in the CISimon Hausmann2019-10-181-3/+3
| | | | | | | | | | | | | | | One of the parameters that Coin passes to configure is this: -device-option DISTRO_OPTS="hard-float boot2qt" The configure script would "swallow" the quotes and end up calling qmake with -device-option DISTRO_OPTS=hard-float boot2qt, causing qmake to complain that the standalone "boot2qt" option is unknown. Fix this by preserving the quotes in the forwarding helper functions. Change-Id: I16098bd35acb579ebf183b0f7746af8758269e7c Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
* Rename builtin test data resource nameLeander Beernaert2019-10-181-1/+1
| | | | | | | | | | Rename the builtin test data resource name to something more unique as there are name clashes when building tests which also add a resource named 'testdata'. Change-Id: Icc1bbff3134e1dbc6ea4f6a87a1715b936c723cc Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add conversion code for Java codeLeander Beernaert2019-10-186-44/+126
| | | | | | | | | | Add support to pro2cmake to convert java code for android. Add support to override API_LEVEL for the Android sdk jar file. If the sdk is not found, we'll default to the one located by QT_ANDROID_JAR. Change-Id: If0b746dc7f9148ac43e6592a4a4dd23d46bbd4cd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Pick the latest available C/C++ standard when compiling QtSimon Hausmann2019-10-173-5/+23
| | | | | | | | | | This maps the behavior of mkspecs/features/qt_common.prf and enables the use of C++17 for example in Android, where the toolchain supports it anyway. Change-Id: I41f4bdb160a3929e2fb78f36efb1ad5f2ad391a5 Reviewed-by: Qt CMake Build Bot Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix C++ standard detectionSimon Hausmann2019-10-173-17/+78
| | | | | | | | | | | We cannot use a generator expression in an if statement, it does not work. Instead, we could inspect the CMAKE_C/CXX_COMPILE_FEATURES list, but unfortunately that's not reliable. For example it detects that ICPC supports C++17 when in fact that depends on the installed libstdc++. Therefore this patch revives our own configure tests. Change-Id: Ic3bc5762fbe81837722523e3881ac16e84628519 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Re-generate affected cmake files and configure.json after the mergeSimon Hausmann2019-10-1719-119/+182
| | | | | | | | | This also removes the workarounds of commit b2662b05dd078c46b82f5f041f51b0b83554113d now that it's fixed "upstream" in the .pro files. Change-Id: Idd5e6273873a700fcda5a6cad2039c4e88b61f6f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeSimon Hausmann2019-10-17135-633/+1093
|\ | | | | | | Change-Id: Ia1da879a7bd8f71a649661a1844144dd67d60b3a
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-1799-518/+852
| |\ | | | | | | | | | Change-Id: Ica69de99be9c8af4d28a52e4b69e6af748ed983c
| | * QAbstractItemModel: implement QRegularExpression support for matchSamuel Gaist2019-10-164-17/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part of the migration of qtbase from QRexExp to QRegularExpression. [ChangeLog][QtCore][QAbstractItemModel] The match() method now supports the new Qt::RegularExpression match flag value. This will allow users to use either a string or a fully configured QRegularExpression when doing searches. In the second case, the case sensitivity flag will be ignored if passed. Task-number: QTBUG-72587 Change-Id: I07c8d72a661c48b7f4fcf13ef8e95980bcdcb998 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| | * Provide a feature for CBOR stream I/OUlf Hermann2019-10-166-2/+32
| | | | | | | | | | | | | | | | | | | | | We need to turn it off in bootstrap code. Change-Id: I826e49fbc5f6128e56f84b58d29358dd7b0b9dc5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| | * tst_qfiledialog2: Don't assume window activation is availableJohan Klokkhammer Helsing2019-10-161-15/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefer qWaitForWindowExposed over qWaitForWindowActive whenever possible, skip in the other cases. Makes the test pass on Wayland. Task-number: QTBUG-62188 Change-Id: I60b4000c72c3727a2f33b79a5038469055b0fef2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * tst_QAbstractScrollArea: Use qWaitForWindowExposed instead of activeJohan Klokkhammer Helsing2019-10-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Makes the test pass on Wayland. Task-number: QTBUG-62188 Change-Id: I53011ad623e4bdb557d79c136f06ce7ac00a08ee Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-1687-483/+709
| | |\ | | | | | | | | | | | | Change-Id: Ifd83db69416230175ddc3161f640b612755018fc
| | | * Prepare for deprecating the QDesktopWidgetSona Kurazyan2019-10-1529-65/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDesktopWidget is marked as obsolete in docs, but it is not yet completely deprecated, some of its methods are still in use. Replace uses of the following methods marked as obsolete: - QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen() - QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry() - QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry() Task-number: QTBUG-76491 Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | | * rhi: gl: Do not let external rendering trash our vaoLaszlo Agocs2019-10-152-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-79221 Change-Id: Ie8e6376f79c816071c12962dc054838aeaabcaa5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| | | * macOS: Simplify Objective-C namespacingTor Arne Vestbø2019-10-1528-117/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only need to use the QT_MANGLE_NAMESPACE macro when declaring the interface of the class. As long as we couple that with an alias declaration using QT_NAMESPACE_ALIAS_OBJC_CLASS, any further uses of the class name can be un-namespaced, including declaring categories on the class. The only snag with QT_NAMESPACE_ALIAS_OBJC_CLASS is that it can only be used once per class and translation unit, so forward declarations get hairy, but we can avoid that by just including the headers instead. Change-Id: I333bcd18fe1e18d81fbd560b0941c98b1c32460e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
| | | * Win32: Consolidate registry codeFriedemann Kleint2019-10-1417-207/+375
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a RAII class for registry keys and use it throughout the code base. Change-Id: I666b2fbb790f83436443101d6bc1e3c0525e78df Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | | * QtWidgets: Suppress QEvent::WindowActivate when minimizedFriedemann Kleint2019-10-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent call to activateWindow() for minimized windows in QWidget::setWindowState() by clearing the flag. Fixes: QTBUG-46763 Change-Id: I40389d0906438ffe251fc79f18a523ecb53edb1b Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| | | * Fix the size calculation of QHeaderView when stylesheet is usedSona Kurazyan2019-10-142-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When calculating the header section size based on its contents when a stylesheet is used, the size hints from the stylesheet are used. In case if the stylesheet specifies only one of the sizes, the other is set to -1. Because of this the actual content size is ignored. The solution is to calculate the size based on the application style, in case if it's not specified in the stylesheet. Fixes: QTBUG-75615 Change-Id: I3453fa623d75b6b32832edf753de6e3e4e7f5a22 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | | * wasm: fix arch detect on windows with WASM_OBJECT_FILESLorn Potter2019-10-141-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-79146 Change-Id: I00188013b98687f34582aeb7b29b6d7439334536 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | | * CoreText: Preserve font descriptors when resolving fallback familiesTor Arne Vestbø2019-10-142-75/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From macOS 10.15 and iOS 13 forward it's not possible to create font descriptors for system fonts such as .AppleSystemUIFont based on the family name. This means we have to preserve the font descriptors we get from CoreText for fallback fonts, so that we can populate them along with the family name. Task-number: QTBUG-78821 Task-number: QTBUG-77467 Change-Id: Ifce01da65f90afb7dc2bc3005c3c5870b9c116de Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | | * CoreText: Use StyleHint as fallback when family is not foundTor Arne Vestbø2019-10-141-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I11fb6cafe9d41c38eac6ca0695c89f30f998f257 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | | * Remove usages of deprecated APIs of QDesktopWidgetSona Kurazyan2019-10-136-13/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced the usages of the following deprecated APIs: * QDesktopWidget::screenCount() -> QGuiApplication::screens().size() * QDesktopWidget::screenGeometry(int) -> QGuiApplication::screens().at() * QDesktopWidget::screenNumber(QPoint) -> QGuiApplication::screenAt(QPoint) - Added notes for the QWidget *QDesktopWidget::screen(int), which currently has no replacement. - Fixed the tests to build conditionally, only when these APIs are enabled. Task-number: QTBUG-76491 Change-Id: I2fdec96d0a6a4fc782c53549b05a5556412b8305 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | | Fix duplicate platform plugin definitionsSimon Hausmann2019-10-163-65/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | androidplatformplugin.cpp and main.cpp both tried to define the platform plugin entry point. That happens to work with the android toolchain by chance, but it's certainly not intentional. Change-Id: Ie92281abfb2335aa3ee83bc0ba660700d3485b2d Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-167-32/+228
| |\| | | | | | | | | | | | | | Change-Id: I8348c823117dd3d594d365fc3583f7e44d44a81c
| | * | Cbor: Avoid QUrl in bootstrap codeUlf Hermann2019-10-152-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QUrl is not available when building qmake. Hopefully we can get rid of this mess in Qt 6. Change-Id: Ia234996dd4f27d7f843db227e4cf2db869c92dc1 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | tst_qgraphicseffect: Wait for exposed instead of activeJohan Klokkhammer Helsing2019-10-151-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the test pass on Wayland. Task-number: QTBUG-62188 Change-Id: I3900925e74d8d940a8c5af87ea64a6ec3c8c3293 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * | QTest: fall back to qWaitForWindowExposed in qWaitForWindowActivatedJohan Klokkhammer Helsing2019-10-141-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...if window activation isn't supported. Task-number: QTBUG-62188 Change-Id: Ia83de59d9a755d95b7150eb5261bc43dd7b60588 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * | tst_qgraphicsitem: Skip tests that fail on WaylandJohan Klokkhammer Helsing2019-10-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-62188 Change-Id: If0638d51bffa6ef375476c0a601c387bd05583ae Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| | * | tst_qgraphicsitem: Don't assume window activation is availableJohan Klokkhammer Helsing2019-10-141-25/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some windowing systems (i.e. Wayland) do not allow applications to steal window focus. Normally, we would just replace qWaitForWindowActive with qWaitForWindowExposed, because that is usually the intent, in this test however, there are many occurrences of both variants right after each other. And, as described in the commit message of 153e8b49a, this may be because window activation may cause repaints, and we want to wait for it to reduce the chance of receiving an extra repaint later (possibly causing tests to be racy). Therefore, I took the conservative approach, and kept the qWaitForWindowActive calls, except when the capability is not available. Hopefully this will not cause flakiness in existing platforms, while also allowing tests to pass on platforms where activation is not supported. Task-number: QTBUG-62188 Change-Id: I15502baa28c464a808d585a5e6d67c9b745b17ae Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| | * | Make QJsonObject::iterator a true random access iteratorLars Knoll2019-10-132-0/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends and fixes 7236721bf8bacc0978fc872d7e4805c7be7824f0 where the iterator category was changed from bidirectional to random access without adding all the required functions. Fixes: QTBUG-57353 Change-Id: I2c96448facb222c8b8f9ad4423cb0dbd1ed098f4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Fix static linking when bearer management plugins are builtSimon Hausmann2019-10-1525-52/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bearer plugins include copies of moc generated code that results in duplicate symbols when static linking pulls in multiple bearer plugins. Instead of relying on toolchain defined behavior, this patch moves the code that is shared into the shared library as private API. This way it will exist only once in memory and once at link time, resulting no linking errors about duplicate symbols. Fixes: QTBUG-79211 Change-Id: Iafa45c234e7fdd998971fc9cb7116334d08907bc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| * | | pass QSqlDatabase by const &Albert Astals Cid2019-10-156-13/+13
| | | | | | | | | | | | | | | | | | | | Change-Id: I326c09ab9313098470cb657571f67755fd7810c7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | | Fix precompile header usageAlexandru Croitor2019-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Latest CMake will try to compile the given precompiled headers as C files, due to enabling the C language in the project + also having c files. Make sure to wrap the precompiled headers in a CXX language only generator expression. For details, see https://gitlab.kitware.com/cmake/cmake/issues/19839 Change-Id: Ib3508ad920092455c300b1a566ba6152bab032db Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Add QT_RESOURCE_TARGET_DEPENDENCY source file propertyLeander Beernaert2019-10-151-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the plugin test in QtBase we have a scenario where we have target binaries that are inputs to add_qt_resource(). If we do not remove these files from the dependency list for add_custom_command() cmake will fail to generate the build files. If we mark them as generated source files, we'd have to add a special rule to generate them. Furthermore, using $<TARGET_FILE:...> does not work due processing done by add_qt_resource. To bypass this we check whether the property is set and instead of adding the file to the dependency list we add the target referenced in that property. RCC will still work as expected but will fail if the files aren't present. Change-Id: I16855a54f5606d6fe27ab1347ed7ff4f40392c98 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Fix output property for add_cmake_library()Leander Beernaert2019-10-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | OUTPUT_DIRECTORY by itself is not a valid cmake target property. Change-Id: Ic3a2a81b8b982ad7ccf0551000a157f9a4d3ef22 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | Fix message about missing portalockerOliver Wolff2019-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ia82c0aab7c9085eee8a07c4a15485c0804e65e5a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | | Fix developer build with -WerrorSimon Hausmann2019-10-154-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The group parameter is only used when cross-compiling, mark it as unused otherwise. This is noticeable in the cmake branch because there we build qmake with cmake and apply the same warning flags, as opposed to the bootstrapped qmake build when using ... qmake. The cache file parameter in qmake is unused and the mustEnsureWritability is only used on Windows. Change-Id: I08655d5150f5a967c2340ee7678bad3a4d69914f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | | Fix add_qt_resource condition scopesLeander Beernaert2019-10-151-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to add_qt_resource from extend_target were not being wrapped in a condition scope. Change-Id: I78cf889fcf4663660fd870bfb93eec90a4ca1c47 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | Remove compatibility code for old call sites of qlalr processingSimon Hausmann2019-10-151-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I48801c336f7546b9366c70d877d20222c16dd4ff Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | Fix build of qmakeAlexandru Croitor2019-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was missing a source file for the QByteArrayList_join symbol. Change-Id: Ifcfd68d216f1e5370f90d7131bb3f7c9f91f07f3 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>