Commit Graph

50123 Commits (9f331f89ea3af80dbac8fe4295cefd8fc2d45d80)

Author SHA1 Message Date
Alexandru Croitor 9f331f89ea CMake: Fix SBOM error for corelib
The siphash qt_attribution.json file was moved to the 3rd party
directory out of corelib, without adjusting the attribution file dir
path.

Amends da2d3e914c1b3f9da17c40502c8e7c1463d35612

Change-Id: I25cf9b9f19bc596898d51449ef9561eb9882a046
Reviewed-by: Orkun Tokdemir <orkun.tokdemir@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0b0b30f7cf900ea0463f4073f0e82d014920fd1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 12:45:12 +00:00
Kai Köhne 5b2fda4357 Doc: Replace mentioning of non-existing Qt permissions API
\l is your friend to detect incorrect links.

Pick-to: 6.7
Change-Id: I347cb3c80664c89183523b683d3f988a1f4ab978
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d05399c9932e3f00a2f4137a373552b1e781102d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-10 09:53:33 +00:00
Thiago Macieira 1ef5911d28 QPluginLoader: set an errorString if resolving qt_plugin_instance fails
We're getting load() == false but errorString() == "Unknown error".

Not backporting past 6.8 because of a new translatable string.

Change-Id: Ic0adfa808d28487a8303fffd17d9ee19ce074e4b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 2be44b57da951007ecab4d6c9e4bc2f3b5cd067a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 14:24:35 +00:00
Edward Welbourne eaa78fb2b1 Fix sameLocale() assertions in qlocale.cpp
The assertion is about entries at the same index having matching
language, script and territory tags. I forgot that the system locale
has its m_index set to match the closest-matching CLDR data table, so
might not have the same tags as the locale_data[] entry at its given
index.

Fixes: QTBUG-126390
Change-Id: Icb8cc09cc2a9d66a0af301a300f44923d7400ce9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1df1c0b6fdc40a3cb9e89c4d07adc89c37c7582b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 10:13:08 +00:00
Giuseppe D'Angelo 159d63edb5 PDF: add a way to customize the output intent
PDF/A-1 and PDF/X-4 require the use of an output intent. Insofar this
has been hardcoded to be sRGB. Instead, expose the relevant setting so
that the user can choose another colorspace, and set the metadata
about the intent.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

[ChangeLog][QtGui][QPdfOutputIntent] New class.

Change-Id: Ib3f0620477ddcc8b294a7039c120e89cc318f513
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit e8fcdf9bb6318e75d64179a6682481154cdef14f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 07:58:24 +00:00
Kai Köhne e309f0b013 Core: Move SipHash implementation into separate file
Isolate the code inspired by the SipHash reference C implementation
in a separate file. This makes it clearer what code is available
under the CC0 license, and which not.

[ChangeLog][Third-Party Code] Adapted copyright information for the
SipHash Algorithm (used in Qt Core).

Change-Id: I9b8fc27a4e791c0f1ccbdfa6244d4fa47c7a219b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit da2d3e914c1b3f9da17c40502c8e7c1463d35612)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 07:58:23 +00:00
Friedemann Kleint 0925c2d80a uic: Relax property name checks
Use an approximation of the "Unicode Standard Annex #31"
for checking the property names and enumerations.

Remove check for dynamic properties and use character literal
formatting for them instead, which will escape offending characters.

As a drive-by, use QStringView parameters for the check function.

Amends 53c8d1fe7c59f3462b85193b688d02ff353b51d5.

Task-number: QTBUG-126265
Task-number: QTBUG-126860
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I90fe555e64327e4164a17c1af0a734e4b1d834db
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit aae20da52a11e0ebb8c4f5fcfb95ce6744f659a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-09 05:41:05 +00:00
Edward Welbourne bc28d6d48c Kludge round macOS 15 knowing more about offsets than transitions
Darwin turns out to know about offset changes a million years into the
future, but to not admit to there being any transitions more than (a
bit over) half a million years into the future. It thus failed the
non-ShortData part of tst_QDateTime::timeZones(), thanks to using
correct offsets that showed there must be a transition in the
interval, but not believing in that transition.

