Commit Graph

59194 Commits

Author SHA1 Message Date
Cristian Adam
676506a3d5 Warn about WinRT only on WIN32
Amends 040aef5b2f which removed the MSVC
condition.

By testing for WIN32 all compilers are taken into consideration.

Change-Id: I8323fa8e866fe04063cfe30875e563524beae6c2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-04 22:11:33 +01:00
Tor Arne Vestbø
31973f3ff3 Teach QErrorMessage to use native dialog helper if available
And implement for macOS. The default modality of the QErrorMessage
on macOS now depends on whether the dialog has a parent or not.

The QErrorMessage must be hidden and re-shown again after each message,
so that the native dialog has a chance to recreate itself.

Change-Id: I474ed35d6271118834fac8e97f6f540a6fb89b8c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-12-04 19:15:37 +01:00
Timur Pocheptsov
8a18466e38 qsslsocket_shared_mac: add more logging into certificate parsing
On macOS we observe strange CA certificates that are coming from
Security framework and which it cannot later parse from the DER
format we feed it in. Add some more debugging in order to understand,
which certificate gives such result.

Pick-to: 6.4 6.2
Task-number: QTBUG-109135
Change-Id: I75cf4591e33c85db6fe80d37d84ede1456c56231
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-12-04 15:06:58 +00:00
WANG Xuerui
bdc16f086f Add LoongArch detection
- detect the LoongArch architecture, define Q_PROCESSOR_LOONGARCH and
  Q_PROCESSOR_LOONGARCH_{32,64} appropriately
- document the macros as being available starting from 6.5
- add LoongArch ELF support in QElfParser

Change-Id: I438146af49ec3adacacec84c27c9f4abaa542830
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-04 16:14:43 +08:00
Cristian Adam
6da057d811 networklistmanager: allow building with LLVM-MinGW
At https://github.com/mstorsjo/llvm-mingw/issues/307 we can see that
LLVM-MinGW is able to build qtbase with winrt headers and cxx20 feature.

Change-Id: Ib4b5df7481f684ebdb26cbc4246bdf86ff3dd648
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-03 18:32:03 +01:00
Eric Lemanissier
be4352cb84 fix pcre2 detection
pcre2-16 is not the target name provided by the upstream Config file. It is PCRE2::16BIT.
2410fbe386/cmake/pcre2-config.cmake.in (L122)

Pick-to: 6.2 6.4
Change-Id: I89f167e11bf1c72c9fae474ddd12380636ac5df8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-12-03 15:41:35 +01:00
Kai Köhne
2e241d1537 Add \brief descriptions to CMake overviews
Add brief descriptions of the pages that are shown in
  https://doc.qt.io/qt-6/overviews.html

Pick-to: 6.4
Change-Id: I177e4ba82cd7b8e264122375bf9a595509918fdd
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-12-03 10:35:19 +01:00
Yuhang Zhao
0d708a9aad MSVC: Improve the LTCG build
When we use MSVC to build static libraries, enabling LTCG will
generate very large output, for example, Qt's bundled 3rd party
libraries can be greater than 100MB per file (some of them even >200MB!).
This is not good if we are building a shared version of Qt and
enabling LTCG at the same time. On Windows Qt's bundled 3rd party
dependencies will be built as static libraries and they will make
the final Qt package way too large. From my side, if I only build
a release version, the package size is usually around 500MB but
when LTCG is enabled, it become over 2GB. The exe and dlls' size
don't vary much, but there are many large static libraries.

Fixes: QTBUG-108719
Change-Id: Ic521f500b9c24389524e96a8cdc2e7b3427b51a9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2022-12-03 12:55:20 +08:00
Timothée Keller
58861f78c0 Windeployqt: adjust bitset change for scaling
Replaced the ullong with Modulebitsets for when the number of modules
exceeds 64

Pick-to: 6.4
Change-Id: I489d35bc53d6aacf7907f75957bd8c6d21fbeb60
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-12-03 05:45:31 +01:00
Yuhang Zhao
040aef5b2f Cleanup qtbase to allow LLVM-MinGW use WinRT
Both clang-cl and clang-mingw supports WinRT facilities now, so
there's no need to limit WinRT usages to MSVC only.

