Commit Graph

52219 Commits

Author SHA1 Message Date
Morten Sørvig
0ca0f3e7fe wasm: don’t leak QWasmScreen member variables
m_compositor and m_eventTranslator are owned by the
screen object and can be held in a unique_ptr.

Pick-to: 6.2
Change-Id: I7d5e19e7ac6f762f360d6af0fc9500e6964f737e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-06-22 11:11:20 +00:00
Marc Mutz
a6bd2da2ab QWidgetAction: add test for defaultWidget() being deleted before action
... even though the documentation states that the action takes
ownership of the widget.

Change-Id: Ie5520fbda295a5a2774ff8b82165070e9d49e310
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-22 11:38:32 +02:00
Alex Trotsenko
3fe44ddb9d QWindowsPipeReader::read(): do not switch the mutex twice
We can get better performance if we omit unlocking the mutex before
relocking it in startAsyncRead().

Change-Id: Ia012a71b95876d4f90c1dc4b7db5d7b267fca7a6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-06-22 09:00:07 +03:00
Lorn Potter
d904274176 wasm: fix non-void function return
Pick-to: 6.2
Change-Id: Ia7ef3367c0531f953c78e43297f67d61b08dbf17
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-06-21 23:43:02 +00:00
Lorn Potter
ae717aa51f wasm: fix build for emscripten 2.0.14
new syntax rules for EXTRA_EXPORTED_RUNTIME_METHODS valid after 2.0.16

Pick-to: 6.2
Change-Id: Iff33e4c6f3176619fb35ec0994a7cc87b5d937c7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-06-21 23:43:02 +00:00
Alex Trotsenko
08b4abe1ba QWindowsPipeReader::read(): remove redundant checks
An initial EOF check is not required here because the code below
correctly handles this case. Also, the condition '!pipeBroken' means
that the pipe reader is in the 'Running' state.

Change-Id: I608d932c4e38f8224d9e655272e61295e55414e0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-06-21 22:32:31 +03:00
Alexey Edelev
991b64a7e5 Cleanup temporary code related to internal modules
Remove the temprotary 'Private' targets of the iternal modules.

Pick-to: 6.2
Task-number: QTBUG-87775
Change-Id: I9a2c7c8c2f63602476fd935b11dab7a835864537
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-21 21:25:00 +02:00
Liang Qi
73ea9f0328 xkb.compose: get locale from user env settings
The setlocale call will only give useful results if the program
had previously set the current locale using setlocale...

See also "Compose Locale" section in xkbcommon doc:
https://xkbcommon.org/doc/current/group__compose.html#compose-locale

Fixes: QTBUG-85529
Pick-to: 6.2 6.1 6.0 5.15
Change-Id: I65b1ac86ea54445bc3a2e1707df79bd9f732ab46
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-21 16:05:03 +00:00
Alexey Edelev
d49f19e661 Do not apply not acceptable properties to the imported object libraries
If __qt_internal_propagate_object_library is used to propagate an
imported object library we assume that the library is already compiled
and no need to apply properties that may affect compiling and further
linking of the target.

Amends 3329212815

Pick-to: 6.2
Change-Id: I2bd03264e286439fbed9067fa2c0a5c4a0097856
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-21 18:05:01 +02:00
Kai Köhne
58e4e015b5 Doc: Fix typos
Change-Id: I852fec49b23acaefb61284e347e63d86ba8331ae
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-06-21 16:08:07 +02:00
Iikka Eklund
74fb78b4cd Conan: simplify Conan recipe
The qt-conan-common package contains shared functionality
for recipes that should be used:
 - environment wrap during the build()
 - package_info() is generic for all recipes

Move the _build() out from the class so that it is usable for
the callback from qt-conan-common package.

Simplify how the Qt module version and prerelease tag is
read from .cmake.conf and how the file is being referenced.
As the .cmake.conf is included in the "exports" it will
be always present next to the recipe:
  - in .git source tree
  - in Conan cache

Pick-to: 6.2
Change-Id: I4bbd683f7b49151620397e0b7f4272929a93c060
Reviewed-by: Toni Saario <toni.saario@qt.io>
2021-06-21 15:19:16 +03:00
Iikka Eklund
08448a5f48 Conan: Read status flag from .cmake.conf
The status information (alpha1, beta2, rc3, ...) needs to be part of
the Conan package reference.