The discrepancy leads to QTimeZonePrivate::stateAtZoneTime() getting
valid data for before and after the transition, with different
offsets, so amend its "no later transitions" early return to check the
offsets do in fact match. If they don't fall back on the code that
handles the case where we don't know about transitions but do have
offset data.

Pick-to: 6.7
Fixes: QTBUG-126391
Change-Id: Iefda439377ebc3025f2b754e2ec686fcc6361a1b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit cb870adad612018e7007f4a1b6066b49d0f2dc4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 20:19:08 +00:00
Giuseppe D'Angelo 9cc291fe94 PDF: code tidies: sort includes
Change-Id: I78764e2517b39d0ca7ec8fdb41f8344ed876ee27
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d69a1e8e626c33d9e8eb5c62fc13ead51ceb49bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 19:44:38 +00:00
Giuseppe D'Angelo a30591603b PDF: add support for PDF/X-4
PDF/X-4 is a subset of PDF 1.6, aimed at printing fidelity. We can
support it with a few refactorings of the existing code in
QPdfEngine.

* Add the new PDF version to QPagedPaintDevice / QPdfEngine.

* Always write the XMP metadata, no matter what's the PDF version
  used. XMP used to be written only for PDF/A-1b, but it's supported
  by PDF 1.4 and 1.6 so there's little reason not to write it.

* While at it, ditch the search&replace approach for the metadata
  and use QXmlStreamWriter instead, since it gives us extra
  flexibility that we need (emit different tags depending on the
  PDF version in use).

* The old code had a bug where the timestamps in the XMP metadata
  and the document information dictionary could fall out of sync.
  Just use one datetime object in both places.

* Add /ModDate and xmp:ModifyDate (required).

* Add the required attributes in the xmpMM namespace.

* Add a way to set the document ID to a custom UUID, and use it
  in the XMP metadata as well as in the /ID in the trailer. Emit
  the ID unconditionally, as it's been available since PDF 1.1.

* Emit the output intent for both PDF/A-1b and /X-4. This will be
  amended in a future commit to let the user choose the colorspace.

The only missing bit is §6.5.4 of the PDF/X-4 spec. This imposes that
all symbolic TrueType fonts shall *not* specify an Encoding, and have
exactly one encoding in the cmap table. This is basically requiring what
§5.5.5 in PDF 1.6 only suggests (page 400). However it seems that we are
not embedding a cmap table when extracting a font subset, and that's
already violating PDF/A-1b anyhow. This is tracked by QTBUG-125405.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

[ChangeLog][QtGui][QPdfWriter] Support for PDF/X-4 has been
added.

Task-number: QTBUG-125405
Change-Id: Ia81f29b07b819eca5767c9f17692d92a3010f5ad
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2fbece8a73cb2d2692c78c38e1576c0c9c62fce7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 12:46:00 +00:00
Marc Mutz 19fbb338b8 Long live Q_DECLARE_SHARED_NS!
We used to mark Q_DECLARE_SHARED all our value classes in Qt 4 times,
but since many Qt types these days live in nested namespaces that
macro, which only works in the QT_NAMESPACE, has become less useful.

As we use it in more and more places and eventually add more
responsibilities to it, we don't want every module to define its
version by hand, like QT3D_DECLARE_SHARED did in 2016 already.

So add two namespace-aware versions of Q_DECLARE_SHARED, to be used
inside or outside nested namespaces.

Extend the test.

Despite the name, this is not a public macro.

Found missing Q_D_S in API-review, so picking this to 6.8 to aid with
fixing the 6.8 API.

Change-Id: I367ca0d5b005b64090de44f7b7541d8639f9a4e0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 37b2b2ea4ef3cf494d23885de186a9519763e744)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-08 11:29:50 +00:00
Nicolas Fella f57d5c492d FileChooser portal: Store directory as QUrl instead of QString
Otherwise we lose the scheme when reading it back as QUrl

Pick-to: 6.7 6.5
Change-Id: Ice6e083611c93641ef33f00fa48f1b32dc25f718
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 46ffca13fb0705c54ad05bc2c1a37f7d5fb5132d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 23:00:39 +00:00
Tor Arne Vestbø 705dbea2a9 Call QWidget::setVisible, not QWidgetPrivate, when showing children
As part of 5ba0982b28 we started calling
QWidgetPrivate::setVisible instead of QWidget::setVisible when showing
children, to avoid setting ExplicitShowHide.