Change-Id: Ib3019db62a038f0ebb5f20210c0a12ee296e7f71
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-12-03 03:33:22 +01:00
Volker Hilsheimer
7956d9e060 Deliver tablet events to the toplevel widget if there is no child
QWidgetWindow dispatched only tablet presses to the toplevel widget if
no child was found at the position; other events, such as hover events,
were discarded. The tabletTracking test case even documented that
shortcoming in a comment.

Fix that by falling back to the toplevel widget for any event. As
before, only press events initialize the tablet grabbing target widget.

Remove the now unneeded parent widget from the test case, and move the
test class into the only test function that uses it.

Amends ea615b421b and
8fd6cef372.

Pick-to: 6.4
Fixes: QTBUG-108747
Change-Id: I79050f1e063931e439945f64b50712dcc1ecb18c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-12-02 23:10:05 +00:00
Friedemann Kleint
f6b137bdc4 Brush up the container documentation
Make the code snippets consistent, update the comparison table
and fix some sentences.

Pick-to: 6.4 6.2
Change-Id: Ic8baaa56805392855736164efa03d065330309fa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-12-02 20:53:02 +01:00
Ahmad Samir
93f54f0aa4 ContainerApiSymmetry: verify Qt containers member erase returns iterator
For QSet, the key_type is const, so can't test assiging to it.

Pick-to: 6.4
Change-Id: I9d363ef3fe52646b937d6a422227b19c48fdaf1f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-02 21:53:02 +02:00
Mårten Nordheim
e35cf5ebdc QByteArrayView: Add mid/left/right
Because they are too convenient to leave out.

Change-Id: I844cfb794ce0f575c2c65075d9051b0b878a434f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-02 20:53:01 +01:00
Axel Spoerl
acb012558b Cleanup tst_QWidget BLACKLIST file
Remove legacy entries and operating systems from tst_QWidget's
BLACKLIST.

Task-number: QTBUG-25300
Task-number: QTBUG-45502
Task-number: QTBUG-68175
Change-Id: I6ce63ff5e616e0e1783ad6fb9ec0b1fe7ef18d0c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-12-02 19:53:01 +00:00
Alexandru Croitor
9b2c82cc84 CMake: Add auto test for qt_add_resources dependency rebuilding
Make sure that touching any file that is part of a qrc resource
actually rebuilds the resource and the target that depends on the
resource.

Pick-to: 6.4
Task-number: QTBUG-107687
Task-number: QTBUG-108113
Change-Id: I1153dc13fee44ffe59d2685a8cb33303538b026c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-12-02 20:53:01 +01:00
Laszlo Agocs
919664b29a Avoid continuous texture alloc in Composition Modes example
There seems to be some confusion from back when the example were
mass-ported to the QOpenGL stuff in Qt 5 times.

Pick-to: 6.4 6.2
Fixes: QTBUG-109119
Change-Id: Ic4bcd010df3fcf82e16385ce241b379f0c351788
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2022-12-02 20:53:01 +01:00
Mate Barany
f192ddad8b QString: overload prepend with QUtf8StringView
Add the missing overload.

[ChangeLog][QtCore][QString] Added prepend(QUtf8StringView)
overload.

Task-number: QTBUG-103302
Change-Id: I3f74e884e514ebc0b15a13b074584d8272a02f41
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-02 16:04:14 +01:00
Mate Barany
f046589e14 QString: overload insert with QUtf8StringView
Overloading insert is a bit tricky since the size might change after
the conversion so either the tail has to be moved twice or a temporary
buffer is needed. For now, add an ineffective but simple overload as in
the case of the const char *s overload, and do the performance
optimization in a follow-up task (QTBUG-108546).

[ChangeLog][QtCore][QString] Added insert(QUtf8StringView) overload.

