Commit Graph

43881 Commits

Author SHA1 Message Date
Alexandru Croitor
a1dbdcbd6e Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
        src/corelib/Qt5CoreConfigExtras.cmake.in
        src/corelib/Qt5CoreMacros.cmake
        src/dbus/Qt5DBusConfigExtras.cmake.in
        src/widgets/Qt5WidgetsConfigExtras.cmake.in

Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
2020-01-29 16:57:27 +01:00
Leander Beernaert
67ea445f09 Append to AUTO_MOC_OPTIONS in order not override existing value
Change-Id: Id1bf607e31ee2baa5ffb6d6b4aedd98ea83e5e15
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-29 15:55:49 +00:00
Leander Beernaert
f47efdac1d Only add --automoc-json to AUTOMOC_OPTIONS for metatypes targets
Change-Id: I7c2e859a83ea78c2a6cf2ad59c175c1b29a74621
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-29 15:36:55 +00:00
Alexandru Croitor
274a61d096 Skip processing '-framework' flags in qt6_generate_meta_types_dep_file
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>
2020-01-29 15:11:58 +00:00
Alexandru Croitor
ccdc6c2dd3 pro2cmake: Fix flake and mypy issues
Change-Id: I33ab818c53f751ede7a7840b1086a3ae8263e109
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-29 14:42:03 +00:00
Alexandru Croitor
957007a949 pro2cmake: Handle QML_IMPORT_MAJOR_VERSION and minor variants
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>
2020-01-29 14:41:40 +00:00
Leander Beernaert
a6ccef651d Generate metatypes dependency file
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
2020-01-29 14:20:54 +00:00
Alexandru Croitor
34a112e383 Fix CMAKE_BUILD_TYPE to be a cache variable in QtBuildInternalsExtra
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>
2020-01-29 11:56:27 +00:00
Ville Voutilainen
3ad5d7aa55 configure: Add support for -feature and -no-feature for cmake builds
Change-Id: I160a9513da0401f1c83598691294ec48737e08a5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-29 11:35:42 +00:00
Leander Beernaert
f72ca4cf85 Forward CMAKE_BUILD_TYPE, if available, in qt-cmake
Change-Id: I299e16cfc084b3fc009e806902e26121ebdd454b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-01-29 09:39:32 +00:00
Leander Beernaert
88b7f64e73 Fix example generation without qmldir file
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>
2020-01-28 20:43:44 +00:00
Simon Hausmann
4cbadf6998 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-01-28 18:28:27 +01:00
Simon Hausmann
a4ea0d9eac Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia5727ce68001bcaab467f5fae3a4933d1217015f
2020-01-28 18:27:28 +01:00
Johan Klokkhammer Helsing
1bd60749d1 QOpenGLContext: use extraFunctions instead of versioned functions
Task-number: QTBUG-74409
Change-Id: I548cd4b683cbf67c9716d424b48fdc8b3f6a8c09
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-01-28 16:52:59 +01:00
Qt Forward Merge Bot
6c3eb39832 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-01-28 16:02:04 +01:00
Qt Forward Merge Bot
ef442327b8 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-01-28 14:17:01 +00:00
Qt Forward Merge Bot
558fc903ac Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/io/qsettings.cpp
	src/corelib/kernel/qvariant.cpp
	src/corelib/serialization/qjsoncbor.cpp
	src/corelib/serialization/qjsonvalue.cpp
	src/corelib/tools/tools.pri
	src/gui/image/qimage.cpp
	src/gui/kernel/qguivariant.cpp
	src/widgets/kernel/qshortcut.cpp
	tests/auto/tools/moc/allmocs_baseline_in.json
	tests/auto/tools/moc/tst_moc.cpp
        src/opengl/qglframebufferobject.cpp

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Leander Beernaert <leander.beernaert@qt.io>
Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
2020-01-28 14:14:20 +00:00
Vitaly Fanaskov
07a576cc61 QProcess: remove deprecated signature of finished signal
Task-number: QTBUG-80906
Change-Id: Ic9852bc5031d357d23ff6c13a65d020a4b6ea3d6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-01-28 12:34:06 +01:00
Qt Forward Merge Bot
082faeff9c Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/gui/image/qpnghandler.cpp

Change-Id: I8630f363457bb613d8fb88470a71d95d97cdb301
2020-01-28 08:09:51 +01:00
Joerg Bornemann
fcd3a20059 macOS build: Fix 'direct access in function...' warning
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>
2020-01-28 07:52:58 +01:00
Christian Ehrlicher
b0c804f345 QComboBox: unify behavior of setModel() and modelReset
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>
2020-01-28 06:24:26 +01:00
Christian Ehrlicher
fb7c9dfc06 QButtonGroup: deprecate overloaded signals
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>
2020-01-28 06:24:25 +01:00
Jarek Kobus
4bb897a384 Deprecate all methods that use QMatrix
Don't use QMatrix in implementation classes anymore.