Unfortunately some widget subclasses wrongly override setVisible to do
initialization, which resulted in these widgets not running their init
code. The documentation clearly specifies to use showEvent or Polish
for this use case, but to avoid a regression we temporarily set a flag
that prevents QWidget::setVisible from setting the ExplicitShowHide
attribute.

We can not rely on simply unsetting ExplicitShowHide after our call
to QWidget::setVisible, as the call might recurse into logic that
checks ExplicitShowHide and wrongly determines that the show is
explicit.

Fixes: QTBUG-126721
Fixes: QTBUG-126218
Pick-to: 6.7
Change-Id: Ibf88340b68cb4fcb20ce3d8ec5b76de0fd2d2551
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fc4c6fb5f6bd6bd63b13f1f8b5b7a7289a5fd230)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 09:03:17 +00:00
Tor Arne Vestbø f31e7385c1 macOS: Respect QWindow frame positioning on first show
When the QCocoaWindow is created it picks up the QWindow geometry,
and applies that to the NSWindow it creates. But since we haven't
created an NSWindow yet for the first step, our logic to adjust the
window geometry when the positionPolicy is WindowFrameInclusive is
a noop. As a result the NSWindow gets a client geometry corresponding
to what the user requested as the frame geometry.

To fix this we hook into [QNSWindow setContentView:], where we apply
QWindow properties to the NSWindow after creation.

The tst_QWindow::positioning test has been split out into a separate
framePositioning test.

Pick-to: 6.7 6.5
Change-Id: I85fe6ad10aee8346202de3d55d6b2cd89915c5df
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 31ec108dd08d6381a15e49b6fbec9337705c3b2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 09:02:39 +00:00
Friedemann Kleint 8fc29f208b uic: Fix some clang-tidy warnings
- Repeated return types
- Make member functions static
- narrowing int conversions
- Use auto *
- Use list.isEmpty()
- Use modern includes
- Remove redundant access specifiers
- minor fixes

Change-Id: I14ddf1add667536739fbb5fabb357dbaa7ef35c3
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 6346c5b426935a767575ea758e99749bc6544f54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 11:53:00 +00:00
Marc Mutz 03f2dfca7c QString: de-pessmize QString(QLatin1StringView)
Instead of default-construction followed by move-assignment, delegate
to the move ctor instead.

We can't expect the optimizer to do this transformation for us, since
fromLatin1() is out-of-line and compilers are not, yet, known for
optimizing atomics (ref-count) around out-of-line function calls.

Amends 6abdbb65e5.

Pick-to: 6.7 6.5
Change-Id: I75b747c4d5269ae125bf12cda57a1f718aa7a467
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit f7853680ef68ce2495662ffc7c7a933655436f22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 11:52:57 +00:00
Marc Mutz 8a17835180 Long live QT_DEFINE_TAG(_STRUCT)!
We seem to be using more and more of these, and their definition is a
bit subtle (need to have an explicit default ctor to avoid {} being
an initializer for the type).

Port the existing tag structs over to the new macro and add a test,
even though we found two users of QT_DEFINE_TAG in QtBase alone, one
of which is actually widely used (Disambiguated_t). There are more in
other modules.

Change-Id: I046bb2b70a2c7e79be2315d91c43e5fd2f0968a0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 74a87a329498422db0dea3e469fb84704accbb2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:55 +00:00
Marc Mutz 377b4df13b [doc] Q(Persistent)ModelIndex: document behavior of data() on invalid Q(P)MIs
We return a default-constructed QVariant. What else could we possibly
return? Right: nothing else.

So document it and add a test.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: If9808703b8ddfd15ceb013996741af8cd4efea12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d1a5e602df5978cee6bd263db77745f8047e508e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:53 +00:00
Marc Mutz 056c89e95d QRestAccessManager: don't leak slot objects when no QNAM was set
We try to pass QSlotObjectBase as raw pointer through the ABI
boundary, because we hope to have the template-wrapper tail-call the
out-of-line helper¹. But that means that the out-of-line helper needs
to ensure that it deletes the slot object on every possible exit from
the function. The old code didn't do that e.g. when the qnam check
failed, or, theoretically, if requestOperation() threw an exception.