Task-number: QTBUG-103302
Change-Id: If01c216ff626da29abb43eb68d4de82824f3bfba
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-02 16:04:11 +01:00
Mate Barany
2ffdb3bcdd QString: overload the += operator to handle QUtf8StringView
The += operator is already overloaded to handle QStringView and
QLatin1String - add the missing QUtf8StringView overload.

[ChangeLog][QtCore][QString] Added operator+=(QUtf8StringView)
overload.

Task-number: QTBUG-103302
Change-Id: Iec6940bad7866310c826a130b98accebc3c82aa8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-02 16:04:06 +01:00
Mate Barany
d2e1d73bf1 QString: overload append to accept QUtf8StringView
Add the missing overload, among other things it is needed to
implement QTBUG-103302.

[ChangeLog][QtCore][QString] Added append(QUtf8StringView)
overload.

Task-number: QTBUG-103302
Change-Id: I576f73c1919e3a1f1a315d0f82c708e835686eb1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-02 16:04:01 +01:00
Axel Spoerl
4ca8a68408 Re-implement palette, standardPixmap, file icons, fonts in QGtk3Theme
Read theme colors from GTK3 style context and build platform theme
palettes in Qt.
React to runtime theme changes.
Re-implement methods to retrieve GTK3 styled standardPixmaps, fonts
and file icons.

Task-number: QTBUG-62510
Change-Id: Ib58d1614850764f2e88cca33883fd6c426b35aee
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2022-12-02 15:57:11 +01:00
Timur Pocheptsov
96628b1254 Stop using deprecated constants and use suggested replacement
Pick-to: 6.4 6.2
Change-Id: I3686d896267d219501f8eeec74729c17d9c2b42d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-12-02 15:55:30 +01:00
Timur Pocheptsov
190e5af111 Try fixing auto-tests that need resolving openssl symbols
For the case of static builds. Also, remove somewhat funny comment
from the shared tlshelpers.h file.

Fixes: QTBUG-105046
Pick-to: 6.4 6.2
Change-Id: I2fd677a11b64df89c0ad0237e1014f5e80144c24
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-12-02 15:55:11 +01:00
Laszlo Agocs
62d76743b3 rhi: vulkan: Flush before unmap
To prevent validation errors with VUID-VkMappedMemoryRange-memory-00684
although I cannot actually trigger this on Windows. Based on the spec
however the right thing seems to be to flush before unmap.

Pick-to: 6.4 6.2
Fixes: QTBUG-109123
Change-Id: I34fedea22a6e6e2a14f9b95fea49af05985ec4cb
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2022-12-02 15:53:38 +01:00
Tor Arne Vestbø
45e33954ef QErrorMessage: Forward log messages to original handler
The convenience of having a QErrorMessage pop up a dialog when a log
message is emitted should not prevent the existing message handler
(typically the default handler, logging to console e.g.) from getting
a stab at the messages.

Change-Id: I45ba9128f509e85cd60f4e678cf8ec50bb0f93f1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-12-02 15:53:38 +01:00
Tor Arne Vestbø
21127b587b QErrorMessage: Filter out categorized logging for QErrorMessage::qtHandler()
The class was not written to handle categorized logging, which was
added after its inception. Processing categorized logging can quickly
lead to issues, as showing the QErrorMessage may trigger categorized
logging in itself.

Change-Id: Id1d3a75acc1e6d1a69493fa722a733ae2f1f5f63
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-12-02 15:53:37 +01:00
Tor Arne Vestbø
7e4c7d50a7 Add QGuiApplication API to set a number-badge in the Dock/task bar
The API is supported on macOS, iOS, and Windows. On Android no official
API exists for badging the application icon, and we don't want to take
on dependencies like ShortcutBadger [1].

The macOS and iOS implementations are trivial. The same goes for
the WinRT based implementation on Windows, but this API is only
available for applications that have a so called "package identity",
and does not seem to be stable for Windows 10.

To cover the cases where this API is not available we fall back to
drawing the badge manually, and set it as an overlay icon on the task
bar using ITaskbarList3. The look of this badge has been tweaked to
match the Windows 11/10 styles, and will pick up the user's choice of
dark/light mode and accent color if available.

