Commit Graph

50707 Commits

Author SHA1 Message Date
Alexey Edelev
fec5b8e81c Rework the failure macros in the Qt CTest kit
The _qt_internal_test_expect_fail macro fails when the test fails
during the configuration step. Rename this macro to
_qt_internal_test_expect_build_fail and add
the _qt_internal_test_expect_fail macro that expects inverted test
result.

Change-Id: I4635e99152f7a32f5c48202e84fec59800453d34
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 13:34:39 +01:00
Fabian Kosmale
2534854257 Merge "tst_qguimetatype: Avoid deprecated methods" 2021-03-17 11:56:37 +00:00
Robert Löhning
35ca446e3b Merge "Fix compiler warnings in 32-bit builds" 2021-03-17 11:52:42 +00:00
Joerg Bornemann
a423c0d211 Merge "Fix installation of Find*.cmake files in shadow per-repo builds" 2021-03-17 10:39:14 +00:00
Kai Köhne
8dac535a87 Merge "MSVC: Build harfbuzz with -Zc:__cplusplus -permissive-" 2021-03-17 10:12:10 +00:00
Fabian Kosmale
a7f24218e3 tst_qguimetatype: Avoid deprecated methods
This makes the 5.15 and 6.x branches more comparable, as in 6.0 the
preferred way is to use the non-static methods (which avoids an
expensive lookup in 6.x).
As a drive-by, Avoid memory leaks if the test fails.

Pick-to: 6.0 6.1 5.15
Change-Id: I95b133342a4ea19dd23c235a408f38089706412b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-17 10:19:10 +01:00
Robert Löhning
bc5fecf948 Fix compiler warnings in 32-bit builds
comparison of integers of different signs: 'unsigned int'
and 'qsizetype' (aka 'int') [-Wsign-compare]

Pick-to: 6.1
Change-Id: Ia27f79ab4abca8b757b65ef5f1d30151842088fe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-17 09:12:05 +00:00
Thiago Macieira
f7c292a713 Merge "Remove unnecessary int() casting in QRandomGenerator::bounded" 2021-03-17 08:55:00 +00:00
Joerg Bornemann
232c70ecc8 Fix installation of Find*.cmake files in shadow per-repo builds
In shadow per-repo builds we never hit the code that is supposed to
install cmake/Find*.cmake files. This caused problems when statically
building a Qt repo like qtshadertools against qtimageformats which
provides such Find*.cmake files.

Fixes: QTBUG-91538
Change-Id: I1147daee817ac71303d93e8bf368b2769afb0bb4
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 09:05:19 +01:00
Joerg Bornemann
e6cee41c53 Error out on attempt to configure framework build with lib infix
Setting a lib infix is not supported with framework builds due to the
nature framework of include resolution: includes like <QtCore/qstring.h>
won't work if the framework is named QtCoreInfix.

The combination framework build and lib infix was agreed on to be out of
scope in the comments of QTBUG-35604.

Pick-to: 6.1
Change-Id: Ib7c6983f2f64ea1a7cfcd56657d31eeab3f55fe3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-17 09:04:57 +01:00
Joerg Bornemann
7b4507d0be Fix qmake user projects for QT_LIBINFIX builds on Windows/iOS
QMake user projects could not be built on Windows or iOS if Qt was
configured with QT_LIBINFIX set. The code that generates
qt_lib_entrypoint_private.pri file did not take into account the lib
infix.

Pick-to: 6.1 6.0
Fixes: QTBUG-91511
Change-Id: Ibc40548a269238320f8f89a710d10e7f639246cb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 09:04:56 +01:00
Kai Köhne
78fee50e53 MSVC: Build harfbuzz with -Zc:__cplusplus -permissive-
harfbuzz includes QtCore/qatomic.h. But the Qt headers are expected
to be compiled with -Zc:__cplusplus.

Change-Id: I28847844e9a00f2b7c84f0d5d7d3257eb22e2e8e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-17 07:59:35 +00:00
Thiago Macieira
ae9e433753 Remove unnecessary int() casting in QRandomGenerator::bounded
Commit 21d3916817 added the 64-bit
version, so qsizetype now works cross-platform. The casts were added to
make qtbase compile on commit df853fed66.