The new code places the slot object under SlotObjUniquePtr guard as
soon as possible (but, due to amount of callers, not before
executeRequest()). Port createActiveRequest() to receive the slot
object already in a smart pointer. Tail-calling isn't required here,
because caller and callee are part of the same TU so the optimizer can
do whatever it wants. Unique_ptr passing shouldn't be that hard to
optimize.

¹ If we were to pass by SlotObjUniquePtr, tail-calling would be
  impossible due to the need to run the unique_ptr's dtor after he
  call to the helper.

Amends 9ba5c7ff6a, but
e560adef21 already had the
requestOperation() problem.

Pick-to: 6.7
Change-Id: I2ab5eadb35625393f274e3391d7b7c393ed8f08a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 11725d46344105325a1dec8628708ab88483ca12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-06 10:17:48 +00:00
Ahmad Samir e37832cc37 QDirListing: const_iterator: mark the relational operators noexcept
Pointed out in code review.

Change-Id: I7754f510f4cca5e9fc695a26caaf124133602f32
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9a8768c7159869aa216b7328c69f4b80f26f467e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:22:06 +00:00
Marc Mutz e6fc32a9c5 QArrayDataOps: fix appendUninitialized()
... to be strongly exception-safe and call placement new correctly.

The old code could call user-provided overloads of new, because it
didn't cast the pointer to void* before calling placement-new. It
would also "randomly" stop when an exception was thrown. It correctly
updated the size of the container only after successful construction
of the element, but that's just weak exception-safety. There's no
reason this operation shouldn't be strongly exception-safe.

So instead of a raw loop around raw placement-new, use the
corresponding raw memory STL algorithms. They handle exceptions and
call placement-new correctly, and the code is both simpler as a
consequence, and more efficient, as it updates this->size only once.

Found in API-review.

Amends 73bf1c1a9b.

Change-Id: I535f393a3c378e1eea104bd3a05a274b9ec17964
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f699248c0f3ad44f09a422304870f40c1998a1a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:22:05 +00:00
Tor Arne Vestbø ea1978c7f9 visionOS: Report size of root view as screen size
Even though we've decoupled QIOSScreen from managing UIWindows, we still
have one UIWindow per screen, so we can pull out the bounds of that root
view to determine Qt's screen geometry.

Change-Id: I05993ad6d629dd2158681dd17355b7e216bfbb49
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 16483487c4e37546cf296a72e137d49d28b55e05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:22:02 +00:00
Mate Barany 63ad52d991 Add the nodiscard qualifier to the constructor of NetlinkSocket
This is a RAII class the result of the constructor call should never be
discarded.

As a drive-by made the constructor explicit.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I651dda87b5191d50e111732d11bab8d5aa58e9af
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b9511f582a37b6dfc58d7ce9c2526565cda655c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:12:04 +00:00
Tor Arne Vestbø 02fd2c19fd macOS: Add missing product names for QSysInfo::prettyProductName()
And restructure the logic a bit for easier maintenance in the future.

Pick-to: 6.7 6.5
Change-Id: I6ff7396378bf02e177a4fb06978683474a79ad2f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 61b70bd7de91a2aab8609e1f878043d2aceb6bfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:32 +00:00
Mate Barany 16b0042dc6 Use non static data member initialization on errorcode in QSslContext
Address the "A constructor must initialize all data members of the
class" warning.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I46a7dd358d107670846fa35c0b02d2591258438d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 69bf95e2e05fb1ded0d74a7ebc5fa112e0854a5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:32 +00:00
Mate Barany 16f95639a1 Initialize the ssl variable in QHttpNetworkRequestPrivate
Address the "A constructor must initialize all data members of the
class" warning.

Found by an Axivion Scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: If78cde6a9c3771eb87e62729523b848f2efc2d83
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6c755dcdd921431b26d22d499ebebb2a0b7de566)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Mate Barany 04787eef80 Apply the PIMPL idiom to QFormDataPartBuilder
Change QFormDataBuilderPrivate to store a vector of
QFormDataPartBuilderPrivates and pimplify QFormDataPartBuilder such that
it stores a pointer to the QFormDataBuilderPrivate and an index into the
vector. This makes it robust against QFDP::m_parts reallocations and we
can make QFDBP copyable which has the benefit that if the user wants to
"go back" to an earlier part, she can do so by storing the result of the
original part() call by value.

