If SKIP_INSTALL option is specified for the qt_internal_add_plugin
function the install_directory variable become empty and finalizer unable
to call qt_finalize_plugin, because of lack of the second argument. It
makes sense to use the INSTALL_PATH single argument instead.
Change-Id: I2d4b40c8cf812a834c0e045569b45a649d339508
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We deliberately expose moc to warning-worthy C++, but we don't want the
compiler warnings coming from those.
Change-Id: I09c36d7c8bfbb88f7bde61fa7bcc52a5adde81da
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
While the class name is now a bit more than a mouthful, it's purpose
is very narrowly tied to QTextDocument, so don't use a very generic
name for it. That resources are provided based on a URL is to some
degree an implementation detail, and URLs are resource locators so
we don't need that in the class name.
Address code review comment for 6.1. Add documentation and links to
existing APIs with a similar purpose.
Task-number: QTBUG-90211
Task-number: QTBUG-92208
Pick-to: 6.1
Change-Id: I4f09057cc2f53a5595513c1c9422e6ccaad6ca13
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
We avoid entering an alertable wait state there, so calling
WaitForSingleObject() instead of the ...Ex() analog would be
appropriate.
Change-Id: I7cd23805519f18b3174f66537dcf4c0da5061ca0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The rowCount method has been fixed to correctly pass the "Common error
test #3: the second column should NOT have the same children".
It also fixes the model being leaked.
Fixes: QTBUG-92178
Pick-to: 5.15
Change-Id: If92973e6f83ea9a2715bd335269f6e50d80f52c6
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
The supportedApiVersions member is new in Qt 6.1, make it const.
We can't change supportedLayers and supportedExtensions, but we can
add const overloads that call the non-const version for now. This
way, those APIs can also be called on const QVulkanInstance
instances or references.
Addresses header review comment.
Pick-to: 6.1
Change-Id: Ie99d74f62cad72990b42566e56234b9c686e86de
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Google ditched the dessert names as of Android "Q". "Q" and "R" were
development names, the released versions are called Android 10 and
Android 11, respectively.
Pick-to: 6.1
Task-number: QTBUG-90211
Change-Id: I36225067cc802ebd3ebd1289d509759ae1b2d83d
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Remove code duplication by calling qt6_add_plugin() from
qt_internal_add_plugin().
Separate out the public and internal arguments for the
variables defined in QtBuild.cmake for these functions.
Provide them via commands instead for greater robustness.
This separation allows other Qt repos to access the appropriate
set of keywords where they define commands that forward
on to *_add_plugin() in their implementations. Retain
the old variables for now to simplify the integration
steps for updating other repos. The old variables can
be removed once there are no more references left to
them in any repo.
Task-number: QTBUG-88763
Pick-to: 6.1
Change-Id: I0105523afd95995923bd20fc963d245bbb15d34d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Q_CC_GNU is defined on compilers that masquerade as GCC (Clang, ICC),
so using it to work around GCC-specific bugs is wrong. Introduce a
local define for _only_ GCC and use it in place of Q_CC_GNU.
Drive by: version-fence a test we now know it's been fixed upstream,
and correct the link to the corresponding bug report.
Pick-to: 5.15 6.0 6.1
Change-Id: I9059d6e6bf86157aca71590ac22afb1a1c114313
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It at first sight seems perverse to null-check a variable we've
repeatedly dereferenced before, without visibly setting it since;
however, its address was stored where an event handler could get at
it, to clear it if deleting the object it points to. The check against
null really is needed, but the reason is non-obvious; so document the
reason and save the next developers to come this way some confusion.
In the process, relocate a related comment that belonged one line
earlier.
Change-Id: Id67b86edc5a9a76a827d66b5c0abcd017d98a2bb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
When building and installing a Qt repo that provides plugins for a Qt
module within a different repository (for example, qtimageformats
providing imageformat plugins for QtGui), re-configuring that repository
would result in configuration errors like
"add_library cannot create ALIAS target "Qt6::QTgaPlugin" because
another target with the same name already exists."
This happened, because the find_package(Qt6 COMPONENTS Gui) calls pulled
in the Qt6*PluginConfig.cmake files that create imported targets for the
plugins we want to build.
To fix this, when building Qt, we now load only plugins that are
provided by repositories the currently building repository depends on.
We read the repo dependencies from dependencies.yaml when the
Qt6BuildInternals package is loaded, but only in static builds and only
if we're currently building a Qt repository.
To find out whether we're building a Qt repository, we check whether
QT_REPO_MODULE_VERSION is defined. We cannot check QT_BUILDING_QT,
because that variable is not available for the first find_package calls
in the repository's top-level project file.
In each Qt6*PluginConfig.cmake file, we bail out if the plugin's
repository is not one of the ones in QT_REPO_DEPENDENCIES.
Fixes: QTBUG-86670
Fixes: QTBUG-91887
Change-Id: I8f6c8398032227032742f1ca019e983ff2bcd745
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
fillRule() contained a major blunder: instead of checking if the
d-pointer was allocated, and return a default value if it wasn't,
it checked whether the path contained any points. This means that
QPainterPath p;
p.setFillRule(x);
Q_ASSERT(p.fillRule() == x);
was failing.
As a drive-by to test this change, fix another mistake in clear():
clear is documented to clear the elements in a path, but instead
it also changed the fill rule.
This commit partially reverses 697910e5fb.
Change-Id: Ieb8145694b672439c3380d9ccb87d1206a2dd115
Pick-to: 5.12 5.15 6.0 6.1
Done-with: Milian Wolff
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
We cannot replace a non-inline method with an inline one without
breaking the ABI. Instead, we now create a version with a dummy int
parameter (to avoid ODR violations), and hide the non-inline version
behind an ifdef, so that it is only visible in qmetatype.cpp.
Pick-to: 6.1
Change-Id: Ib4e82e44071bdf5c37227409a56d377ff2e07ee0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use activity window position to fix position of cursor hander. In case
without splti sceen, position of activity window is equal (0, 0), so it
does not have any effect.
Fixes: QTBUG-91362
Pick-to: 5.15
Change-Id: Icae9f19308112a78bdddf168abe81ffe7b6e4fae
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
isSoftwareKeyboard() method will rely on visibility flag from
activityDelegate. In such case it also need to consider that keyboard is
during the hiding.
Fix the regression related with commit:
e6ca200a3a
Before this change Software Keyboard is not showing after changing the
focus. It is happening when Keyboard is already visible and focus is
changed to widget that also need the keyboard. In such case keyboard is
hiding (and NOT showing again).
Pick-to: 5.15
Fixes: QTBUG-92051
Change-Id: I6a5d07b25442429fda6e715d09ea104432c5ef50
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
To correctly formulate a property binding, some rules must be
followed. So far, these rules are not documented. This patch
adds such documentation.
Task-number: QTBUG-90511
Change-Id: Ibb509ea9098212c95f03433feb1f1aac751c4b2e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Some minor formatting changes
Change-Id: I336a442d01cb048397b2a65977cfb96bb7179752
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Curly brace is supposed to go on the same line as the if.
Change-Id: I92fbd984e9ccdb06acdfe89e45c34b26a08df0cb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In the QOpenGLContext::openGLModuleType(), it will correctly judge
QT_CONFIG(opengles2), there is no need to use QT_CONFIG(opengles2) alone
in QGLXContext.
Change-Id: I012703b6a81b88fa4b8aa53cc1077c8b42d34ed5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The internal class QObjectComputedProperty and the associated
macro Q_OBJECT_COMPUTED_PROPERTY did not have any documentation
so far. This patch adds some initial documentation.
Task-number: QTBUG-90511
Change-Id: Ibd31b9c482962b1618daf04fef4256aa52d589e3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This function returns the metatype corresponding to the metaobject, or
an invalid metatype for namespaces.
This works as follows: First we increment the metaobject revision for
new metaobjects. Metaobjects with older revisions are handled by doing a
lookup by name. That fallback is also used for dynamic metaobjects (from
QtDBUS and those created by QMetaObjectBuilder).
For new metaobjects, we store the metatype in its metatype array, behind
the property metatypes. This avoids any changes to the property and
method metatype extraction logic: For properties, the metatype access
does not change, as the new metatype is after their metatypes. For
method metatypes, we already have an indirection layer (using offsets),
so by adjusting those offsets by one, the same logic keeps working.
To distinguish between namespaces and dynamic metaobjects, namespaces
store the metatypeinterface pointer for void in the metatype array,
whereas dynamic metaobjects store a nullptr.
One nice additional benefit is that this simplifies the generator logic
in moc, as the metatype array is now never empty.
Task-number: QTBUG-92077
Change-Id: Id3f920f28553f12032a71a1a87dad29e5374dbe7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Add the option argument INSTALL_VERSIONED_LINK to qt_internal_add_tool
and qt_internal_add_app. For tools/apps with this argument we create an
install rule that creates a versioned hard link. For example, for
bin/qmake we create bin/qmake6.
Note that this only applies to prefix builds.
Apply this argument to qmake.
The qt_internal_add_app change is necessary for qtdiag and in qttools.
Task-number: QTBUG-89170
Change-Id: Id32d6055544c475166f4d854aaeb6292fbb5fbb5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c19d957f45fa27f61b5ecc566f8dbc19f12a44c3)
QObjectBindableProperty has a callback, which is called whenever
the value changes. This patch adds an example showing this.
Task-number: QTBUG-90511
Change-Id: I56c0bce15af8121159630b5c0922c287c15b7618
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
XKB_KEY_Sys_Req keysym is currently unmapped to any Qt::Key.
Implication of this it is uncapable to participate in any keyboard
shortcuts.
This patch adds the missing mapping.
Detected by testXkb KWin unit test
Fixes: QTBUG-92087
Pick-to: 5.15 6.0 6.1
Change-Id: I2440c218e265c5636fc1d2703f14d8bfe033967e
Reviewed-by: Andrey Butirsky <butirsky@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
In the CI on a windows we configure Qt with the following prefix
-DCMAKE_INSTALL_PREFIX:PATH=\Users\qt\work\install
Note the lack of the drive letter.
This is intentional, so that we can abuse CMake's DESTDIR installation
mechanism to install into a custom path.
This causes trouble for static Qt builds in the CI.
Specifically when there is no qt.conf file next to qmake, qmake -query
will report a
QT_INSTALL_PREFIX:/Users/qt/work/install
and ultimately qmake will fail to locate the module .pri files in such
a path, showing errors like:
Project ERROR: Unknown module(s) in QT: core gui?
If a qt.conf is placed next to qmake (even an empty one), a differenct
code path is used in qmake to resolve the prefix, which returns a path
with a drive letter.
In a shared build, because the 'relocatable' feature is enabled by
default, a different code path is used and thus the prefix is
also successfully resolved.
So the problem is specific to static Windows Qt builds that have no
qt.conf file next to qmake.
This is the exact scenario that we encounter when running static
Qt tests (tst_qmake in particular).
To circumvent the issue, prepend a drive letter to the prefix
hardcoded into qconfig.cpp. Do that with
get_filename_component(REALPATH) which apparently resolves
to a fully qualified path.
Pick-to: 6.1
Task-number: QTBUG-87580
Change-Id: I17c885f29bfdee45bec1d6aac7c3b26723e761a3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The Core_qobject target was problematic for a few reasons.
In the very beginning, Core_qobject was an OBJECT library, explaining
its existence with the following comment "requires to spill internals
into users". The object library contained qobject.cpp and
qproperty.cpp and their manually generated moc files.
It was was a dependency of Core.
Afterwards it got converted into a static library instead, presumably
to circumvent some issues with metatype generation.
Unfortunately making it a static library was wrong, because it leads
to linker failures (undefined symbols) in a static Qt build when
trying to link a project that uses only QtCore.
Both Core and Core_qobject refer to each other's symbols, and
whichever library came first on the link line, many of its symbols
were discarded by the linker.
Transforming Core_qobject back into an object library could be an
option, but that leads to trouble with creating proper prl files
(our infrastructure doesn't quite support that for object libraries
yet).
Furthermore, there was some internal discussion and concern
about how to merge the two metatype json file lists (Core and
Core_qobject) into a single file.
Instead of using an object library, move qobject.cpp and qproperty.cpp
to be directly a part of Core again and remove the Core_qobject
target.
In order to do that, we have to circumvent some issues with
AUTOMOC.
First, we have to disable AUTOMOC for qobject.cpp and its headers.
qobject.cpp contains Q_GADGET, Q_NAMESPACE, etc keywords
in its doc comments. That confuses AUTOMOC, because it expects a
qobject.moc file which is not included by qobject.cpp.
See e2ff9e3b99 for some details
on the Q_GADGET + AUTOMOC issue.
We still need to run moc on on qobject.h and compile moc_qobject.cpp,
so we manually run moc on the header file. Because qobject.cpp
directly includes moc_qobject.cpp, we need to adjust the header
include path to the generated file.
Second, we remove the direct inclusion of moc_qnamespace.cpp
in qobject.cpp to prevent duplicate symbol compilation, because
the symbols were compiled both as part of qobject.cpp and
mocs_compilation.cpp.
Finally, because manual moc is used on qobject.h, the generated json
file needs to be explicitly passed to Core's metatype generation
step.
Amends e57a94cbd8
Amends 3c4c02b3f1
Pick-to: 6.1
Task-number: QTBUG-87580
Change-Id: I859a7d2f95508eda211a0a0b4ec132540b78bda4
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The code was added as part of
a6ccef651d
but the important bits were removed as part of
c431e2d33c
Change-Id: I6ba7bffa2bfdbeae2c92cd9ffeaa5f31771eedde
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
'qt-version', 'install-prefix', 'binaries-dir' and 'plugin-dir' are
covered by the introduced qt-query option. So make them obsolete and
hidden in the application help.
Note that the 'qtconf' option will affect the output of options
associated with QLibraryInfo.
[ChangeLog][Tools] qtpaths got new --qt-query argument that can be
used instead of qmake -query. The new --qtconf, --query-format
arguments allow you to further tweak its output.
[ChangeLog][Tools] The qt-version, install-prefix, binaries-dir
and plugin-dir options of the qtpaths tool are deprecated.
[ChangeLog][Tools] The qtpaths tool has been moved from the
qttools repository to the qtbase repository.
Fixes: QTBUG-75870
Change-Id: I949acf79c8ce321811ee81cf707c1ae0eccb547d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Introduce QProcessPoller helper class on Windows that implements
waiting for any activity from a child process.
Change-Id: I99414db4424b4342e0fa3d7a3789f85cad76d190
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
We are still using Catch2 2.11.3 which is not adapted to Apple
silicon yet. This patch backports the required change
from Catch v3.0.0-preview.3.
Change-Id: Ifa14a1fdd6cd1f661c94a0a78648cb01bd9699c1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>