Change-Id: I26b8286f61534f88b649fffd166c409c5c232230
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-17 06:21:52 +00:00
Niclas Rosenvik
3c93f7dd4f Fix configure build due to use of qt_set01 in configure.cmake
The change "Enable X11 on other platforms than just Linux"
uses qt_set01 in a configure.cmake file but does not add it
to the stubs list in QtProcessConfigureArgs.cmake thus
breaking builds based on configure.
Add a defstub with qt_set01 to fix this.

Change-Id: Ia3e0ec61df5228f88f77f631968f6f96d567ec8e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-17 07:14:41 +01:00
Assam Boudjelthia
d6367aca86 CMake: make sure to collect Android dependencies for plugins
androiddeployqt relies on *-android-dependencies.xml files to know
what dependencies like jar files and permissions a Qt module requires.
CMake create those files under Qt prefix's lib dir but CMake was not
accounting for module plugins.

Fixes: QTBUG-90812
Pick-to: 6.1 6.0
Change-Id: Ib3b2e2bb237159b4851ac0f23dc75f8e56af3f7a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 01:02:21 +02:00
Oliver Eftevaag
57f752b30a Add nullptr check
Adding a nullptr check before dereferencing in case q is null.

Pick-to: 6.0 6.1
Change-Id: Ia440e2ed41cbaf06a5919930c2e1615bb3916ff3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-16 18:44:17 +01:00
Sona Kurazyan
2eec7db03d Merge "Mention QPromise in the QFuture docs" 2021-03-16 17:03:59 +00:00
Niclas Rosenvik
a03d0ba208 Merge "Enable X11 on other platforms than just Linux" 2021-03-16 15:54:26 +00:00
Morten Johan Sørvig
c48a5b2458 Merge "Round physical dpi when calculating scale factor" 2021-03-16 15:24:31 +00:00
Topi Reinio
bddad0079f Merge "Doc: Fix various documentation issues" 2021-03-16 15:03:27 +00:00
Sona Kurazyan
0477f6b15a Mention QPromise in the QFuture docs
Pick-to: 6.1 6.0
Change-Id: I5f6930116da534dd1dea41c4724c42104de38877
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-16 15:40:52 +01:00
Edward Welbourne
d0bf7f471b Merge "Use QFile directly instead of via QTextStream" 2021-03-16 13:12:40 +00:00
Niclas Rosenvik
05e4c8f2e9 Enable X11 on other platforms than just Linux
Set CMake variable X11_SUPPORTED for all systems that have X11.
Adjust _adjust_library_map() in util/cmake/helper.py to apply X11_SUPPORTED
condition around X11 related packages instead of just LINUX.
Adjust configure.cmake in src/gui based on this change.
Why, because X11 is not just Linux.

Change-Id: Ic3c04eaa55301d1237c7e74281eccd4f8e27e9ce
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-16 13:05:17 +00:00
Topi Reinio
00e10f62b5 Doc: Fix various documentation issues
- Document QIODeviceBase
- Document QPointerEvent::points
- Fix linking issues

Task-number: QTBUG-90662
Change-Id: Ib123d5708953b22e01f95c82626b39a49fff95b2
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-03-16 13:17:39 +01:00
Morten Johan Sørvig
ad10fd2a6f Round physical dpi when calculating scale factor
(For the QT_USE_PHYSICAL_DPI use case)

The physical DPI is nominally computed from the physical
screen size, however when QT_USE_PHYSICAL_DPI is set
that size has typically been overridden with a fake
size by the user, such that the resulting DPI calculation
will yield some specific integer DPI.

Round this DPI value in order to arrive at a nice scale
factor, e.g. 144/96 = 1.5 instead of 144.01/96 = 1.5001