Found in API review.

Task-number: QTBUG-125985
Change-Id: I56e9018e539457e9494751bdb62509f84a680889
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit aca8235c753d673abe7442cdf8b628fe4e05c471)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Joerg Bornemann 11592ad3fc CMake: Fix unity build for gcc < 13
GCC 12 erroneously yields -Wsubobject-linkage in a unity build.
Un-unity qresource.cpp for GCC 12 and older.

Change-Id: Ie3aced2668ec8aae797d89ce28a3e5917a6e8f88
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a06e54d2c88934f1511768d7254e12e6294e6336)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:31 +00:00
Ahmad Samir 4865577518 QTemporaryFile: de-duplicate docs wrt. file actually created on open
Change-Id: I64f87a8054d732d006599479bd6cca1be217700c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 88b7a043cf91d8730331eb43523f1d06cae365b6)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-07-05 15:55:31 +00:00
Christian Ehrlicher 03e6f3859a SQL/ODBC: properly set SQL_ATTR_CURSOR_SCROLLABLE
Setting a query in forward-only or scrollable mode was done with
SQL_ATTR_CURSOR_TYPE in ODBCv2. Nearly all ODBCv3 drivers also honor
this value but some don't and need the ODBC v3 conformant
SQL_ATTR_CURSOR_SCROLLABLE attribute instead. Fix it by setting both
attributes.

Fixes: QTBUG-126118
Pick-to: 6.7 6.5
Change-Id: I6d974b7b3e94113b0a87f1cc7f8cff0deb53642b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 730de6fbb09f082f32dfa355502551a0d6b8ae34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Christian Ehrlicher f7f5795ec7 SQL/ODBC: ignore empty connect options
Don'tprint a warning on empty connect options/when no connect option is
set. This ammends 5a03e5c51b.

Change-Id: I83ba8a34a3c08dc596c81ccb494f50af80f9b57c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 385c9397712b771e0f2c3f0a6322f0f624f09a8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Mate Barany cd732aaf36 Initialize the isCompressed member variable in QhttpThreadDelegate
Address the "A constructor must initialize all data members of the
class" warning.

Also, move the isCompressed bool variable next to another bool variable
to save some space.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I6f0e789a8188ff141ec7e4e4eb8a1823e8eea0d2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 13a04975fdc32ead6fe8dc78522e34de065c8908)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Andreas Eliasson 4a087d3e45 Doc: Add note about sortColumn() and sort() behavior
While available in their respective function level descriptions,
add a note about the behavior of the sortColumn() and sort()
functions in the sorting section of QSortFilterProxyModel's
detailed description in order to promote this information
to the reader.

Fixes: QTBUG-125718
Pick-to: 6.7 6.5
Change-Id: Ib7a3c206cd49b446b11063850d294da0811a282c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 014d2f075ebf811e560aad89a4e8de491e3a179c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:29 +00:00
Wladimir Leuschner 33c7170fcb QWindowsUiaProvider: Check for empty narrator string
In case of password fields, the narrator may return a emptry QString,
this was not checked when using operator[]. This patch explicitly checks
for an empty string returned by the QWindowsUiaProvider.

Fixes: QTBUG-126822
Change-Id: I9e2c3cfc5fb6dc9a7dd7badff4280f60b24c0a4b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 1ee349bf9d249ea45bc01c45473db44b9d335eed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 13:38:32 +00:00
Wladimir Leuschner b64031a6d1 QWindows11Style: Remove frame from ToolButton in QToolBar
Remove the frame of ToolButtons in QToolBar area when not hovered or
selected

Pick-to: 6.7
Change-Id: I11bd7b513871d6d1e0d9bfba761acf061f50e524
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 85c4084331a1049d3e2377f5516cd0d93819ac04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 13:38:18 +00:00
Marc Mutz d554f36017 QSpan: remove an unused tag type and variable
These seem to have been unused from the initial QSpan commit,
f82cf6333e.

