Commit Graph

54987 Commits

Author SHA1 Message Date
Alexey Edelev
1ff8877ea7 Exclude tst_qmake if the build of qmake tool is disabled
Pick-to: 6.2 6.3
Change-Id: I5aadf5250c19d8a8b26c4a890350ff3bf79e31c7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-02-09 15:33:46 +01:00
Alexey Edelev
3bee7db419 Fix the run of _check targets in multi-config builds
With Ninja Multi-Config generator it's necessary to provide the
'-C' option matching the build configuration when running
ctest. This patchset adds the missing option to the command line
of the '_check' targets.

Pick-to: 6.2 6.3
Change-Id: I42acfba26a09877a6d3a5be9230860f15f95a0cd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-02-09 15:33:45 +01:00
Eskil Abrahamsen Blomfeldt
d4de57de42 Fix regression when displaying emojis on Windows
This amends b0e8ba783b. A
copy-paste error accidentally broke emojis on Windows.

Change-Id: I758572604370d170b8effd6c0ff97e09489fafa4
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2022-02-09 15:33:45 +01:00
Alexandru Croitor
90b07054f6 CMake: Assign proper postfixes in multi-config builds
In a single-config build on Linux, we usually don't want a debug
postfix in library names (as opposed to Windows/macOS).

But when doing a multi-config build on Linux, assigning no postfixes
causes CMake to generate rules for a single config only, the first one
specified in CMAKE_CONFIGURATION_TYPES.

This leads to being unable to build all configurations from the same
build.ninja file as well as other obscure issues like race-conditions
when generating prl files.

To address this, when doing a multi-config build, always assign a
postfix for each config except the first release-like one, while
preserving the existing rules we had for debug postfix names.

Pick-to: 6.2 6.3
Fixes: QTBUG-100493
Change-Id: Ie9c88e074abdcf2961d7b3dee19a5694292717b8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-09 15:33:45 +01:00
Mårten Nordheim
9ec94f31b0 QNetworkInformation: Rename parameter-less load() to loadDefaultBackend
To clarify its purpose and separate it from the others

Pick-to: 6.3
Change-Id: Id9efcf474ac0cd8777393380bb85c83780454005
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-02-09 15:17:54 +01:00
Mårten Nordheim
af7e5c78d9 QSocks5: Un-virtualize what is never overridden
Change-Id: Iec9f56ff24c94f05eba4fc54fa48df3af3de7801
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-09 15:17:53 +01:00
Pasi Petäjäjärvi
39310a6817 Handle situation when device running test does not have enough RAM
CI tests for QNX are run in QEMU which does not have enough RAM
to run this test successfully.

Pick-to: 6.2 6.3
Change-Id: Idab3e8b6a1e0ae3eddf5aedb82e6784a74ae9a3a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-02-09 14:17:53 +00:00
Pasi Petäjäjärvi
11fcfd75a0 QNX: Remove expected fail
Pick-to: 6.2 6.3
Change-Id: I66b05685dd1c5c5e083db1ecd9265e1e3c859d45
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
2022-02-09 14:17:53 +00:00
Kai Köhne
604ace0095 Widgets: Do not include qundogroup.h, qundostack.h in QtWidgets header
The headers are already included in QtGui/QtGui. This also fixes
an issue when compiling with the respective features disabled.

Pick-to: 6.2 6.3
Fixes: QTBUG-100290
Change-Id: I5e7c6578952535315bacde218a26d2133c486b2c
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-09 15:17:53 +01:00
Andreas Eliasson
29229f34b2 Doc: Fix minor grammar issues in qtgui landing page
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I89497facbb33c4a47420a1ba0dd61f51ab407a77
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-02-09 15:17:53 +01:00
Andreas Eliasson
5cd8d217b4 Doc: Fix minor grammar issues in qtdbus-index
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: Id224b7838b49934b46f00ea44c67aa1c201648d6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-02-09 15:17:53 +01:00
Andreas Eliasson
de47400387 Doc: Merge two bullet list items into one
My understanding is that the two bullet list items should be
treated as one item.