As Conan supports semantic versioning the best place to put the status
is to append it to the version string:

qtbase/6.2.0-alpha1@qt/everywhere
qtbase/6.2.0-beta2@qt/everywhere
qtbase/6.2.0-rc3@qt/everywhere
qtbase/6.2.0@qt/everywhere

Other Conan packages declaring a dependency can use e.g. syntax:

  # notice the asterix character after version
  self.requires(f"qtbase/[<=<version>, include_prerelease=True}]@..)

This way the status information is not in the Conan channel part and
downstream consumers of the Conan package does not need to update
the dependency (Conan reference string) every time the version changes.

Put the status information next to Qt version string in .cmake.cache.

Task-number: QTBUG-94385
Pick-to: 6.2
Change-Id: Ib277f99ea1e87253b93f59e463bd6c7dd8b3203e
Reviewed-by: Toni Saario <toni.saario@qt.io>
2021-06-21 15:19:16 +03:00
Paul Wicking
c92c3c19e8 Doc: Add note to Qt::MatchFlags about implementation dependent behavior
Pick-to: 6.2 6.1 5.15
Fixes: QTBUG-94374
Change-Id: I7f426c92bf0434998d0793eedd405c1a682a28d9
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-06-21 12:06:45 +00:00
Alexandru Croitor
f567f429bd CMake: Update section on required CMake versions
Change-Id: I6c556cd3a2e8bdf87b3c7c6ef62a6af6bdbe7137
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-21 12:48:12 +02:00
Heikki Halmet
ca321cfa0b BLACKLIST tst_QListView::internalDragDropMove for OpenSUSE leap
Task-number: QTBUG-94250
Change-Id: I9ea92b5952e1823cf90716f027f2f8eea1b86278
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2021-06-21 08:20:27 +03:00
Nicolas Fella
2b2b3155d9 Add missing limits include
The code uses std::numeric_limits but is lacking the appropriate include

Pick-to: 5.15 6.1 6.2
Change-Id: I41fa5ac4d8c4e06f35b5b1551ef2ad8417df80bd
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-06-20 17:48:12 +02:00
Giuseppe D'Angelo
9f7f05d6b5 QTestCharBuffer: kill copies and moves
The compiler generated ones are broken. The RO5 exists for a reason...

Change-Id: Ibaa5322a7a1ad4ad06bd00e9d1c21bbbea6eb08c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-06-20 12:18:58 +02:00
Alex Trotsenko
a8d7ecf295 QProcess/Win: cleanup startProcess()
Both the call to setProcessState(QProcess::NotRunning) and deleting
the PROCESS_INFORMATION structure are redundant here. All this work
was done by the previously executed cleanup() call.

Change-Id: Iaf89f5edd2b661008a479d154e68974621b1b1eb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-06-19 17:59:40 +03:00
Alexey Edelev
ff4244b540 Move dependency lookup functionality to the common macro
Dependency lookup mechanism is the same for modules and plugins. It
makes sense to wrap it using macro.

Pick-to: 6.2
Change-Id: I73727743b0f5f40b2d94624f65ebfcf85e8dcc59
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-19 14:04:37 +02:00
Alexey Edelev
cdbb390c4a Disable finalizers by default for the non-ld linkers
Check if link order matters before use the object library finalizer.

Amends 5fb99e3860

Pick-to: 6.2
Change-Id: Ie996bc175ebea36ccda1bb2fe388ae3b7fcde395
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-19 11:06:04 +02:00
Sona Kurazyan
72e21ad3e9 Add basic benchmarks for QFuture
The benchmark simply calls the non-trivial methods of QFuture, mostly to
make sure that fixes in the parent patches don't have any performance
implications.

Task-number: QTBUG-92045
Change-Id: Ib4e8c314a70b3090a1af55f1b96d9dad4bc63861
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-06-19 08:48:14 +02:00
Joerg Bornemann
95de422124 Fix the precompile_header configure test
This configure test always failed, and its result was never used.

Pick-to: 6.2
Change-Id: I5112464b247efb5327ef5c23c96ef27168c11afc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-19 01:08:23 +02:00
Alexey Edelev
ed92cb30e4 Fix the naming of the config header files for private modules
Perform a file name of the config header before adding a '_private'
suffix.

TODO: It makes sense to revisit the use of the CONFIG_MODULE_NAME
variable since the variable is used for different purposes and
mutate with use.

Amends 8aee7c6b29

Pick-to: 6.2
Fixes: QTBUG-94568
Change-Id: Id5aaf8d423ec8b94afffe4641b54dab94b5453fb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-18 22:18:25 +00:00
Alex Trotsenko
fe6d84d96e QEventDispatcherWin32: suppress old {FD_CLOSE|FD_CONNECT} notifications
As with other network events, we must also ignore these notifications
until WM_QT_ACTIVATENOTIFIERS message is received.

Fixes: QTBUG-82835
Pick-to: 6.2 6.1
Change-Id: I0740bf22e8d1cb0e8b4eba7fc1a27ffe669973ff
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-19 01:01:50 +03:00
Alex Trotsenko
f10491a9af QLocalSocket/Win: simplify flush()
Replacing a call to waitForWrite(0) with checkForWrite() changes
nothing in logic, but saves one system call. As a result, unused
functions in the QWindowsPipeWriter class have been removed.

Change-Id: I34ec6310d9659f59a720056b9be54e31f2193116
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-19 01:01:49 +03:00
Alexey Edelev
3329212815 Move the linking logic of the object libraries to a common function
The linking logic of object libraries should be reusable outside of the
resource context. This introduces a
__qt_internal_propagate_object_library function that prepares all the
necessary genexes to link and propagate the object library to the
end-point executable.

Rename resource object finalizer API to make the naming more generic
to object libraries of any kind.

Amends 5fb99e3860

Pick-to: 6.2
Task-number: QTBUG-93002
Task-number: QTBUG-94528
Change-Id: I69d0f34c0dadbd67232de91035aaa53af93d1fa1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-18 23:18:26 +02:00
Volker Hilsheimer
df31696321 macOS 11: Fix positioning of focus frame around combobox
Fixes: QTBUG-94069
Pick-to: 5.15 6.1 6.2
Change-Id: I09079726c96a41f628ae55724cfe53dbc225d358
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-06-18 22:54:15 +02:00
Alex Trotsenko
79490d2a4c QProcess/Win: avoid double buffering on write
As QWindowsPipeWriter now maintains a chunk queue, there is no need to
use the internal QIODevice buffer and wait for the previous operation
to complete.

This also allows us to get rid of the stdinWriteTrigger timer; however,
as a trade-off, QWindowsPipeWriter now needs to accept data even before
a handle is assigned.

Change-Id: I17fe0e36a6165fe05100bfab3fe01fc0d880d617
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-06-18 22:20:47 +03:00
Mårten Nordheim
bccfb92507 CMake: output VCPKG_CHAINLOAD_TOOLCHAIN_FILE with cmake paths
Change-Id: Ibde8890c30b9024aca589e892590d071b547c361
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-18 21:15:05 +02:00
Sze Howe Koh
d254af9152 Doc: Move overrideCursor() from QApplication to QGuiApplication
The transfer occurred in Qt 5

Pick-to: 5.15 6.1 6.2
Change-Id: Id3428809d89c804112d9dc02f2a476cb03bd2c98
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-06-19 02:23:15 +08:00
Tor Arne Vestbø
aeeaa7d253 Enable glyph cache workaround for Apple M-family of GPUs
Without the workaround, and when using a Core GL profile, we hit a code
path in QSGOpenGLDistanceFieldGlyphCache::resizeTexture() that produced
corrupt glyphs on M1 hardware.

We fix this by enabling the workaround, so that the user doesn't have to
set QT_ENABLE_GLYPH_CACHE_WORKAROUND themselves.

None-Core contexts do not have this problem, but the logic in
QOpenGLContext does not account for recreated contexts with different
formats, so we can't limit the workaround to Core formats only.

With the unified memory architecture of the M1 hardware, the workaround
should have limited negative effects.

In Qt 6 this is not a problem, since Qt Declarative effectively always
uses the workaround code-path, but it's worth recording the fact that
we need the workaround.

Fixes: QTBUG-89379
Pick-to: 6.2 6.1 5.15 5.12
Change-Id: Icfd8b8b23c0dcda3fea8663d81d0e225134eec5e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-06-18 19:02:16 +02:00
Alex Trotsenko
a73ec95c1e Allow destruction of QWindowsPipeReader in its signal
As a result, we can refrain from using the deleteLater() technique in
QProcess and avoid long-lived soft leaks in blocking applications.

Change-Id: I89e02b02551a668b995ad3d12d3ce9575b2dd9dd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-06-18 17:25:43 +03:00
Laszlo Agocs
e6a969954a Do not alter a widget's backing window's format once created
Changing anything on a QWindow's QSurfaceFormat has zero and null
effects once the underlying native window has been created. Letting
QWidget update the format is wrong in this case, because we always
expect that the value returned from QWindow::format() reflects
reality.

(reality being the settings with which the underlying native resource
was created, which is typically frozen after QWindow::create(), not
the state of some QWidget attribute. There are certain exceptions to
this, such as when preparing to recreate the underlying native window,
in which case one will want to update all relevant fields of the
format based on the current values of the widget attributes, which is
exactly what QWidgetPrivate::create() implements, and that's good.)

Such a mismatch can have fatal consequences when OpenGL and friends
are involved, but this always depends heavily on the platform and
windowing system. For example, claiming that the alpha buffer size is
0 when the native window was created with 8, or vice versa, can break
OpenGL-related code (both in Qt itself and in applications), that
tries to create a QOpengGLContext configured based on what
QWindow::format() returns. If that format describes settings that are
incompatible with the actual underlying native window, we end up with
the classic Invalid pixel format, EGL_BAD_MATCH, and alike errors.

This is exactly what is happening when a QOpenGLWidget (or
QQuickWidget) is placed in a QDockWidget where one of the ancestors is
forced to native (winId() was called or WA_NativeWindow was set). When
undocking, various code paths in QWidget will try to update the opaque
flag of the widget, which in turn calls updateIsTranslucent. Now, if
this function unconditionally changes the alphaBufferSize in the
QWindow's QSurfaceFormat (even though this is completely futile to do,
it has no visible effect in practice), we get the problem described
above: rendering breaking down due to OpenGL contexts created with a
pixel format incompatible with the native window.

Prevent all this by not touching the format once the QWindow has a
QPlatformWindow. This is the right thing to do, regardless of the bug
in question: a window's (or context's or any other native resource
wrapping class's) format must describe the underlying native resource
and must never deviate, unless we are preparing to create a new native
resource underneath.

When it comes to the autotest, this changes the test added in
555661b625: the autotest logic is
inverted because what we should test for is that the QSurfaceFormat
stays untouched once the application makes a - futile - attribute
change on the widget.

Fixes: QTBUG-85714
Pick-to: 6.2 6.1
Change-Id: I7bf90711867e8a0fd474895625bf9530a7821fd5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-06-18 15:14:02 +02:00
Alexey Edelev
29789ff0ea Use target OUTPUT_NAME as a module identifier in .pri files
QtPriHelpers copies the logic related to the module OUTPUT_NAME to
produce a module identifier. Since the module identifier should be
equal to OUTPUT_NAME it makes sense to reuse the property and
deduplicate logic.

Amends 8aee7c6b29

Pick-to: 6.2
Fixes: QTBUG-94568
Change-Id: I8d9c04273e4cdb1a2e6a3b0db3ddf52e008c0cf7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-18 15:14:02 +02:00
Giuseppe D'Angelo
f29ff5dffb Add GCC 11 and C++20 workarounds
GCC 11.1 has a bug [1] in the preprocessor that leads to
-Wsuggest-override warnings being raised in random places, even under
pragmas that are supposed to suppress it. For some reason, NOT using the
integrated preprocessor fixes it, so add that flag as a workaround.

Also, GCC 11 introduces a family of warnings for C++20's deprecations of
mixed enum arithmetic, which we use all over the place. Avoid a hard
error for those warnings.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100796

Change-Id: I3b2aefa385f191f207e7eb876bc1ed0b18fb342b
Pick-to: 6.1 6.2
Task-number: QTBUG-93360
Task-number: QTBUG-94059
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-18 15:14:02 +02:00
Eskil Abrahamsen Blomfeldt
30399fb95c Fix right-to-left text with DirectWrite engine + QPainterPath
When QPainterPath was used for RTL text, either directly or because
the target text size exceeds 64 pixels, we would pass true for
"isRightToLeft" to DirectWrite, causing it to do adaptation internally
for this. But the RTL layout had already been handled by Qt, so we
would essentially reverse the layout twice and also move the text
to negative X coordinates.

Passing false instead fixes this, as it will then just use the
positions we pass in blindly.

Fixes: QTBUG-94175
Pick-to: 5.15 6.1 6.2
Change-Id: Ie9a47e56e97fc867ede10ab21ac5e3f003ddcacb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-06-18 13:18:38 +02:00
Joerg Bornemann
7155e4f620 Remove old configure-related files
Remove the configure.json and configure.pri files that
were used for the qmake-based configure.

Remove the .prev_*.cmake files that were a by-product of
configurejson2cmake.py.

Pick-to: 6.2
Task-number: QTBUG-89536
Change-Id: Ie827562f7fd2513d59f69234d77b8b93124ea78e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-18 11:46:21 +02:00
Mårten Nordheim
ea7d87b5b5 QHash: Fix erase() edge-case
When the element you want to erase is the last element AND the
next element (element 0), when rehashed, would be relocated to the last
element, this leads to the state below. Which is similar to a test in
tst_qhash for some seeds.

auto it = hash.begin + (hash.size - 1)
it = hash.erase(it)
it != hash.end

By forcing the iterator to increment if we were erasing the last element
we always end up with a pointer which is equal to hash.end

Befriend the tst_qhash class so we can set the seed to a known-bad one

Pick-to: 6.2 6.1
Change-Id: Ie0b175003a2acb175ef5e3ab5a984e010f65d986
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-06-18 11:20:40 +02:00
Eskil Abrahamsen Blomfeldt
30f1f02cf7 codechecker: Add assert for implicit condition
Since memReq is initialized inside the loop, codechecker
complained that we might use uninitialized data if count == 0.
So we assert that this is not the case to get rid of the
warning.

Change-Id: I82152942d2bb61723e9e41489c87bfde9f8bec15
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-06-18 10:37:17 +02:00
Zhang Yu
e9cdcc7cb3 Fix recursion crash when calling setStyleSheet with qproperty-styleSheet
When calling `setStyleSheet` with property `qproperty-styleSheet`,
`QStyleSheetStyle::polish` will call`QStyleSheetStyle::setProperties`, and then`QStyleSheetStyle::setProperties` goes on to call `setProperty`.Because there is property `qproperty-styleSheet`, it will update stylesheet by calling QStyleSheetStyle::polish`.
This causes the recursive call to crash.

Fixes: QTBUG-94448
Pick-to: 5.15 6.2
Change-Id: I79c51192a939b0b62e5b1d0dcc90d38f79e28222
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-06-18 05:34:52 +00:00
Volker Hilsheimer
0c2ca26cd9 macOS: Resend event if the first input method event changes focus
QAbstractItemView opens the editor and changes focus in response to the
first QEvent::InputMethod event. Changing focus however cancels the
current composition, so the key press is lost and needs to be repeated by
the user. What QAbstractItemView does is probably not that unique, so
fixing this there - if possible at all - is not a general solution.

In the platform specific input method handling code, we can generally
discover that the focus object changed in response to the InputMethod
event that gets sent to the focus object. On macOS, we can then pass the
key event to the input method once more, which works fine.

On Windows and X11, the situation is more complicated. That the focus
changed is easily discovered, but re-sending the key press in such a way
that the input method responds doesn't seem possible. On Windows, using
SendInput simply delivers the exact key to the focus object, without
starting the expected composition.

On X11 with IBus, it should be possible to call ProcessKeyEvent again on
the IBus input context when we discover in filterEventFinished that the
focus object changed while delivering the event. However, any attempt to
do so has no effect.

So, for now only fixing this for macOS.

Task-number: QTBUG-54848
Change-Id: I0f7b786cfa57430e6a1e7d605415265cf53eb675
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-06-18 01:24:34 +02:00
Alexandru Croitor
b6c5e06676 CMake: Handle OPTIONAL_COMPONENTS in qt_find_package
The optional components arguments were not handled before which
caused the recorded package information for static builds to be
incorrect, it only recorded the package name without the component.

Remove REQUIRED_COMPONENTS TODO, there is no such find_package option,
it's already handled by the regular COMPONENTS code path.

Amends 07b6d3367d

Pick-to: 6.1 6.2
Fixes: QTBUG-94501
Change-Id: Ib48a7befcb70e20c3f21315897d51d3064b48134
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-17 23:28:18 +02:00
Marc Mutz
7e335f290b QWinSettings: use QScopeGuard to RegCloseKey()
RAII rulez.

Change-Id: I32bc070ae3074f782a1695bcf2079de0fc19597b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-17 20:11:15 +02:00
Fabian Kosmale
6b36e78352 QBindable: Use setter in setValue for QObjectCompatProperty
Directly writing to the underlying property storage has the potential of
breaking all kinds of internal invariants. As we return QBindable in
the public interface, we should not grant callers access to the
internals of the object.

Pick-to: 6.2 6.1
Change-Id: I737ff293b9d921b7de861da5ae23356c17690b78
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
2021-06-17 19:32:56 +02:00
Alexey Edelev
8aee7c6b29 Fix internal module naming in qmake .pri files
Set the correct value to the _qt_config_module_name property at the
internal module creating step instead of appending _private suffix when
generating .pri files.

Amends 425ff34aa1

Pick-to: 6.2
Fixes: QTBUG-94568
Change-Id: I6fa8089358bc638668e313c98c3aee680bf7ec2a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-17 19:32:56 +02:00
Allan Sandfeld Jensen
d3b9759b42 Silence a few warnings from excess semicolons
We dont really need those after functions definitions.

Change-Id: I41f010a223977c55d4b7271ac3ebdc1bb9047b09
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-06-17 18:56:12 +02:00
Alexandru Croitor
5ec937115b CMake: Export info if an object lib target is a plugin initializer
Needed for qtdeclarative so we can filter out which object library
should go into which export set, because qt_internal_add_qml_module
can create both a backing library export set and a plugin export set.
The plugin initializer object lib should go to the plugin export set.

Pick-to: 6.2
Task-number: QTBUG-92933
Change-Id: I0fce131eff75a0b3090ac0fbb2a12ecfcba5e38d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-17 18:56:12 +02:00
Alexandru Croitor
a37957df5c CMake: Add TODO to apply generalized object library linking approach
Pick-to: 6.2
Change-Id: I1ea368e81d8b055ef353a0f021f188b45588c937
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-17 18:56:12 +02:00
Alexandru Croitor
602d26c38f CMake: Set the plugin class name for qml plugins
This is needed for a change in qtdeclarative to allow building the
Q_IMPORT_PLUGIN-containing object library initializer of a qml plugin.

Show an error if the qml plugin has no class name, it's needed for
plugin initialization so it's mandatory to have a class name.

Show an error if a class name is not found when computing the import
macro for a plugin (both for a regular qt plugin and a qml plugin).

When querying for the class name of a target, query both a Qt6::
prefixed target as well as a non-prefixed one, with the Qt one
taking precedence.
This is to allow querying the class name of user project created qml
plugins.

Currently regular qt user plugins don't use the object library
initializer approach. This will likely be revisited in the future.

Pick-to: 6.2
Task-number: QTBUG-92933
Change-Id: I46417471a7d8b49651e6821f7b28e7a9d44c2557
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-17 18:56:12 +02:00
Alexandru Croitor
103c1bc7ba CMake: Don't generate .pri files for qml plugins
We didn't do it in Qt 5 times and it was accidentally done for Qt 6.

There's no reason to generate them, the .pri files are only meant to
be used for regular plugins so a project can do QTPLUGINS += foo.

That mechanism is not needed for qml plugins which use
qmlimportscanner instead.

Furthermore the pri contents didn't contain a class name, so they
couldn't be used anyway.

Pick-to: 6.2
Change-Id: I6299fda21ece0f693a817ab558b45aa46b97e5ee
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-06-17 18:56:12 +02:00