Change-Id: I665394e98a818b3a8f46408f3193cac4411f458d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-16 13:11:06 +01:00
Laszlo Agocs
0bd705d91b Merge "rhi: metal: Remove most availability guards" 2021-03-16 11:00:36 +00:00
Edward Welbourne
eefaf54d9e Use QFile directly instead of via QTextStream
Follows up on a TODO comment that says QTextStream is less efficient.
In any case, QFile has readLine() returning QByteArray, without
conversion to QString, and the parsing is uncomplicated.

Change-Id: I06e563df417692d3b6514a52a313a0ff55b0b52e
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-16 11:50:51 +01:00
Edward Welbourne
17bf553b76 Include minus sign in ImhFormattedNumbersOnly's available keys
UIKeyboardTypeDecimalPad only provides digits and decimal point, no
minus sign, but ImhFormattedNumbersOnly is documented to provide a
minus sign as well. UIKeyboardTypeNumbersAndPunctuation includes
punctuation, which should cover signs as well as decimal separator, so
use that - same as for ImhPreferNumbers. A little more permissive than
we want here, but that's better than more restrictive !

Fixes: QTBUG-91455
Pick-to: 6.1 6.0 5.15
Change-Id: I0418946014e0a66d503e61704154fd7798a0b785
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-16 11:50:24 +01:00
Tasuku Suzuki
0b06e55aae Merge "Fix a typo in resources_functions.prf" 2021-03-16 10:13:14 +00:00
Eirik Aavitsland
57dd386d42 Merge "Minor robustness improvement of text code" 2021-03-16 10:00:14 +00:00
Laszlo Agocs
a668bc29bb rhi: metal: Remove most availability guards
Once the deployment target is bumped to 13.0, most guards
can be removed.

Pick-to: 6.1
Change-Id: I7566a4f2915ada9defa1a4bcee10f75021222b30
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-16 09:52:59 +01:00
Tasuku Suzuki
e0f11022f1 Fix a typo in resources_functions.prf
Change-Id: I38b81ba63612bd90b0a70f6b0c468667581b3c11
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-16 17:14:21 +09:00
Eirik Aavitsland
9fa181446c Minor robustness improvement of text code
Fix a potential issue reported by static analysis

Change-Id: I41b8eaa3c0840eec054e880c4f3298ee32685b46
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2021-03-16 08:47:57 +01:00
Eskil Abrahamsen Blomfeldt
6b82a3287f Fix tst_QPushButton tests on Wayland
The tst_QPushButton::sizeHint() test was leaking top level
windows and confusing the other tests, as they may end up
becoming active.

This also re-enables tst_QPushButton::setAccel() since I
cannot reproduce the failure with that, so maybe that was
related to the leaking widgets.

Task-number: QTBUG-91418
Change-Id: I33f4a12bf67f784c5d6a06b2407d067e804d766f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-16 08:08:49 +01:00
Eskil Abrahamsen Blomfeldt
75c1038311 Skip tst_QDockWidget::restoreDockWidget on Wayland
There is something wrong with dock widget positioning on Wayland.
In the interest of getting tests running at all, we skip the
test for now, like we already do with a few others.

Task-number: QTBUG-91418
Task-number: QTBUG-91483
Change-Id: I44f5fa0e4d0a43a46ce24a61a899bfcc03787f28
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-16 08:08:43 +01:00
Morten Johan Sørvig
68e69588e0 Merge "Add auto-test for QT_USE_PHYSICAL_DPI" 2021-03-15 15:54:49 +00:00
Volker Hilsheimer
8962fed044 Merge "Port from QScopedPointer to std::unique_ptr" 2021-03-15 14:50:32 +00:00
Zhang Hao
42b0052d97 Merge "Code tidies" 2021-03-15 12:54:05 +00:00
Martin Storsjö
00ee99ac58 Merge "qtpaths: Fix cross compilation for windows" 2021-03-15 11:07:19 +00:00
Morten Johan Sørvig
f9f9004b40 Add auto-test for QT_USE_PHYSICAL_DPI
Test that setting QT_USE_PHYSICAL_DPI uses physical
DPI instead of logical DPI.