Pick-to: 6.3
Change-Id: Ibdd2bbc8677e925e71e6de7b3f076a1fab3914bf
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-02-09 15:17:53 +01:00
Andreas Eliasson
6f0cde223a Doc: Remove link command
This link command simply links back to the same page. Also, none of the
other modules put their module name inside a link command at the
beginning of the document, for example: The Qt QML module provides...

Pick-to: 6.3
Change-Id: I2299b92f44ee736d181f34d9e71a31ba210a34e8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-02-09 15:17:52 +01:00
Laszlo Agocs
178c1a6243 rhi: Add the long-pending probe() helper, with backing for Metal
There is a TODO for this in Qt Quick from the 6.0 times. To decide
upfront if Metal can be expected to function, or if a fallback to
OpenGL needs to be triggered (especially important with macOS virtual
machines, where, unlike any real macOS system, Metal may not be
present at all), the scenegraph calls create() and then drops the
result. The idea to make this less wasteful was back then to add a
dedicated probing function which can, possibly, perform the checks in
a more lightweight manner than full initialization. Implement this
now, focusing on Metal.

Brought to attention by QTBUG-100441: printing warnings about not
having an MTLDevice is confusing in a Metal-less macOS VM, because it
is not an actual error, only part of the probing at scenegraph
initialization. We can now avoid printing confusing warnings there.

Change-Id: Ie52c36af9224bedc3f5e4c23edb486d961c9f216
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-02-09 14:02:57 +01:00
Tor Arne Vestbø
1f93ff529b Add warning about native interface APIs to platform headers
Those platform specific classes are not covered by our
binary/source compatibility guarantee between minor releases.

Pick-to: 6.3
Change-Id: I2a69c7ea07feea62fdf9899839e47fc540f89c12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-09 14:02:57 +01:00
Volker Hilsheimer
0a9f3ce3c8 Make time sensitive QScrollBar test fault tolerant
The auto-repeat timer of QScrollBar kicks in after 50ms, so if the test
takes too long and the timer fires during the qWait call or during event
delivery, then we might get multiple valueChanged emissions.

Detect that scenario and allow the test to XFAIL if things take
a significant time (more than 40ms vs the expected 1ms).

Pick-to: 6.3 6.2
Change-Id: Ie90aadc62372397db695fd2b34fe1f5252ce8d37
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-02-09 14:02:57 +01:00
Fabian Kosmale
0477c78a04 QMetaProperty: remove property auto-registration code
Qt 6 automatically registers all types used in properties. Thus, the
functionality is mostly obsolete since Qt 6. We can simply return the
stored metatype's id instead.
The code in moc is kept in place for compatibility with older code,
though there seem to be no remaining users of the metacall in Qt itself
anymore.

Change-Id: I3c654150988ae7780b4e9ea1f16191fdadf8d791
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-09 14:02:57 +01:00
Fabian Kosmale
0af3d57980 qmetatype: Remove left-over module association code
Qt 6's metatype does no longer care whether the type is from Core, GUI
or a user metatype.

Change-Id: I4f41d44a61a9839f58b957219c2404512630587a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-09 14:02:57 +01:00
Fabian Kosmale
454a9424b7 qmetatype_p.h: remove unused function
Change-Id: Ib07e1c87e4e9fe5d1018876b044513fae951ac0e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-09 14:02:56 +01:00
Fabian Kosmale
348f67d7ec qmetatype.h: remove unused includes
[ChangeLog][Potentially Source-Incompatible Changes] The qmetatype.h
header no longer includes qvarlengtharray. It might be necessary to
include the header explicitly if code previously relied on it being
implicitly included.

Change-Id: If58245836715ec8a323ec8cbadc67d73a742b15f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-09 14:02:56 +01:00
Axel Spoerl
005f3ad625 Update widgets inheriting QAbstractSpinbox in tst_baseline_widgets
Create QAbstractSpinBox test
Update test for QSpinBox
Add tests for QDoubleSpinBox, QDateEdit, QTimeEdit
Add test for QDateTimeEdit incl. calendar popup

Task-number: QTBUG-99677
Change-Id: Ia74686f47a1520ab4c7e878b19fc774e00db88dd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-09 08:01:46 +01:00
Shawn Rutledge
49d3080155 xcb: Show valuator atom names properly in categorized logging
During a touch update, this looked questionable since I don't have any
barcode readers or buttonboxes attached:

XI2 touch event type 19 seq 1481 detail 193 pos  116.3,   77.8 root pos 6476.3, 2941.8 on window 3e00006
   valuator              BARCODE value 47796.365791 from range 0.000000 -> 65535.000000
   valuator            BUTTONBOX value 59504.858830 from range 0.000000 -> 65535.000000
   touchpoint  193  state  QEventPoint::Updated  pos norm  QPointF(0.729326,0.907986)  area  QRectF(...

After the fix it's like this:

XI2 touch event type 19 seq 1235 detail 201 pos  154.0,   64.3 root pos 6168.0, 2794.3 on window 5000006
    valuator    Abs MT Position X value 45520.589958 from range 0.000000 -> 65535.000000
    valuator    Abs MT Position Y value 56519.790001 from range 0.000000 -> 65535.000000
    touchpoint  201  state  QEventPoint::Updated  pos norm  QPointF(0.6946,0.862437)  area  QRectF(...

ValuatorClassInfo's QXcbAtom::Atom is a Qt enum, which has to be
converted to xcb_atom_t before we can call xcb_get_atom_name_name.
Originally in ce2fe90faa vci was of type
XIValuatorClassInfo; then 7499d4404f
changed it to our ValuatorClassInfo struct, but didn't add the lookup
indirection to this qCDebug.

Pick-to: 5.15 6.2 6.3
Change-Id: Ib6107f17d6c6c209573e3df54149d6cfffc0b8b6
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-02-09 06:47:19 +00:00
Shawn Rutledge
cf2ec5a5fc doc: clarify that passive-grab API is only for Qt Quick Pointer Handlers
...for now anyway. The plan is to have C++ API for custom handlers
later on; and we'll see if we find any other "must-have" use cases.

Task-number: QTBUG-68110
Pick-to: 6.2 6.3
Change-Id: I5e624a500af37797345d25bb5f54b146b13a45ca
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2022-02-09 06:46:57 +00:00
Thiago Macieira
8058127a9d QLibraryInfo: remove load-time variable
Since this is only used by qtpaths and qmake, let's not make every
application pay the price of dynamically initializing a QString whenever
QtCore is loaded (which 100% of Qt applications do). Instead,
initializing a null pointer costs zero and is one third the size of
QString. Even the assignment in qmake and qtpaths is faster this way.

Pick-to: 6.3
Change-Id: I6fcda969a9e9427198bffffd16ce8d1eb8dc19da
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-05 11:57:34 -08:00
Fabian Kosmale
8b87c6f198 Blacklist tst_qscreen::grabWindow on Windows
Task-number: QTBUG-100412
Pick-to: 6.3
Change-Id: I8497cf31d690bc5fc22d808cba95254b7fedcc49
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-05 16:28:47 +00:00
Shawn Rutledge
6b2c9b81af Deprecate QContextMenuEvent and QMouseEvent ctors without globalPos
As with QHoverEvent, it's better to require globalPos rather than
"initialized to QCursor::pos(), which may not be appropriate" as the
docs have pointed out for many years now. This removes the remaining
calls to QCursor::pos() in event constructors.

Task-number: QTBUG-52430
Task-number: QTBUG-69433
Task-number: QTBUG-100324
Change-Id: I076dae56f37abaad7085cc95dddee453a80a45f3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-05 17:18:35 +01:00
Allan Sandfeld Jensen
a300c3810c Detect clang-cl features as clang not as msvc
Clang-cl supports the clang detections, and only approximates specific
MSVC version.

This works as the MSVC standard library is ahead of the clang standard
library. Where this logic was written 7 years ago when it was not the
case.

Pick-to: 6.3
Change-Id: Ic13e2f2fbcde011a0d8831cc48c0c9041bfe3b99
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-05 11:06:37 +00:00
Fabian Kosmale
e400ba64a3 Use acq_rel ordering semantics in qatomic_cxx11.h ref/deref
Change ref() and deref() in qatomic_cxx11.h to use acq_rel ordered
semantics as documented instead of the stricter sequential consistency
that was previously used implicitly.

It was pointed out in the discussion on atomic reference counts that
acq_rel semantics should be sufficient for reference counts. It also
turned out that that is all that the definition of "Ordered" in the
documentation really guarantees.

Original-patch-by: Kevin Kofler <kevin.kofler@chello.at>
Change-Id: I6cd50b34bdc699ff8b7c8fe6d303b28d71494731
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-05 07:26:55 +01:00
Marc Mutz
4d8cbf9863 QLibraryInfo: de-duplicate QT_BUILD_STR
The string was used as the return value of QLibraryInfo::build() and
also string-pasted into the format string in qt_core_boilerplate(). As
a proper substring (not suffix) of the format string, QT_BUILD_STR
could not be shared among the two users.

Fix by interpolating QT_BUILD_STR into the format string, so
QT_BUILD_STR appears by itself in both functions. The string should
now be shared, but compilers have quite low limits on lengths of
strings they will share, so turn the macro into an static function so
the actual string literal appears only once, guaranteeing
de-duplication.

It also feels a bit safer to interpolate the build string instead of
pasting it into the format string; it's not immediately obvious that
it cannot contain %s itself, even if we could expect a compiler
warning in that case.

Change-Id: I69d90c37c3a3dcf8ac46d4f36e7c0d2cf3b947af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-05 07:26:55 +01:00
Marc Mutz
64de057ebe QLibraryInfo: mark isDebugBuild() noexcept and CONST
It's literally

   return true; // or
   return false;

so it can be marked as noexcept and (the stronger form of) pure.

Change-Id: Id55fee1db5d18201be2ea6c6778ece3de68b05f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-05 07:26:55 +01:00
Mårten Nordheim
d32fb5f1fe QProcess(Win): change int to qsizetype where appropriate
Even if it's unlikely any of those would exceed 2 billion entries.

Pick-to: 6.3 6.2
Change-Id: Ib0d4d4e7a64fcde03b7f24bc0667d63c4a737deb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-05 05:18:44 +01:00
Christian Strømme
96f16e7487 Convert string tables in QShaderDescription to use string literals [1/2]
Avoid allocating all these strings on load. Part 1: tables.

Pick-to: 6.3 6.2
Change-Id: Ibf7af9aea0088efe68b247c68022b98143634616
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-05 03:55:11 +01:00
Marc Mutz
c3c2a0f754 QDBusAdaptorConnector: place a static int into BSS instead of DATA
The cachedRelaySlotMethodIndex started out as -1, assuming no slot
could have that index.

But 0 is just as good a marker, because we know that method index 0
will be one of QObject's (destroyed() or deleteLater()).

So start out with a zero initial value, which means the variable can
be placed in the BSS segment now and doesn't need to be stored in
DATA.

Pick-to: 6.3 6.2
Change-Id: I40b96d54f11e60348f465cafa15af98d41038c95
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-05 03:23:33 +01:00
Marc Mutz
7277ffee52 QCalendar: fix build
Apple Clang 12:

qcalendar.cpp:456:22: error: loop variable '[key, value]' is always a copy because the range of type 'QFlatMap<QString,
QCalendarBackend *, (anonymous namespace)::CaseInsensitiveAnyStringViewLessThan, QStringList, std::vector<QCalendarBackend *>
>' (aka 'QFlatMap<QString, QCalendarBackend *, (anonymous namespace)::CaseInsensitiveAnyStringViewLessThan, QList<QString>,
vector<QCalendarBackend *> >') does not return a reference [-Werror,-Wrange-loop-analysis]
    for (const auto &[key, value] : byName) {
                     ^

Change-Id: I54f205f6b7314351b078fffd16d05e5cd3ef4c22
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-05 01:26:14 +01:00
Sona Kurazyan
013d0fcf5f Fix a typo in QFutureWatcher docs
Pick-to: 6.3 6.2
Change-Id: I431d21e6161d117a7b2ee28ee9db955726d50f79
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-04 21:55:02 +01:00
Toni Saario
872bf376a7 Use common install functionality
Common module uses the qt-cmake-private-install to install.
This ensures all configurations are installed.

Pick-to: 6.2
Change-Id: I4be97685c25392838dbc7ab7c3526f55987c08e6
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2022-02-04 19:19:19 +02:00
Toni Saario
65358114db Conan: Fix is_used_value input
The option name should be passed instead of it's value.

Pick-to: 6.2 6.3
Change-Id: I74529c36c438f5d40ecd4dcf689b3ea2a100e5fb
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
2022-02-04 17:19:19 +00:00
Mårten Nordheim
3e3a109ef2 QLocale: Un-inline QString& constructor
Because it's BiC.
From the API review.

Pick-to: 6.3
Change-Id: I69f1fe58428241a876ae9058e8a0108a8e496c22
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-04 16:15:43 +01:00
Shawn Rutledge
bd71fb2514 QGuiAppPrivate::processMouseEvent: don't assume eventpoint didn't move
During delivery of a pointer event, another type might be synthesized
from it; and we are not yet "done" with all access to the original event
until the delivery of the synthesized event is completed. Further,
there could be a nested event loop if exec() is called on a dialog.
If QPointingDevicePrivate::pointById() causes activePoints to grow
(for example if we handle a fresh incoming touch event in the nested
event loop), reallocation could cause the persistentPoint reference near
the top of processMouseEvent() to be dangling by the time we get to the
bottom; so we need to call queryPointById() again to be sure to get the
persistent QEventPoint that is actually used in the current mouse event
to ungrab.

Fixes: QTBUG-97157
Pick-to: 6.2 6.3
Change-Id: Ib3b90eef5db691675b03474fd75981e972d11d2d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-04 12:33:25 +01:00
Eskil Abrahamsen Blomfeldt
26a0638222 Fix infinite loop in dash stroker
When the positions were large enough, we would get precision errors
with the floating point numbers.

We calculate the relative position:
  dpos = pos + dashes[istart] - doffset - estart
and then later
  pos = dpos + estart

If estart is a huge number (range of 10^18) and dashes[istart] is
a low number (10^1), then estart + dashes[istart] == estart and
the loop will never progress, dpos will be 0.

Since the loop should never iterate more than dashCount times
(since we cut away all full dash sequences before entering it),
we add a failsafe that exits the loop if it detects the error.

Fixes: QTBUG-99690
Pick-to: 5.15 6.2 6.3
Change-Id: Ia6a42f21b6b4c6adf5cdd703b6483750513a88ba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-04 12:02:45 +01:00
Janne Juntunen
c984a9bf07 tst_qresourceengine: use QFINDTESTDATA() to find correct path
Use alternative method for finding searchPath since
QT_TESTCASE_SOURCEDIR did not point to a correct location on webOS
QEMU test environment.

Fixes: QTBUG-99954
Pick-to: 6.3
Change-Id: I05f95b4aa02027976036d0842ca564a602e01d0e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-04 11:02:07 +02:00
Thiago Macieira
4a93285b16 QtCore: use C++11 thread_local instead of QThreadStorage
It's more efficient than our QThreadStorage and definitely much better
than the Q_GLOBAL_STATIC+QThreadStorage solution. We can do this because
the last compiler not to have thread_local support was MSVC 2013, which
is no longer supported since Qt 5.11.

QThreadStorage also managed the lifetimes of pointers for us, so the
equivalent thread_local requires std::unique_ptr.

Change-Id: Id59bdd8f1a804b809e22fffd15405f1b394c48d8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-03 19:58:36 -08:00
Thiago Macieira
de6ced6692 QCborValue: fix incorrect to{Array,Map} when the value is empty
When QCborValue referred to an empty array or map, toArray() and toMap()
would respectively return the default value instead of the empty object,
as expected.

Pick-to: 6.2 6.3
Change-Id: I5e52dc5b093c43a3b678fffd16b60456d0037ad7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-03 14:45:46 -08:00
Marc Mutz
1e62f08998 QBuffer: exterminate three thread-safe static guard variables
Instead of duplicating two dynamically-initialized statics each in two
functions, causing four threading guards to be emitted by the
compiler, pack the two variables into a static struct and the struct
into an Extracted Method, leaving just a single threading guard.

https://godbolt.org/z/a9e5o848f

Uses C++14 NSDMI-in-aggregates, so doesn't work in 5.15.

Pick-to: 6.3 6.2
Change-Id: I98e053df48aafd5720ceffd514d6811fd3b28b1a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-03 22:12:06 +00:00
Alexandru Croitor
bb9be22133 CMake: Fix rpath set for Qml plugins to not contain lib64
Qt6QmlMacros uses the value of GNUInstallDirs's CMAKE_INSTALL_LIBDIR
to calculate the rpath from a Qml plugin's location to the Qt
libraries.

By default CMake detects the value of CMAKE_INSTALL_LIBDIR, and on an
RHEL system it is set to 'lib64', whereas we usually configure Qt with
the lib dir set to just 'lib'. This might cause issues with Qml
plugins not locating the Qt libs due to an incorrect rpath.

Ensure that when building Qt libraries and plugins,
CMAKE_INSTALL_LIBDIR is set to the same lib dir value that Qt was
configured with.

Pick-to: 6.3
Fixes: QTBUG-99707
Task-number: QTBUG-100432
Change-Id: I17b2a22d46ef3b40084a2f6a4992f0e23b35d4d3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-03 21:55:38 +01:00
Marc Mutz
40828992eb QCollator: port from QString::compare_helper to QtPrivate::compareStrings
The call becomes simpler, and QCollator no longer needs to befriend
QString.

Pick-to: 6.3
Change-Id: Ie2c977dc39973423f07563a0702a83fa3c75270d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-03 21:21:29 +01:00
Alexandru Croitor
acaba63260 configure: Raise error if -skip/-submodules is used in per-repo build
Specifying the options would do nothing, so it's better to error out
early in case the developer accidentally added them.

Pick-to: 6.2 6.3
Change-Id: Ia516468a22c3c48e9e84dc78e522e8870186d96b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-03 21:21:29 +01:00
Alexandru Croitor
7cb2bbd9e7 configure: Introduce -submodules option
The option is used to specify a list of Qt repos (git submodules)
that should be included in the configuration of a top-level Qt build.

The option takes a comma-separated list of qt submodule names e.g.
'qtbase,qtsvg,qtdeclarative'

It can also take a single value like 'qtbase' or 'qtquick3d'.

Each specified submodule and all of its transitive dependencies will
be included when configuring the top-level Qt build (assuming that the
submodules have previously been already checked out).

Any missing submodules or dependencies will not be automatically
checked out, but rather skipped. This can result in a failed
configuration if a required submodule is missing.

If some optional transitive submodule dependency is not desired in the
build, you can combine the -submodules option together with -skip
options.

E.g. configuring with

  -submodules qtdoc,qtnetworkauth -skip qtmultimedia,qtimageformats

will result in a top-level build with the following  submodules:

 - qtbase (common dependency)
 - qttools (dependency of qtdoc)
 - qtactiveqt dependency of qttools)
 - qshadertools (dependency of qtdeclarative)
 - qtdeclarative (explicit)
 - qtnetworkauth (explicit)
 - qtdoc (explicit)

Pick-to: 6.2 6.3
Fixes: QTBUG-100388
Change-Id: Ie8c47cfd1d1e0e44a27260bf9ddf968531cc1cc0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-03 21:21:29 +01:00
Alexandru Croitor
40155ddd0e configure: Allow specifying a comma separated list to -skip option
This makes skipping a list of submodules more concise.

e.g. instead of passing

 -skip qtsvg -skip qtimageformats -skip qtmultimedia

pass

 -skip qtsvg,qtimageformats,qtmultimedia

Pick-to: 6.2 6.3
Change-Id: I6a48828b2fd7cec9f6e19988f7b4033333768abb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-02-03 21:21:28 +01:00
Alexandru Croitor
b43528ea00 Fix mach_port_t not being found
Fixes errors like
In file included from
qtbase/include/QtCore/6.4.0/QtCore/private/qcore_mac_p.h:1:
qtbase/src/corelib/kernel/qcore_mac_p.h:61:9:
error: unknown type name 'mach_port_t'

Amends e05300163e

Pick-to: 6.2 6.3
Change-Id: I8f4c579e9b8ef187859497361c4e126a486a543c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-02-03 20:05:05 +01:00