This is a manual test of QWindow::requestActivate() and how it
interacts with implicit activation from the window system. Written in
order to test QtWayland, but hopefully also useful for testing on other
platforms.
Task-number: QTBUG-91542
Change-Id: Id18dc6d146d213a7c730cff343d9fc25f6c42514
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
To make it a little cleaner
Task-number: QTBUG-91023
Change-Id: Ib99cc722b47835d13707beeeea35573729e4b032
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QT_VERSION is now at least QT_VERSION_CHECK(6, 3, 0), so remove all
checks against Qt 6.0.0 or earlier. They are superfluous. Tidied up in
some places in the process, particularly #include order.
Change-Id: I2636b2fd13be5b976f5b043ef2f8cddc038a72a4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Needed for subsequent change that will check and error out if the
version is lower than 3.16. We do that to ensure all policies
introduced by CMake up to version 3.16 have their behavior set to
NEW.
Pick-to: 6.2
Task-number: QTBUG-95018
Change-Id: Ieaf82c10987dd797d86a3fd4a986a67e72de486a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Having logging in the test's log widget is nice, but we don't want
to silence the normal logging, as that might confuse someone who
expects to see normal log messages, not knowing there's a dedicated
log widget in the test.
Pick-to: 6.2
Change-Id: I7828f740cfb8cc2eae8da98b9b8facd4a57fa37b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This amends 9a4c98e556.
Change-Id: Ief86d141efa8f87d624c6ba935cb4d9c0b2ead0f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
More information about monitor in xrandr 1.5, see
https://keithp.com/blogs/MST-monitors/
Since this change, screen is logical instead of physical.
If xrandr 1.5 and later is installed, Qt screen info will get
from xrandr monitor object instead of xrandr output if only have
1.2 to 1.4.
Users can manipulate monitor as they want, for example, a
combination for two physical screens, half of one screen and etc.
Didn't have chance to access MST monitors, but it should work
if xrandr monitor object was created automatically.
[ChangeLog][xcb] Qt screen info will get from xrandr monitor
object if 1.5 is installed.
Fixes: QTBUG-65457
Change-Id: Iad339cc0d4293b2403b4ef6bf6eb770feb3e685f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Add minimal examples which demonstrates how exec() works
on Qt for WebAssembly and how to implement main() without
calling QApplication::exec().
Change-Id: I44f1d16af19c538380cc56faf3f0f4cc9d66cf11
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The tests can now be built with qt-cmake-standalone-test.
Change-Id: I098340a9f755806061de281fbc25cb00c61f33f0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
For mobile platforms. Makes it quite a bit easier to follow on the
updates when I'm not tethered to my PC with ADB.
Change-Id: Icba03470e6082b6e47e31c9ead6df074407d3172
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Make it return bool since the TriState was really only used signify that
the property was unsupported but there is already a separate way to
check if it's supported. More importantly there is no different set of
actions available to a user if they're in the Unknown or False state.
Because of the change to bool, we also rename the property to have an
'is'-prefix.
Change-Id: Iaaaad5ac31e663c36e00223bf5b0e719f412fc69
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This patch adds the API, with no supporting backends
Task-number: QTBUG-93848
Change-Id: I50454717f928819e1b990df91872675e842f9987
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Supported on OpenGL (and ES) 3.0+ and everywhere else.
Can also be a render target, targeting a single slice at a time.
Can be mipmapped, cannot be multisample.
Reading back a given slice from a 3D texture is left as a future
exercise, for now it is documented to be not supported.
Upload is going to be limited to one slice in one upload entry,
just like we specify one face or one miplevel for cubemap and
mipmapped textures.
This also involves some welcome hardening of how texture subresources
are described internally: as we no longer can count on a layer index
between 0..5 (as is the case with cubemaps), simply arrays with
MAX_LAYER==6 are no longer sufficient. Switch to sufficiently dynamic
data structures where applicable.
On Vulkan rendering to a slice needs Vulkan 1.1 (and 1.1 enabled on the
VkInstance).
Task-number: QTBUG-89703
Change-Id: Ide6c20124ec9201d94ffc339dd479cd1ece777b0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The BASE argument of qt_add_resources now denotes the root point of the
alias of the file. Before, BASE was merely prepended to every file that
got passed to qt_add_resources.
Old behavior:
qt_add_resources(app "images"
PREFIX "/"
BASE "../shared"
FILES "images/button.png")
Alias is "../shared/images/button.png", and pro2cmake generated
QT_RESOURCE_ALIAS assignments to fix this.
New behavior:
qt_add_resources(app "images"
PREFIX "/"
BASE "../shared"
FILES "../shared/images/button.png")
The alias is "images/button.png". No extra QT_RESOURCE_ALIAS assignment
is needed.
The new behavior is in effect for user projects and for Qt repositories
that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE. Qt repositories will be
ported one by one to this new behavior. Then the old code path can be
removed.
Pick-to: 6.1
Task-number: QTBUG-86726
Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The initial approach for providing public access to native
interfaces via T::nativeInteface<I>() was based on the template
not being defined, and then having explicit instantiations of
the supported types in a source file, so that the accessors
were exported and available to the user.
This worked fine for "simple" types such as QOpenGLContext
and QOffscreenSurface, but presented a problem in the context
of classes with subclasses, such as Q{Core,Gui}Application.
To ensure that a native interface for QCoreApplication was
accessible both from QCoreApplication and its subclasses,
while at the same time preventing a native interface for
QGuiApplication to be accessible for QCoreApplication, the
nativeInterface() template function had to be declared in
each subclass. Which in turn meant specializing each native
interface once for each subclass it was available in.
This quickly became tedious to manage, and the requirements
for exposing a new native interface wasn't very clear with
all these template specializations and explicit instantiations
spread around.
To improve on this situation, while also squashing a few
other birds at the same time, we change the approach to
use type erasure. The definition of T::nativeInteface<I>()
is now inline, passing on the requested interface to a per
type (T, not I) helper function, with the interface type
flattened to a std::type_info.
The type_info requested by the user is then compared to the
available types in a single per-type (T) "switch statement",
which is a lot easier to follow for someone trying to trace
the logic of how a native interface is resolved.
We can safely rely on type_info being stable between the user
application and the Qt library as a result of exporting the
type info for each native interface, by explicitly ensuring
they have a key function. This is the same mechanism that
ensures we can safely dynamic_cast these interfaces, even
across library boundaries.
The use of a free standing templated helper function instead
of a member function in the type T, is to avoid shadowing issues,
and to not pollute the class namespace of T with the helper
function.
Since we are already changing the plumbing for how a user
resolves a native interface for a type T, we take the opportunity
to add a few extra safeguards to the machinery.
First, we add a static assert in the T::nativeInteface<I>()
definition, that ensures that only compatible interfaces,
as declared by the interface themselves, are allowed.
This ensures a compile time error when an incompatible
interface is requested, which improves on the link time
errors we had prior to this patch, and also offsets the
one downside of type erasure, namely that errors are only
caught at runtime.
Secondly, each interface meant for public consumption through
T::nativeInteface<I>() is declared with a revision, which
is checked when requesting the interface. This allows us
to bump the revision when we make breaking changes to the
interface that would have otherwise been binary incompatible.
Since the user will never see this interface due to the
revision check, they will not end up calling methods that
have been removed or renamed.
One advantage of moving to a type-erased approach for the
plumbing is that we're not longer exposing the native
interface types as part of the T::nativeInteface symbols.
This means that if we ever want to rename a native interface,
the only exported symbol that the user code relies on is
the type info. Renaming is then possible by just exporting
the type info for the old interface, but leaving it empty.
Since no class in Qt implements the old native interface,
the user will just get a nullptr back, similarly to bumping
the revision of an interface.
Change-Id: Ie50d8fb536aafe2836370caacb22afbcfaf1712a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
When cross compiling from a case sensitive file system, casing
matters, and mingw headers and import libraries consistently
use lowercase.
This was uncovered by d385158d5213ef568b7629e2aa4a818016bbffac;
prior to that, the schannel TLS plugin didn't end up built (at
least when cross compiling).
Fix other similar cases that can be found by grepping the repo.
Change-Id: Ia696e17b7aaa979d7b7f5b0801383f338a8b585b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
ScreenGadget visualizes virtual desktop screen layout,
in device independent and native pixels.
This can be used to debug the (sometimes surprising)
device independent screen geometry resulting from Qt
applying a scale factor.
Change-Id: I5b18e0fc9a54ba3e14d648794429b2eeadd25748
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Display active environment variables. Reorder the
labels with device independent values to the left
and native values to the right. Display the Qt scale
factor.
Change-Id: If95c252b06eff5abd91a25847777246effe94be2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The use of "Country" is misleading as some entries in the enumeration
are not countries (eg, HongKong), for all that most are. The Unicode
Consortium's Common Locale Data Repository (CLDR, from which QLocale's
data is taken) calls these territories, so introduce territory-based
names and prepare to deprecate the country-based ones in due course.
[ChangeLog][QtCore][QLocale] QLocale now has Territory as an alias for
its Country enumeration, and associated territory-based names to match
its country-named methods, to better match the usage in relevant
standards. The country-based names shall in due course be deprecated
in favor of the territory-based names.
Fixes: QTBUG-91686
Change-Id: Ia1ae1ad7323867016186fb775c9600cd5113aa42
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It turns out QTextStream on Android isn't as easily visible as it is
when going through qDebug (where it can easily be seen with
`adb logcat -v brief libqnetworkinformation_<arch>.so:* -s`)
Change-Id: I3b495d7a3d331fda6cfe602c461107dd1d0b3faf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 677797929d8080199990d741773832f80a654265)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since the old code is now fully integrated in QNetworkInformation backends
Change-Id: Ia843d17bb3c98333e8d68752e25722b5860f48e0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 7860b9e6ffece207d054ac0c321bc3c5b983708f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For Windows. Based on the code I wrote for QNetworkStatusMonitor.
It also renames the netlistmgr feature, avoiding the abbreviation.
Locally my MinGW fails the networklistmanager feature test so it may
not be supported on MinGW, likely leaving it without a backend at all.
Change-Id: I13bbe4127edc2a9c0bb91602c95f1cb206a85a69
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Add QRhi APIs to retrieve and reload the contents of the "pipeline
cache".
The only API where there is a true pipeline cache is object is Vulkan
(VkPipelineCache). For OpenGL, the other backend where we support this,
it is simulated with program binaries. The Qt 5 style OpenGL program
binary disk cache continues to work like before, but one has now the
option to do things in a more modern, graphics API agnostic way, that
leads to generating a single blob instead of a large set of files in
some system location, allowing easier "pre-baking" of the cache content.
It is expected that Qt Quick exposes the two new functions in form
if QSG_RHI_ environment variables, thus allowing easy testing and
cache file generation.
As an example for the performance improvements this can give, consider
Vulkan, where we do not have any existing persistent caching mechanism
in place:
Running BenchmarkDemoQt6.exe --scene flythrough --mode demo creates 18
QRhiGraphicsPipeline objects from Qt Quick and Qt Quick 3D.
The total time spent in QRhiGraphicsPipeline::create() during application
startup for these 18 pipelines is 35-40 ms on a given Windows (NVIDIA)
system.
When exporting the pipeline cache contents to a file, and then, in a
subsequent run, reloading the cache contents, this is reduced to 5-7 ms
on the same system, meaning we get a 6-7x improvement.
The generated data is always specific to a given Qt version, RHI
backend, graphics device, and driver version. Much of the implementation
consists of adding and verifying the appropriate header to the blobs
retrieved from the driver, to allow gracefully ignoring data that was
generated with a device or driver that differs from the one used at
run time. This should provide robustness, even if the Vulkan or OpenGL
implementation is for some reason not prepared to identity and reject
incompatible cache/program blobs.
Fixes: QTBUG-90398
Change-Id: I67b197f393562434f372c7b7377f638abab85cb3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Instead, have a static function in QRhiVulkanInitParams then Qt Quick
and anyone else who creates a QVulkanInstance that is then used in
combination with QRhi can query.
Change-Id: I046e0d84541fc00f5487a7527c97be262221527f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Those serve no purpose anymore, now that the .pro files are gone.
Task-number: QTBUG-88742
Change-Id: I39943327b8c9871785b58e9973e4e7602371793e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Just to avoid validation warnings on systems where the sampling
a D32 texture with linear filtering is not supported.
This is likely not a problem elsewhere: Qt Quick 3D for example
samples the depth texture only with Nearest filtering already.
Fixes: QTBUG-89761
Pick-to: 6.0
Change-Id: I80bf5b7ecfcb3365f4010daa17f2ef00bb206b74
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Even though there is no D3D-specific logic in the windows platform
plugin, meaning a QWindow with either OpenGLSurface or VulkanSurface
(or anything really) is DXGI/D3D-compatible, it now looks like it is
beneficial, and more future proof, if there is a dedicated surface
type.
As the linked report shows, there are OpenGL-specific workarounds
accumulated in the platform plugin, while not being clear if these
are relevant to non-OpenGL content, or if they are relevant at all
still. (and some of these can be difficult/impossible to retest and
verify in practice)
When D3D-based windows use the same surface type, all these are
active for those windows as well, while Vulkan-based windows have
their own type and so some of these old workarounds are not active
for those. To reduce confusion, having a dedicated surface type for
D3D as well allows the logic to skip the old OpenGL workarounds,
giving us (and users) a more clear overall behavior when it comes
to OpenGL vs. Vulkan vs. D3D.
The change is compatible with any existing code in other modules
because any code that uses OpenGLSurface for D3D will continue to
work, using the new type can be introduced incrementally.
Task-number: QTBUG-89715
Change-Id: Ieba86a580bf5a3636730952184dc3a3ab7669b26
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Complete search and replace of QtTest and QtTest/QtTest with QTest, as
QtTest includes the whole module. Replace all such instances with
correct header includes. See Jira task for more discussion.
Fixes: QTBUG-88831
Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The windows library user32 is no longer a known library for qmake; add
it explicitly.
Pick-to: 6.0
Change-Id: I61f44e8a2cbccbabbdc5d58bd2615b431097aafd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
QEventPoint instead of TouchPoint: we have source compatibility for that,
but we can use the new type to avoid the deprecation warnings.
Some position accessors have been renamed too.
Change-Id: I5bfe5bc853931127a883d2bd61fab122495fd427
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with
move semantics, its name is misleading. Q_RELOCATABLE_TYPE was
introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE
is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE
by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this
patch should have no impact on users.
Pick-to: 6.0
Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
It's been deprecated since Qt 4.1.
Task-number: QTBUG-85816
Change-Id: Iafc6340716556f54fc5472c60035bb57461b842f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Move the existing “kitchen sink” test out of the way,
and rename it to “kitchensink”
Change-Id: I121260e640bb2810a94f8112fcea212e97055fb3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It's no longer used; the only calls to QApplicationPrivate::desktop
pass the default nullptr for QScreen, so all we need is a Qt::Desktop
type toplevel widget.
Include changes documentation about both the class and QApplication::desktop
being gone in Qt 6.
Change-Id: I22d6e93cabc6aaaefffe5e96942886a2ef4e0609
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In order to prevent too much voodoo in backends like D3D11, the input
layout is expected to specify the slice index for vecX that are part of
an unrolled matrix.
Also deoptimize the instancing manual test to exercise a matrix too
instead of just vectors.
Change-Id: If2dcbcbc483645ce2420b2f87dda765b95da6e80
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Use QScreen APIs instead.
Change-Id: Ie99af94fe4292223dbb165b3f5c1b74e8fe0498b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>