Pick-to: 6.7
Change-Id: Ifa00d042e750145b688a238099506f56f96bad0b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 281044015ff62eaf1473a6fd5f79709b077e19fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 09:38:42 +00:00
Inho Lee 8d41b5a772 wasm: Revamp QWasmInputContext
1. Use QWasmInputContext by default
2. Use QInputMethodEvent instead of KeyEvent

Todo:
    1. Platform dependent preedit control
        especially when cursor moved with preedit.
        (Tested on Android, Linux, Windows)
        (Firefox still has a problem but it's not clear
        why PointerEvent doesn't happen.)
    2. Apply existing text to inputMethodQueries.
    3. Test on touchscreen devices.
    4. Test on IOS devices.
    5. When dragging selection, freezing
    6. Support context menu

Fixes: QTBUG-107139
Fixes: QTBUG-124932
Fixes: QTBUG-117096
Pick-to: 6.7
Change-Id: Iceb6af3489b3d1195ad58cf8f3deb91275fd1bf4
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit c844a7a5429e74d7cefb9774f288dbaa76fc2bbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 08:10:29 +00:00
Eirik Aavitsland aba84d1e6b QImage: retain color space also through right angle roatations
The color space meta data was retained through most image conversion
functions, but missed in the optimized code path for 90/180/270 degree
rotations.

Fixes: QTBUG-126575
Pick-to: 6.7 6.5
Change-Id: Icbd5aa71e88b4d2d79b00b3cadfe850e6714637b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit bea8beef85d1b5a163021ba4a671bbaddcc1738d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 16:15:34 +00:00
Volker Hilsheimer bf97701fd8 QJniArray: use comparison macros
Implement comparesEqual, declare the type as QUALITY_COMPARABLE.

Task-number: QTBUG-126150
Change-Id: I5a2371a850525dbf2e29fefa1a6cf85bb9b59cff
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b5ec0f7a4663f201167e856e5534d7fee5314e8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 15:05:11 +00:00
Mitch Curtis 4378364a50 QCoreApplication: give theMainThread an objectName to aid debugging
It can be hard to distinguish QThreads without object names when
debugging.

Change-Id: I42643495344063b7c05c7639dcc15c6600e617dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ba13bbd2d32652c8ffeef691c9a2ed3a7a65a82f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 04:47:27 +00:00
Ahmad Samir 7ad780e6f5 QTemporaryFile: de-duplicate API docs wrt. XXXXXX template usage
Pick-to: 6.7
Change-Id: I6180d82aab65788b897df4410d13e68f221193cb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6ccdb030ae8c604e6674d406036ad980f7767e45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 02:30:25 +00:00
Ahmad Samir b7170f97d4 QTemporaryFile: de-duplicate API docs wrt. default file name template
This also fixes a discrepancy in fileTemplate() API docs.

Pick-to: 6.7
Change-Id: Ie36278417406848db2a9759e996ce98b87d19f89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7fc2eae710c885e5152ed37c75fe6993c36c7171)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 02:30:20 +00:00
Ahmad Samir 9bccfb80bb QTemporaryFile: de-duplicate API docs wrt. note about rename() method
Pick-to: 6.7
Change-Id: I57bcf0b40785fd15aba0790673e7723b132f587c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit bf8fb9c3d94bfa9dcb3d0b181663bab245650ab3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-04 02:30:18 +00:00
Marc Mutz b0e9c0d740 QVersionNumber: add missing size check for comparesEqual()
The whole point of separating comparesEqual() and compareThreeWay() is
that the former can fail faster than the latter.

To wit: segmentCount() is an inline operation and, for the common case
of SSO storage, a single byte read. compare(), OTOH, is an out-of-line
call.

So compare the segmentCount() before calling compare().

Amends ecb0878cbc.

Change-Id: I3e46e73d4b8827532cc16428ca5e7f25bfa8608e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9bd3d39b3fe2d760b9c484663bdc6c863a68e22e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 23:28:55 +00:00
Marc Mutz a2d858febf QtDBus: don't detach in registerComplexDBusType()::Hash static destruction
The old code's use of ranged-for loop over a QHash would trigger said
QHash to detach. We don't require a detach here, so avoid this
unnecessary program shutdown slowdown using std::as_const().