[1] https://github.com/leolin310148/ShortcutBadger/

[ChangeLog][QtGui] Added QGuiApplication::setBadgeNumber() to inform
the user about e.g. the number of unread e-mail or queued tasks.
The badge will be overlaid on the application's icon in the Dock
on macOS, the home screen icon on iOS, or the task bar on Windows.

Task-number: QTBUG-94009
Change-Id: I6447d55177f9987b0dfcd93caf63c6167f7224c7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-12-02 15:53:37 +01:00
Tor Arne Vestbø
846cda7eb0 Remove Android High-DPI workarounds in examples
These should no longer be needed for Qt 6.

Change-Id: Ica7214cbf4fc3ddae960309fe89681ec690d28d0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-12-02 15:53:37 +01:00
Tor Arne Vestbø
465bde54a0 Remove showMaximized() workaround for Android in examples
Android implements QPlatformIntegration::ShowIsMaximized nowadays.

Change-Id: I451a9a8edc8ec407946d44f3e6921c78ac1d11aa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-12-02 15:53:37 +01:00
Axel Spoerl
2ec7a6322f Stabilize tst_QWidget::optimizedResizeMove and optimizedResize_topLevel
The test functions tst_QWidget::optimizedResizeMove and
tst_QWidget::optimizedResize_topLevel use a custom widget to record
paint events in a boolean.
Using QTRY_* or qWait() to wait for the boolean to become true stops
event processing upon consumption of the first paint event.
In case of multiple paint events, the next paint event will be recorded
in the next check and may lead to a wrong result.
This leads to flakiness on platforms generating multiple paint events,
openSuSE Leap 15.4 / XCB being one of them.

This patch replaces the boolean with a counter. It adds a
waitForPaintEvents method to the custom class, which processes events,
until the counter stops increasing. It returns true when paint events
have been recorded and false otherwise. It resets the counter after
each call.

It also removes the QSKIP on wayland, as the failure results from the
same reason.

Fixes: QTBUG-109093
Pick-to: 6.4
Change-Id: I59ee8bb4efeaf5417d5749d21e384bee89301ae0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-12-02 11:45:36 +01:00
Doris Verria
dbe433f6d0 iOS plugin: Support picking folders for native file dialog
Fixes: QTBUG-104375
Change-Id: Idbc9eb44abed5e3cd0dd768a08bf8132aba58f43
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-12-02 11:42:58 +01:00
Doris Verria
443af8cd45 iOS plugin: Add native font dialog
[ChangeLog][iOS] Added native font dialog support for iOS.

Task-number: QTBUG-109059
Change-Id: If38e990e1c5e9fc1a303fce3e79c09c2d45daaa0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-12-02 11:42:37 +01:00
Yuhang Zhao
67715b0095 Win: redirect console output to the parent process if needed
We need to redirect the console output to the parent process
for GUI applications on Windows, otherwise we won't get any
output if we start the application from the console, because
the SUBSYSTEM of GUI applications is not CONSOLE by default.

But we don't want to change the default behavior of Qt, so
we control this feature through an environment variable
"QT_WIN_DEBUG_CONSOLE". It accepts two string values:
(1) "new": the application will try to create a separate
    console window and redirect everything (cin/cout/clog/cerr)
    to it. If you are running the application in an IDE, you
    won't be able to get anything from the IDE's console anymore.
(2) "attach": the application will try to attach to the parent
    process's console, if there is one. When we attached to it
    successfully, we'll redirect everything to it.

Change-Id: I3ef98f6c0603f64fcc4e8e974411c5ed83c5d36f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-12-02 18:35:52 +08:00
Øystein Heskestad
b977ae371a Add In-place utf-8 case-insensitive comparisons
Also add optimizations for more string comparisons and add tests and
benchmarks.

[ChangeLog][QtCore][QString] Added utf-8 case-insensitive comparisons

Fixes: QTBUG-100235
Change-Id: I7c0809c6d80c00e9a5d0e8ac3ebb045cf7004a30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-02 11:35:49 +01:00
Alessandro Portale
724329b79e androiddeployqt: Avoid extra modifying of gradle's *.properties files
On each run of androiddeployqt involving gradle, the "merging" of
gradle's *.properties files inserted empty lines.