Change-Id: I7f89cf1af5e013454cc3d8ec3559f2719514fea3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-15 11:49:59 +01:00
Morten Johan Sørvig
f0bf7667a9 Auto-test some high-dpi env variables
Add auto-tests for QT_SCALE_FACTOR and QT_SCREEN_SCALE_FACTORS

Change-Id: I57bffa266be910f2ba26cb1a870e09ae202fcae0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-15 11:49:56 +01:00
Morten Johan Sørvig
657284acbc Don’t store screen scale factors in GLOBAL_STATIC
Use a normal static variable, like the other high-dpi
variables.

Clear the stored factors in initHighDpiScaling(). This
makes auto-testing possible where the application object
is recreated for each test case and should start with
a clean slate.

Change-Id: I1831c856b5d7a2c522e62c7ed0657da771c3144f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-15 11:49:52 +01:00
Morten Johan Sørvig
4d1f13f354 Read high-dpi env. variables in initHighDpiScaling()
Move all environment access to initHighDpiScaling(),
which makes it so that all environment access happens
at one point in time during QGuiApplication construction.

Replace the “qt.scaling” logging category with “qt.highdpi”,
and log each recognized env. variable. Further logging
of DPI and computed scale factors will be introduced
later on.

This also enables auto-testing of the environment variable
settings, since the auto-test can now control when the
environment is read by (re-)creating the application
object.

Change-Id: I4e62a9c0050438357a58ace5b50fb7c5950c87ce
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-15 11:49:48 +01:00
Volker Hilsheimer
45b7af038f Port from QScopedPointer to std::unique_ptr
Silence compiler warnings from deprecated QScopedPointer::swap after
fe9d7bf759.

For Qt 7, both QSslCipher and QNetworkAddressEntry should be made into
implicitly shared classes.

Change-Id: Idfd5ec4b5a0f156f212d57684822a3cd1d88de1a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-15 11:35:43 +01:00
Eskil Abrahamsen Blomfeldt
a5573cfbd5 Merge "Fix tsts_QShortcut::keys on Wayland" 2021-03-15 09:57:01 +00:00
Zhang Hao
a59ab30122 Code tidies
Delete the conditional judgment that must be established

Change-Id: I3bd94ca7b3862ab7c46370d98bf7e6cf8c040853
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-15 17:26:37 +08:00
Martin Storsjö
1ac2e85025 qtpaths: Fix cross compilation for windows
The cmake target may not be named "qtpaths", but one should be using
${target_name} instead. If cross compiling, and
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING isn't set, the tool won't be built
at all and there's no such target to set properties on, and if it
isn't set, the target name is something else.

Change-Id: I3d904036106b38df6e56ad35d400cf9a0bb1cbdf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-15 10:30:18 +02:00
Eskil Abrahamsen Blomfeldt
fe54c879cc Fix tsts_QShortcut::keys on Wayland
Wayland doesn't support explicit window activation, so the
qWaitForWindowActive() function won't actually wait for the
window to be active.

On platforms like this, we just QTRY_VERIFY() for the window
activation instead.

Task-number: QTBUG-91418
Change-Id: I5f728e6a6bcaac283c026b60e6378b9d5aaf1be5
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-15 08:21:40 +01:00
Eskil Abrahamsen Blomfeldt
2bf9061760 Skip tst_qwindow test when running on Wayland
The tst_qwindow test failed with a warning that programmatically
moving the mouse cursor is not possible with Wayland.

Task-number: QTBUG-91418
Change-Id: I02ceb2af43fbc83a4e6ae09718315f5f79ff8285
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-15 08:17:41 +01:00
Eskil Abrahamsen Blomfeldt
5552d3d446 Fix tst_qwidget_window::mouseMoveWithPopup on Wayland
The test assumed that a window was registered as the active
one immediately when it was exposed. This created a race
condition on Wayland, where we would often get the wrong
active window when simulating the events.

Task-number: QTBUG-91418
Change-Id: Ie41fe5adb339bbb43d5ee5db400a198e479de386
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-15 08:17:34 +01:00