Task-number: QTBUG-46653
Fixes: QTBUG-81627
Change-Id: I4806c1302e42645dc6a608062c8d9c336ae8629b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-28 04:12:25 +01:00
Alexandru Croitor
3c6b0a07da pro2cmake: Don't set OUTPUT_NAME for qml plugins
Amends f67d8ae2d4

Change-Id: I288a9388d4ebd354199bfa0913eff34d93a58d75
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-27 15:10:16 +00:00
Alexandru Croitor
fd590b9482 Don't create convenience plugin target when not needed
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>
2020-01-27 14:21:58 +00:00
Friedemann Kleint
be8c257da9 QThread::setPriority() Warn about invalid parameter on all platforms
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>
2020-01-27 14:31:08 +01:00
Sze Howe Koh
e44de91a2c Doc: Clarify usage of Qt::ReturnByValue in QCursor
Change-Id: I6ce2c658dc0e72beb9e7a2497c6dbdbc71d96bc5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-27 21:31:08 +08:00
Sze Howe Koh
582311d122 Doc: Replace some usages of 0/zero/null with \nullptr
Change-Id: Ibe7de11fc6fc41477c35e7d653c6a911855deabb
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-27 21:31:08 +08:00
Michal Klocek
a3ff42ade6 Relax rules about not having dbus session
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>
2020-01-27 13:09:40 +00:00
Alexandru Croitor
b714219fea Fix qt_import_plugins compatibility with Qt 5
Handle versionless plugin names passed to qt_import_plugins.

Task-number: QTBUG-74137
Task-number: QTBUG-80477
Change-Id: Ic7fb6e54d2822c7eb58a7874b4a1c137f0c101d9
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-27 11:59:51 +00:00
Alexandru Croitor
f53ca8a4fc CMake: Add Qt 5 backward compatible CMake API
Create versionless function names, that coincide with the Qt 5 CMake
API.

Task-number: QTBUG-74137
Task-number: QTBUG-80477
Change-Id: I8559b2c8a49b23e5a89ec81603aaec54ea634d70
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-27 11:49:44 +00:00
Alexandru Croitor
b10d8eab04 Regenerate plugin projects to get new target names
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>
2020-01-27 11:49:34 +00:00
Alexandru Croitor
604aa83ad9 Reformat pro2cmake
Change-Id: I97175e8edbd4b911397f5b03a646006eff32a5bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2020-01-27 11:49:25 +00:00
Alexandru Croitor
f67d8ae2d4 Fix plugin target names to be compatible with Qt 5
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>
2020-01-27 11:49:11 +00:00
Alexandru Croitor
c9bea1ad62 Add initial support for CMake "Ninja Multi-Config" generator
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>
2020-01-27 11:47:57 +00:00
Venugopal Shivashankar
1ed802e3b8 Doc: Update the stylesheet reference for widgets and richtext
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>
2020-01-27 11:14:01 +00:00
Mårten Nordheim
a4363030bf QMultiMap: Add unite documentation
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>
2020-01-27 08:33:47 +01:00
Christian Ehrlicher
ea4b837fa1 Doc/QtGui: replace some 0 with \nullptr
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>
2020-01-26 17:52:03 +01:00
Christian Ehrlicher
2e377f2948 Doc/QtBase: replace some 0 with \nullptr
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>
2020-01-26 17:52:02 +01:00
Christian Ehrlicher
ae9056587a Doc/QtCore: use new signal/slot signature in snippets
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>
2020-01-26 17:52:01 +01:00
Christian Ehrlicher
aec4e05e9e Doc/QtWidgets: replace some 0 with \nullptr
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>
2020-01-26 17:51:59 +01:00
Marc Mutz
f21a6d409e QStringList: use local storage in removeDuplicates()
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>
2020-01-26 08:11:58 +00:00
Marc Mutz
bf330a8f03 QGestureManager: fix one (of many) inefficient loop(s)
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>
2020-01-26 08:11:54 +00:00
Friedemann Kleint
859307d7a5 Windows QPA: Provide an experimental palette for dark mode
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>
2020-01-25 20:33:30 +01:00
Friedemann Kleint
eb26563dd5 Windows QPA: Add setting of dark window borders
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>
2020-01-25 20:33:25 +01:00
Friedemann Kleint
12f085e538 Windows QPA: Add detection of dark mode
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>
2020-01-25 20:33:19 +01:00
Friedemann Kleint
1278995778 Windows QPA: Better disambiguate Window class names
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>
2020-01-25 20:32:58 +01:00
Sze Howe Koh
e79a625381 QCursor: Allow bitmap() and mask() to return by-value
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>
2020-01-26 01:19:55 +08:00
Sze Howe Koh
114ff44f3c QLabel: Allow pixmap() and picture() to return by-value
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>
2020-01-26 01:19:38 +08:00
Alexandru Croitor
e9a797799e CMake: Add Qt6 forward compatible CMake API and targets
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>
2020-01-25 18:10:26 +01:00