Change-Id: I7a8314cd0adf4d85663f17ac22967a08cab42b91
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-12-02 10:34:52 +00:00
Mate Barany
8c0ed7422c Refactor\Extend tst_QString::prepend_data with additional test cases
During the implementation of QString::append(QUtf8StringView) it has
become apparent that the testing is insufficient as it did not warn
about an extra growth. The following tests have been added that append:
- y-umlaut and greek letter small theta (2 UTF-8 code units => 1 UTF-16)
- devanagri letter ssa (3 UTF-8 code units => 1 UTF-16)
- chakma digit zero (4 UTF-8 code units => 2 UTF-16 code units)
- some combinations of the above

Pick-to: 6.4 6.2
Task-number: QTBUG-103302
Change-Id: I981213c296bafc81663b08c0f1f339bbd8a96485
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-02 10:34:52 +00:00
Mate Barany
bc9e1c5c27 Refactor\Extend tst_QString::insert_data with additional test cases
During the implementation of QString::append(QUtf8StringView) it has
become apparent that the testing is insufficient as it did not warn
about an extra growth. The following tests have been added that append:
- y-umlaut and greek letter small theta (2 UTF-8 code units => 1 UTF-16)
- devanagri letter ssa (3 UTF-8 code units => 1 UTF-16)
- chakma digit zero (4 UTF-8 code units => 2 UTF-16 code units)
- some combinations of the above

Pick-to: 6.4 6.2
Task-number: QTBUG-103302
Change-Id: I3d81cf10b7eb74433ce5bea9b92ce6bce1230dcd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-02 10:34:49 +00:00
Mate Barany
4e5f874063 Refactor\Extend tst_QString::append_data with additional test cases
During the implementation of QString::append(QUtf8StringView) it has
become apparent that the testing is insufficient as it did not warn
about an extra growth. The following tests have been added that append:
- y-umlaut and greek letter small theta (2 UTF-8 code units => 1 UTF-16)
- devanagri letter ssa (3 UTF-8 code units => 1 UTF-16)
- chakma digit zero (4 UTF-8 code units => 2 UTF-16 code units)
- some combinations of the above

Note that this also affects operator_pluseq_data, which is basically
a wrapper around append_data.

Pick-to: 6.4 6.2
Task-number: QTBUG-103302
Change-Id: I09ed950e3f0e71ae9ae85a455f42e130887f1109
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-12-02 11:34:47 +01:00
Marc Mutz
22ad2c3320 [doc] QAnyStringView: document visit()
For some reason, it wasn't documented.

Pick-to: 6.4 6.2
Change-Id: I480623398dc33be91e82b24ac2616bcdd20da34b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-12-02 10:34:39 +00:00
Assam Boudjelthia
80fbabad8a CMake:Android: add Android templates, bindings and gradle files to tree
Add Android templates, bindings and gradle wrapper files to custom
targets so they can be easily tracked by the project tree when using
Qt Creator for example.

Change-Id: I4144b9ee461139a9f768c57b14139e0fc21d4c28
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-12-02 10:29:24 +00:00
Alexey Edelev
487c823a2d Suppress QtCompressMimeDatabase output
Add the flag to enable the verbose output of QtCompressMimeDatabase
script. Disable the verbose output by default.

Change-Id: I781037b126bef5e3aff69c0738aaea99b932b7e7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-12-02 11:28:59 +01:00
Nicolas Fella
4bb0086b3f [QGuiApplication] Tweak description of X11 and Wayland platform plugins
Given the growing adoption of Wayland calling X11 regular is becoming less and less true

Make the description more neutral in that regard

Change-Id: Iac2b5dd7f80f019df5d046c90ab3466c9fa02bff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-12-01 13:47:59 +01:00
Kristoffer Skau
c450f6d21c Support stereoscopic rendering with QGraphicsView
This patch adds a manual test and the required work in graphicsview and
qwidget private apis to support stereoscopic rendeing. Basically it
works by doing the drawing in QGraphicsView::paintEvent twice, once for
each buffer. This way the scene items are rendered to both buffers.
There's also an update to resolvement in QOpenGLWidgetPrivate
so that multisampling works correctly.

