Otherwise we get generation errors due to calling GENEX_EVAL on
something that is an invalid target.
Perhaps there will be a better way once
https://gitlab.kitware.com/cmake/cmake/issues/20287 is fixed.
Change-Id: I6af9511cbb9942b9edbc3b3fc7028936308715d8
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This is needed for qtdeclarative examples, otherwise CMake configuration
fails due to missing QML import version info.
Change-Id: Iedde7b6a9e2d5ac7f6d81969ac7d6d874361c02e
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Due to generator expression it is impossible to recursively evaluate the
link dependencies of a target. This is required by QtDeclarative's
qmltyperegistrar.
To overcome this we generate a ${target}_metatypes_dep.txt file which
contain lines with the following pattern:
${PATH_TO_METATYPES.json}=${PATH_TO_METATYPES_DEP.txt}
This can be used to recursively evaluate the dependencies at run time.
Change-Id: Ia4cee0632c16ba9631e0289db906fe9d320844a3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
Rather than pass the build type in the wrapper, make sure the build
type is a cache var, so it gets picked up when building other repos.
This reverts commit f72ca4cf85.
Change-Id: I5d91ab66249b6c40c5e548b0eec0e467ba0f2ebc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Do not return when no qmldir file is present and no dynamic qmldir
information is set.
Change-Id: I04e458f69e4e4a6ec9b1e7ca7ba0b0f7520996f7
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
For every executable that uses a static Qt library (e.g. rcc using
libQt5Bootstrap.a) we got a warning: 'direct access in function...to
global weak symbol'.
This was because we've built all libraries with -fvisibility=hidden
-fvisibility-inlines-hidden but not the executables linking against
them. On macOS however, all translation units must have the same
visibility setting.
We're now setting the same visibilty for libs and executables on
darwin.
Fixes: QTBUG-81297
Change-Id: I2668e9385caa7f0ce78bf3727b4e5322bc4a294f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When a new model is set, a valid index is selected. When a model is
reset, this is not the case which is slightly inconsistent. Fix it by
using the same logic to find a valid index when the model is reset
Fixes: QTBUG-80998
Change-Id: I6c167511e199a6664343cf1dc3bcd27c65389bfd
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Deprecate the overloaded signals
buttonClicked/buttonPressed/buttonReleased/buttonToggled taking an int
to avoid to need to use QOverload<> when connecting the signal. The id
of a button in a button group can be easily fetched with
QButtonGroup::id().
Task-number: QTBUG-80906
Change-Id: Idaaab54bbcb25cba543fc99f305b9f4743ee3ed8
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
If the OUTPUT_NAME of a plugin is the same as the CMake target name,
don't try to create a custom target with the same name. That will
cause configuration errors due to duplicate targets.
Amends f67d8ae2d4
Change-Id: Iaea7c68e22dbc1e345ba10950c312618abba4c21
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
InheritPriority may not be set, but the warning only occurs on Windows.
Move the warning to the public class.
Change-Id: I51d401300f840e4c1396c2c30182e49ed45d60d2
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Some desktops do not run dbus session and still want to build qt.
Change-Id: I898a3c25c9b47c1a953e426873280ab9e160c669
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
And also to get the original output names (qmake's "TARGET"), so that
the plugin file names are as they were in Qt 5.
Change-Id: I96a060d1a81693652847857372bec334728cb549
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In Qt 5, qmake generates CMake Config files which expose the plugins
as imported libraries. The name of these libraries are derived from
the plugin class name. So QCocoaIntegrationPlugin, and not qcocoa.
To keep compatibility between Qt5 and Qt6 CMake target names,
the pro2cmake script should generate plugin target names based on the
plugin class names.
To avoid passing the same name in qt_add_plugin (target and CLASS_NAME),
derive the class name from the target if the class name is
not explicitly specified.
Also add a new OUTPUT_NAME parameter which is used to change the
final file name of the plugin, so that it's compatible with Qt5.
For example to generate a qcocoa.dylib file, instead of
QCocoaIntegrationPlugin.dylib file.
The same OUTPUT_NAME value will be used for generation of plugin .prl
files for qmake consumption.
Change-Id: I4d53e680d7beb62befecd359cdf6bba60a34ff0d
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This allows doing debug_and_release builds with Ninja on all
platforms.
The "Ninja Multi-Config generator" is available starting with CMake
3.17.
Desired configurations can be set via CMAKE_CONFIGURATION_TYPES.
Possible values: "Release, Debug, RelWithDebInfo, MinRelSize".
For example -DCMAKE_CONFIGURATION_TYPES="Release;Debug".
The first configuration is the 'default' configuration which is
built when calling ninja with no arguments.
To build all targets of a certain configuration use "ninja all:Release"
or "ninja all:Debug".
To build all targets in all configurations use "ninja all:all".
Note that the first configuration influences which configuration of
tools will be used when building the libraries for all configurations.
In simple terms, when configured with
-DCMAKE_CONFIGURATION_TYPES="Release;Debug" the release version of moc
is used by AUTOMOC.
When configured with -DCMAKE_CONFIGURATION_TYPES="Debug;Release"
the debug version of moc is used by AUTOMOC.
Framework builds and Ninja Multi-Config don't currently work together
due to multiple bugs in CMake, which ends up generating an invalid ninja
file with duplicate rules. There are also issues with placement of the
debug artifacts.
This will be handled in a follow up patch after CMake is fixed.
Task-number: QTBUG-76899
Change-Id: If224adc0b71b7d1d6606738101536146aa866cd7
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Add the Qt-specific properites to the list.
Fixes: QTBUG-37938
Change-Id: I178de6cd5e17cd282a20ccee9ce8355f540c38a1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
I missed copying over the documentation from QMap::unite when
deprecating it.
Amends 4ec6748c6a
Change-Id: I118382c4645bdc679a378e02a462d104b9af9aad
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Replace some 'is 0' or 'are 0' where 0 referes to a nullptr with 'is
\nullptr' and 'are \nullptr'
Change-Id: Ic18d0c8bcf64159b4c8fae8c9499839954a98884
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Replace some 'is 0' or 'are 0' where 0 referes to a nullptr with 'is
\nullptr' and 'are \nullptr'
Change-Id: Ida9af2971924377efe2f49f435d79e109de2bdf4
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Use the new signal/slot syntax in the snippets where possible. Also
change some 0 to nullptr.
Change-Id: Ie3da2721d3cec33704f73f4d39c06a767717b095
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Replace some 'is 0' or 'are 0' where 0 referes to a nullptr with 'is
\nullptr' and 'are \nullptr'
Change-Id: I5ff46185b570bdfc7d20d18a47fd9174771ad8e5
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
If available, use a C++17 std::pmr::unordered_set with a monotonic
buffer resource and a 256-byte stack buffer to avoid the per-element
allocations of QSet.
Results on my machine:
RESULT : tst_QStringList::removeDuplicates():"empty":
- 0.00014 msecs per iteration (total: 74, iterations: 524288)
+ 0.000031 msecs per iteration (total: 66, iterations: 2097152)
RESULT : tst_QStringList::removeDuplicates():"short-dup-0.00":
- 0.00043 msecs per iteration (total: 57, iterations: 131072)
+ 0.00013 msecs per iteration (total: 69, iterations: 524288)
RESULT : tst_QStringList::removeDuplicates():"short-dup-0.50":
- 0.00049 msecs per iteration (total: 65, iterations: 131072)
+ 0.00032 msecs per iteration (total: 85, iterations: 262144)
RESULT : tst_QStringList::removeDuplicates():"short-dup-0.66":
- 0.00057 msecs per iteration (total: 75, iterations: 131072)
+ 0.00039 msecs per iteration (total: 52, iterations: 131072)
RESULT : tst_QStringList::removeDuplicates():"short-dup-0.75":
- 0.00064 msecs per iteration (total: 85, iterations: 131072)
+ 0.00048 msecs per iteration (total: 63, iterations: 131072)
RESULT : tst_QStringList::removeDuplicates():"long-dup-0.00":
- 0.083 msecs per iteration (total: 85, iterations: 1024)
+ 0.039 msecs per iteration (total: 80, iterations: 2048)
RESULT : tst_QStringList::removeDuplicates():"long-dup-0.50":
- 0.11 msecs per iteration (total: 58, iterations: 512)
+ 0.078 msecs per iteration (total: 80, iterations: 1024)
RESULT : tst_QStringList::removeDuplicates():"long-dup-0.66":
- 0.13 msecs per iteration (total: 70, iterations: 512)
+ 0.10 msecs per iteration (total: 53, iterations: 512)
RESULT : tst_QStringList::removeDuplicates():"long-dup-0.75":
- 0.16 msecs per iteration (total: 86, iterations: 512)
+ 0.13 msecs per iteration (total: 69, iterations: 512)
When interpreting the data, take into account that each iteration
contains _also_ a deep copy of the QStringList d/t the detach from
'input'.
The pattern is used elsewhere in Qt, so I've put the class that
implements the seen set into a private header file and used in some
other places I found.
Change-Id: I1f71a82008a16d5a3818f91f290ade21d837805e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
I showed QGestureManager to a colleage and I just couldn't avert my
eyes...
Also remove a pointless container::clear() call (the data member's
dtor will do that implicitly).
Change-Id: Id2b3f471d62e5ea416e875f28ecee73f8614a469
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Provide a simple palette for dark mode, implementing
dark mode support level 2.
Task-number: QTBUG-72028
Change-Id: I6f71870b251ccb7da30c01abb22c224e600f2b27
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Implement dark mode support level 1: change the
window borders to dark and back, tracking the
activation of dark mode.
Task-number: QTBUG-72028
Change-Id: I6e8b31e7ee574f4d90438405f361cd940faee7fd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Read the dark mode setting and make it accessible
via native interface.
Add a command line option to set the support level.
Task-number: QTBUG-72028
Change-Id: I1e9fe296a6b1bda81512d003183038b866b67545
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Use a standard prefix for Window class names containing
version, build and namespace which should reduce conflicts.
Task-number: QTBUG-81347
Change-Id: Ia7c20af71d364e362781f791a4e51b77d605c918
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The previous versions of these functions that returned by-pointer are
held over from Qt 1 times. They are inconsistent with the rest of the
Qt API.
[ChangeLog][QtGui][QCursor] QCursor::bitmap() and QCursor::mask()
can now return by-value instead of by-pointer.
Task-number: QTBUG-48701
Change-Id: I3ca4f0c28d5c831727a60309facfb49c74673bb7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The previous versions of these functions that returned by-pointer are
held over from Qt 1 times. They are inconsistent with the rest of the
Qt API.
[ChangeLog][QtWidgets][QLabel] QLabel::pixmap() and QLabel::picture()
can now return by-value instead of by-pointer.
Task-number: QTBUG-48701
Change-Id: I23ce319a7b1f757e1f4dec697551bb472e92fabf
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Create Qt:: versionless targets for libraries and tools. So
Qt::Core will link to Qt5::Core.
Add additional feature properties to targets, with the same name
they have in Qt6: QT_ENABLED_PUBLIC_FEATURES,
QT_DISABLED_PUBLIC_FEATURES, QT_ENABLED_PRIVATE_FEATURES,
QT_DISABLED_PRIVATE_FEATURES, to be forward-compatible with Qt6.
Prefix properties with INTERFACE_ for interface libraries.
Create functions with no major version in their prefix, so qt_foo
instead of qt5_foo.
The non-versioned functions will call the versioned functions,
depending on the value of QT_DEFAULT_MAJOR_VERSION, which can be
set by an application developer before finding the Qt package.
Set QT_DEFAULT_MAJOR_VERSION to 5 if the value has not been defined
in the current scope.
Application developers can set QT_NO_CREATE_VERSIONLESS_FUNCTIONS to
TRUE before calling find_package(Qt5) to suppress creation of the
non-versioned functions.
Application developers can set QT_NO_CREATE_VERSIONLESS_TARGETS to
TRUE before calling find_package(Qt5) to suppress creation of the
non-versioned targets.
Setting these can be useful when both find_package(Qt5) and
find_package(Qt6) are in the same project.
If none of these are set by the user, then the first find_package(Qt5)
will create versionless targets with the major version being "5",
which means the second find_package(Qt6) will not create versionless
targets.
Handle versionless plugin names in qt_import_plugins, so both
Qt::QCocoaIntegrationPlugin and Qt5/6::QCocoaIntegrationPlugin
are recognized by the function.
Allow specifying multiple types in EXCLUDE_BY_TYPE in
qt_import_plugins, to be consitent with the Qt 6 version.
Make sure to set the QT_PLUGIN_CLASS_NAME property to compatible with
Qt 6.
Task-number: QTBUG-74137
Task-number: QTBUG-80477
Change-Id: Ib89d090ea6f7794d7debd64f03f29da963a17ca7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>