Disable text painting, when current item in ItemView is in editing mode.
Respect custom set background colors for items in ItemView.
Fixes: QTBUG-119501
Change-Id: I0cc80459e67765b2e648aa438aabc7dc18bef4a9
Reviewed-by: Chris René Lerner <chris.lerner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 5d590a38d96206bcf5ad6ffe2b156223dc909fd7)
The docs claim that QThreadPool always creates at least one thread.
However, the user can (usually by mistake) request zero or a negative
number of threads.
The maxThreadCount() function is simply returning the value, that was
requested by the user.
Since it's a public API, it is used in several places in QtConcurrent,
where it is assumed that the value is always positive. This can lead
to a crash if the user sets zero as a maxThreadCount.
Update all such places with std::max(maxThreadCount(), 1).
Prefer this approach over changing the return value of
maxThreadCount(), because its behavior is documented and tested.
Amends 885eff053797d56f2e295558d0a71b030fbb1a69.
Fixes: QTBUG-120335
Pick-to: 6.6 6.5 6.2
Change-Id: Id3b2087cec7fbc7a2d42febca6586f2dacffe444
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 936e72d18075b79c8d29353618dfbd052ae59dae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We used deleteLater(), which was triggering ASAN use-after-free error.
Apparently, what could happen is that after the context was destroyed,
we called deleteLater(), but if at this point the previous future got
finished, we still tried to emit watcher->run() to execute the
continuation. And then the watcher got deleted.
This patch replaces deleteLater() with a plain delete call. This looks
safe, because the watcher is only accessed while holding the lock.
Amends 59e21a536f7f81625216dc7a621e7be59919da33.
Fixes: QTBUG-120302
Pick-to: 6.6
Change-Id: Ia32f20bfe8daea2e2346f3d446c978ae305d2f68
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 11333a097290e4247b27adbfd024d5aa964bed35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QtOrderingPrivate::reversed() in qCompareThreeWay() to avoid
conversions to Qt::partial_ordering and Qt::strong_ordering.
Task-number: QTBUG-119433
Change-Id: Ia42bda518dcf23f5332cac9bb8d50baebef67e55
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 0995358efabc91504f2ede20c724307358f9a276)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add the setting of the layout's size constraint to 'fixed' back to the
snippet, so that the dialog automatically resizes when the extension
gets hidden. The user won't be able to resize the dialog, but allowing
the user to resize the dialog and to show and hide the extension anyway
leads to unpredictable results for the user.
Amends 11da92ba94570e5eec01597fe09f0a9a48acc677.
Pick-to: 6.6
Change-Id: Ie74ca36eaa1a8e9567e0d5826f91f8633e5cbc05
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 51a1dfe72ddd922cd6caf28d532b3311db767989)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Port all string-based signal/slots connections to pmf-style connects.
Change-Id: If1075a5a8a4d018e060e7d18ee59c8fc4c0a5207
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7dd4a7b2133b9a6aa4f67a3ff5760303af68ac54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Port all string-based signal/slots connections to pmf-style connects.
Change-Id: I4ebabf1b117f86f39d3875965efa8ee5042bce84
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b71aa162c00ff180cc946b8fd6c9c670d04ec262)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Port all string-based signal/slots connections to pmf-style connects.
Change-Id: Ic7ecfd1efb8eb76239598e48f25251357040f814
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit fb58a3aabe8ff9956560dea64c91cd8727da839d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Port all string-based signal/slots connections to pmf-style connects.
Change-Id: I7d77c2a10ed0c27422893403dfc9c5a6d43ea798
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e5c40ec5c117376f401c01069f05780046d07094)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Port all string-based signal/slots connections to pmf-style connects.
Change-Id: I975232a3fedf82cd3327638a0ee119d1f2a90d84
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bbdc8afa116155a9e8353f1d39af19a2228e3412)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Port all string-based signal/slots connections to pmf-style connects.
Change-Id: I6121e727c2730f9e5947f9f3b7550903bb17aee0
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e03e2e9886ad36f7c3cc0eafd75be81a84f955ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Found in API-review
Change-Id: Ib047c79d977ad6870c1e426cd1add994a3634df4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 723ab99b1ac55c8d32a93ea80224d7ffb22f7893)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't depend on transitive includes and forward declarations.
Found in API-review.
Change-Id: I61b9517453f164391abb9254d92e7ea38051e730
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit fbe29fb3684b02bec5f6019755d0a1bb0c94c275)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The json return type and function naming has gone back
and forth. Let's go with QJsonDocument after all, and add new
overloads in future if necessary.
Task-number: QTBUG-119002
Change-Id: I3f9de0e6cba7d5c52d016d252d65b81f345af050
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1702a37a3955f449210fe3874cfcd35bb08417ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
One might want to add an accellerator to dockwidget titles to be used in
contexts that isn't directly the title, but still uses the title.
Dockwidget title accelerators doesn't work in dock widgets, so don't
show them.
They are still available in e.g. a right click menu on a dockwidget to
hide/show, and here the accellerator might come handy, and also if a
dockwidget is tabbed.
Pick-to: 6.6
Change-Id: I196e1aa92a5c53fed735b598653c267509f788b8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
(cherry picked from commit cc67b25579c1bb5ea9f5c1ca4c9b7997e66f19b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fix allows using multiple executable targets in a single
CMakeLists.txt when building for android. Previously artifacts for both
targes were collected in a common android-build directory, that led to
artifacts overlaping and broke the deployment process.
Users need to set the QT_USE_TARGET_ANDROID_BUILD_DIR to TRUE to enable
the new android-build directories naming.
This change need QtC adjustments that will take a new directory naming
into account.
Task-number: QTBUG-117443
Pick-to: 6.6 6.5
Change-Id: I47568798e2a2e8550ddab1990a33611967183761
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5f0575256a4af14c1f2f9a846e40cd9490c12b56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It looks like resource object targets don't need AUTOMOC as well
as other AUTOGEN tools. The only source file skips autogen explicitly,
but AUTOMOC requirement is added to the resource object targets anyway.
This disables all AUTOGEN related properties explicitly for all
resource object targets.
The problem occurs when building top-level Qt with the static library
that uses resources in tree.
Pick-to: 6.6 6.5 6.2
Change-Id: I5c968a3e34c881e7fbc5589626ab02b3b1e53968
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit dd4c14104cfab6330b31937acf2b2f120ef940a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... and the getter to isPositionalBindingEnabled() for QSqlQuery and
QSqlResult.
This amends e532933a2a9ff0219f0179880e05c95e0ec5e19d
[ChangeLog][QtSql][QSqlQuery] Add setPositionalBindingEnabled() to be
able to disable positional binding.
Task-number: QTBUG-119952
Fixes: QTBUG-120548
Change-Id: I0a0afb652d0fc9421f5692b0927a66b2a9b7b854
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit b1e5d9275d4cf6152e4e9456b1bc2d585a5512e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Optimize the painting of the tickmarks by collecting all lines to draw
in a vector and then passing all to the painter instead calling
drawLine() for every single tickmark.
Change-Id: Ic75e733a02fbf6143d21d4630f6a6d6de913f16c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 83ab7d21150115fbbe954af7d87f1597bf65d206)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The outline color was modified under some conditions but used afterwards
independently from this condition which lead to a wrong tickmark color.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I45baf9127aea96bfe84a7410dd592a084f14f13c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e9438da42a2ce3c470df01f82245dbfa7901f8db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Do not downscale the icon used for QSystemTrayIcon even though the msdn
documentation states that SM_CXICON/SM_CYICON should be used as the
size to avoid blurry icons in the notification.
Pick-to: 6.6
Fixes: QTBUG-103825
Change-Id: I2d466e895254aa3c41682290cc7864632c57d5d7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 94809cdec004611bdb8531304e6c74761014876b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Sync iconFromWindowsTheme() to use themeHint(IconPixmapSizes) similar to
iconFromMacTheme().
Pick-to: 6.6
Task-number: QTBUG-52622
Change-Id: Id06454b010b1946ee0565190672ee8624cffe2de
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4d2802702e519c7513440ea485b19ff611696fa1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A null QString / QStringView has a null begin pointer stored as its
array beginning (something we hide a little in the QString::data()
function, but not in QStringView::data()). We've been passing a null
pointer to memcpy() every time someone passed a null QStringView for
QString's single-argument arg() call, though not the multi-string arg()
version (which is the only one QStringView offers).
Commit f5021835dfb4b0bf974794b598cbdf9f0f95898d made this worse by
making QStringViews created from null QStrings retain the nullness (as
was intended).
Fixes: QTBUG-120624
Pick-to: 6.6 6.5 6.2
Change-Id: I6e2677aad2ab45759db2fffd17a870639b19340b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d351a97e85e5ed8acd7ad1357ef76dc2e0ad639f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Change the best practices to how-tos, which are categorized
now on a new page.
Fixes: QTBUG-118044
Pick-to: 6.6 6.5
Change-Id: I78dba2a1fde03b346f110ecd54e11485a0869540
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 7372b3ab6748b68f1c5fba1f61df8083ce719bc5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This change updates getOpenFileContent to provide a parent when the
non-WASM fallback to a QFileDialog is created, which avoids issues
where this call is made inside another application. Specifically,
if a QDialog is created lacking a parent to the main window, it will
prevent interaction with that dialog. This patch addresses that problem
with window modality.
This change also updates saveFileContent to provide a parent for
the fallback mechanism, so that both static APIs that interact
with WASM/non-WASM dialogs have comparable behavior.
The new parent argument is updated in the documentation. Documentation
is clarified in terms of usage outside Qt for WebAssembly.
[ChangeLog][QtWidgets][QFileDialog] Adds an overload to the
static methods getOpenFileContent and saveFileContent with a
new parent argument which always no-ops in the WASM environment.
Fixes: QTBUG-118396
Pick-to: 6.6 6.5
Change-Id: Ic59aee386631172d4a29b42fe11e5af318474a1d
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 7c5cf8cae054954975a3e262f7fe3cd9897d67f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This test was disabled during Qt5 porting because it was unstable.
According to the discussion in the bug report, a deprecated function was
used to wait for the window to get exposed. This was later replaced by a
more robust QTest::qWaitForWindowExposed() but the test was not
re-enabled again.
Fixes: QTBUG-22544
Change-Id: I3190e38c1f42dc719803a60e66a86c3773cbedcd
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit ce8c81555de31641041730df08be257cf0ddc221)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Promises are registered upon entry to the pool and
unregistered upon exit. If all promises are in a 'pending' state,
new promises can't be processed. Upon completion of a registered
promise, it is unregistered, allowing space for a new promise.
The code path responsible for unregistering promises when they
resolve runs each time a promise's callback is called.
Unfortunately, there's no guarantee that the callback will be
invoked upon the promise's resolution. For instance, promises
registered with only a 'catch' callback may never be triggered
when the promise resolves correctly.
This commit ensures that a final callback is always registered,
even if the user did not provide one.
This guarantees that promises are always unregistered upon resolution
Fixes: QTBUG-118161
Pick-to: 6.6 6.5
Change-Id: Ifea93d692464a6ef40c4bcad60f840ca0cb650c9
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 1e6841245dca3bda5dee050fc841c7129142dd9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Misc style fixes in preparation for the new overloads taking
QStringView.
Pick-to: 6.6 6.5
Change-Id: I3b838543aefd08bf115488e571b1bb6eec8d968d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ddad911f9be71d3a1396e28261ffe386e880aa69)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make toMimeDataWithFile() handle writing files to the
in-memory file system correctly: this is an async operation
and we need to collect the files as the writes complete
and then invoke the callback once all files have been
saved. There's then no need for a global static QMimeData.
Use toMimeDataWithFile() for both the paste and drop
handling, however QPlatformClipboard::setMimeData() takes
ownership of the passed in QMimeData and the callback API
must be designed accordingly.
An open question is when we should delete the files.
Deleting them right away (after calling the app event
handler) is predictable, however it looks like QPlatformClipboard::setMimeData() retains the current
QMimeData until a new one is set, so maybe we should
follow that.
Change-Id: Ia9b825eaef1134ff9a554e51ee7e41d1c2ee779a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 0ffe8050bd5b55d64da37f5177a7e20dd9d14232)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some platforms like VxWorks do not support inotify
or any similar solution for file watching.
Because of that, the implementation falls back to polling.
That means that tests that require a native backend will fail.
Fix the problem by skipping adding a test case for a native backend.
Task-number: QTBUG-115777
Change-Id: I0d683e6376a0453bd2fd591302c4f3ef7ceea87c
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
(cherry picked from commit eabef00425083f19b0da0380378e13780d44a199)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also means these mapping can now also handle overflowing perspective
better.
Change-Id: Id506634c445521f1b041ec2e9051aa499c24671b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 1f32345a9a30ec11e9213d87b6b18b56beccbe2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QString as inheader record as the place of definition of both
Qt::Literals and Qt::Literals::StringLiterals. Previously mentioned
headers never exist.
Fixes: QTBUG-120379
Pick-to: 6.6 6.5
Change-Id: I104f73b338a144ef5f296500a9a4368cd3791750
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8081c618827403b2658236d6fefbca0e88517303)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This allows other areas to utilize this
Change-Id: I4bc7e8374289a19afe8b639b2b3b0dc0f8f65a3a
Done-with: Mikolaj.Boc@qt.io
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The default value in the default manifest has been for few
releases, set as minimal, and since Widgets Android style
is not fully supported anymore, we can set this to default
to minimal under the hood as well to avoid needing to always
explicitly needing to set it to minimal.
Change-Id: Id0b2134c572694be1e190347ff75f51ade65f0c4
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
(cherry picked from commit ee4f91fa50fa470b4891318750bd7aad5e508124)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The devicePixelRatio was not taken into account when a standard icon was
requested from the windows qpa which resulted in blurry icons for a
dpr != 1.
Therefore pass the dpr-corrected size to QWindowsTheme::standardPixmap()
and pass this size to SHDefExtractIcon() to get a correctly scaled icon.
Pick-to: 6.6
Fixes: QTBUG-52622
Change-Id: Ia771dd2f93fa133cf2c4429ef59a9c5cb05ad047
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 20cdc663b420a332d16f5f1ca82f352924cd7d1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>