[ChangeLog][Widgets][QGraphicsView] Added support for
stereoscopic rendering.

Task-number: QTBUG-64587
Change-Id: I20650682daa805b64fe7f0d2ba086917d3f12229
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-12-01 13:42:07 +01:00
Mikolaj Boc
9bc74d14f3 Avoid a null pointer deref when openGL windows are present
m_context2d in QWasmWindow might be null if the window uses OpenGL
for rendering. It is dereferenced nevertheless in ::paint(), which
should be avoided.

Change-Id: Id817f3663bb475d55dfc916b4b7eb255a88cea9d
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-12-01 09:25:44 +01:00
Marc Mutz
5d41ec46e9 QString/QByteArray: de-pessimize op+ [1/2]: non-const return types
const return types prevent move semantics, so drop the const.

This is BC, because the operators are all inline free functions. In
particular, they're not exported (MSVC mangles the return type).

[ChangeLog][QtCore][QString/QByteArray] operator+ no longer returns
a const object, enabling move-semantics on the return value, but also
hidden detaches.

Change-Id: Ifc18f6b1df1e3840f57b2521949dbade8e11fd76
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-12-01 08:10:11 +00:00
Joerg Bornemann
9204ac23a0 CMake: Don't setup deployment when building Qt without examples
Introduce the variable QT_SKIP_SETUP_DEPLOYMENT to turn off the
generation of deployment support files. Set this variable when building
Qt - but only if we're not building examples.

This avoids a warning about missing patchelf when building Qt with CMake
< 3.21.

Change-Id: I8ff5491eb314ff870c210884fbf90dd4c9ad0219
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-12-01 08:53:32 +01:00
Joerg Bornemann
34d7dd908e CMake: Fix configuring Qt with CMake < 3.21 and missing patchelf
Turn the FATAL_ERROR into a WARNING and explain what patchelf would be
used for.

Also, store the patchelf executable just as "patchelf" if it could not
be found. Now it's possible to install patchelf after configuring a
project.

Fixes: QTBUG-109004
Change-Id: I1e89b4c5851f341e000e563d1437398b454c68f7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-12-01 08:53:28 +01:00
Joerg Bornemann
84c76d6205 CMake: Make it possible to specify a debug MySQL client library
An MSVC debug-and-release build of Qt with the MySQL plugin requires
separate builds of the MySQL client library: a debug and a release
build. There was no way to specify the debug version of the library.

Now, it's possible to configure Qt like this:
cmake ... \
    -DMySQL_ROOT=D:\mysql-connector-c-6.1.11-winx64 \
    -DMySQL_LIBRARY_DIR=D:\mysql-connector-c-6.1.11-winx64\lib\vs14

This will automatically detect the include dir and the debug and release
library files. We expect that the debug build of the MySQL client
library resides in a "debug" subdirectory below MySQL_LIBRARY_DIR.

If the automatic detection doesn't work to due a different layout on the
build machine, one can set the variable MySQL_LIBRARY_DEBUG to specify
the debug variant of the MySQL client library.

[ChangeLog][CMake] If pkg-config is not used, a debug build of the MySQL
client library can be specified with
-DMySQL_LIBRARY_DEBUG=<path-to-library>. The debug and release variants
of the library are automatically detected. Setting MySQL_ROOT and
MySQL_LIBRARY_DIR is sufficient in most cases.

Pick-to: 6.2 6.4
Task-number: QTQAINFRA-4999
Change-Id: I663fb8ac1dbd07bc73484791be9cc21bff2f4a9b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-12-01 08:53:19 +01:00
Mikolaj Boc
65b7aacb40 Add a dummy target for tests that get batched
This is done to avoid cmake syntax errors when adding new tests.

Change-Id: I8106b13a865b990c52e09573488881bd18e64c7f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-12-01 08:52:44 +01:00