Possibly-related: remove the pointless std::move() around QMetaType
passing - QMetaType is trivially copyable.

Amends 1697fbdf05.

Pick-to: 6.7 6.5
Change-Id: I7b8d404e93ae4dde71a30e22e9e2f56a4b5354fb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 167382beaad38fd7cbd9764abe76055544e61c20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 23:28:49 +00:00
Marc Mutz a22ae96ab9 QDBusSignature: de-inline the default ctor
It used to merely default-construct the QString member (which is just
zero-initialization), but since we discovered that we need to set
m_signature to empty instead of null, it's doing too much for inline
code (temporary QString (atomics), compile-time), so de-inline.

Amends ed6d1fa71a, but since this is
adding a new symbol on non-Windows platforms, only pick to unreleased
branches.

Change-Id: I610dad86ac4a080f5a45495ebc9536aa1d0bcbea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 271876bbcecedccf66179bc46c26e78d04732d6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 23:28:43 +00:00
Marc Mutz 9cc1825c0b QDBusSignature: fix default ctor to not allocate memory
The QDBusSignature default ctor is noexcept since
49f7281d36 (Qt 5.5-ish), so detach()
(which must needs allocate memory) cannot be used without breaking the
contract.

Fix by assigning ""_L1 instead, the canonical way to access the shared
empty state. While fromLatin1() isn't noexcept, fromLatin1(""_L1)
never throws.

Amends ed6d1fa71a.

Pick-to: 6.7 6.5
Task-number: QTBUG-124919
Change-Id: I5f0c3bdc199998deaa22971a60388f8f3ed0eaa8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 11dbf821942dbda6e53d7bfcf378904318634196)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 23:28:36 +00:00
Christian Ehrlicher 5910dd7fe0 Testlib: remove no longer used function call
QBenchmarkEvent::nativeEventFilter() was changed with Qt6 but the old
Qt5 version was still there and no longer used.

Pick-to: 6.7 6.5
Change-Id: Ia740ce0dc743666c9b3bcbe12d1d310fb9ffcd7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit ef215fdd8bd36c0312d657e0aafaa766d7c297f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 20:12:03 +00:00
Christian Ehrlicher 3a32bab2aa Fusion style/QProgressBar: don't ignore the paint offset
The progress bar drawing only works correct when the topLeft corner is
at 0/0 therefore we have to translate the painter to fix the drawing in
such a case.

Pick-to: 6.7
Task-number: QTBUG-126426
Change-Id: I51086dab65cc0d4a360ee539e59e3f3f4af2a375
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 369b5a3194f69072a961283c4d5e19395e0d8b06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 20:11:59 +00:00
Thiago Macieira bcfa650ced QUuid: simplify the three-way comparison functions to make them constexpr
While retaining the old sorting order, this allows us to simplify the
ifdef'ery and produces much better code.

With Clang, an equality check is
        vmovdqu (%rdi), %xmm0
        vpxor   (%rsi), %xmm0, %xmm0
        vptest  %xmm0, %xmm0
        sete    %al
in C++20 mode.

GCC generates four 64-bit loads instead of using vectors:
        movbeq  (%rdi), %rax
        movbeq  8(%rdi), %rdx
        movbeq  (%rsi), %r8
        movbeq  8(%rsi), %rcx
        movq    %rdx, %r10
        movq    %rax, %r11
        movq    %r8, %rdx
        movq    %rcx, %rax
        xorq    %r10, %rax
        xorq    %r11, %rdx
        orq     %rdx, %rax
        sete    %al
(the four MOV in the middle don't seem necessary)

For the sorting case, the compilers need to generate extra code
because of the check on the variant, something I'm scheduling for
removal in Qt 7.0. For long-term sorting code, both GCC and Clang
generate four 64-bit load-and-swap-endianness instructions, but Clang
for some reason also kept the 128-bit vector code (I'm guessing it's a
minor optimization bug that will be corrected in due time).

Change-Id: I46feca3a447244a8ba19fffd17dceacc8e528c3e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 15f753ca5a60b5273d243f528978e25c28a9b56d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 19:34:09 +00:00