This piece of code may be some old workaround, but anyway Qt doesn't
need it anymore. Removing them doesn't cause any compilation errors
or even warnings. We should not keep any workaround if they are not
needed anymore.
Change-Id: Ieae8c2b005fa5e556c838d78d839d498101f28ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I added this flag but only explained what it is in the original
commit message, it may confuse future code readers without some
inline comments. So add some comments to avoid such issue.
Change-Id: I6a3c0f53c2bc58646cc70e45cacb1d0e40656c0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This fixes a regression compared to Qt5. In Qt5 absoluteFilePath()
unconditionally searched for all files in extra prefix dirs and the Qt
install prefix, in particular also the -android-dependencies.xml files.
After the changes in Qt6 up to now however those files are only searched
in the Qt install prefix. This broke external libraries also making
use of the -android-dependencies.xml mechanism, such as some KDE
frameworks.
Pick-to: 6.5 6.6
Change-Id: Ic53aab50c70f853f3b1d621d6de6edb3df223905
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
We know what engine we're using, so don't go the long way around via
QFileInfo and QFSFileEngine to get back to QFileSystemEngine in order to
calculate an absolute and clean path.
Since we're doing that, we may as well use QFileSystemEntry's ability to
give us the file name portion of this absolute path without having to go
via QFileInfo and QDir again. We just need to make sure that a dir name
isn't ending in a slash: absoluteName() would remove that for us, but
only if the entry isn't already absolute and clean.
Change-Id: I9d43e5b91eb142d6945cfffd17871389d359e750
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Added moveToTrashDuplicateName() to see what happens if you attempt to
trash two files with the same exact full path. Both files should get
independently moved to the trash bin and not clobber each other.
Added moveToTrashXdgSafety() to test that QFileSystemEngine will
properly skip over an unsafe $root/.Trash directory, as required by the
XDG specification. I think the specification should also make security
requirements on $root/.Trash-$uid too, but that's for another change.
Pick-to: 6.6
Change-Id: I9d43e5b91eb142d6945cfffd1786cd60e4244c7c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
qnativesocketengine_win.cpp: don't check if timeout is < 0, because
remainingTimeAsDuration() doesn't return negative values.
All the changes done in one go, not function by function, as that causes
the least churn. You can think of them as a couple of very similar
changes repeated various times.
Drive-by change: replace `forever {` with `for (;;)`
Task-number: QTBUG-113518
Change-Id: Ie9f20031bf0d4ff19e5b2da5034822ba61f9cbc3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We usually compile without exceptions, so the try..catch is a noop.
So, if the `new` fails we would crash (or get UB) anyway. Instead
of that, use the nothrow version of `new` and check the result.
Pick-to: 6.6 6.5
Change-Id: I1902b717c70afcc44c1f3237370aae346262452a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Use a stack buffer instead of a QByteArray to hold the 16 bytes for
the QUuid serialisation, replacing toRfc4122() with toBytes() and a
memcpy().
As drive-bys, drop the needless cast from char* to uchar*
(qToLittleEndian() has void* arguments, so char* is fine) and drop {}
around single-line if body.
Pick-to: 6.6
Change-Id: I6ffabcf07fc9a730a782e20e113999a0dcf15067
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
It contains no implementation. Proof: it includes no headers.
Pick-to: 6.6 6.5
Change-Id: I64b42ce799eec05a0faff2021e2b60460695e192
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
The Q_DECL_{IMPORT,EXPORT} macros change with the configuration, so the
lack of our configuration this ended up producing inconsistent builds.
Amends 43ec3d8d01.
Pick-to: 6.6
Change-Id: Ifeb6206a9fa04424964bfffd17892394d19e648f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
When a dock widget is closed while floating, it still reports being
floating even though the QWidget::windowHandle()->isVisible() returns
false. This is documented behavior and will not be changed.
c153066baa relied on the isFloating() to
return false, if the dock widget is closed. When the window title was
changed by setWindowTitle(), the change was overridden by reading the
old value from the window handle.
=> Amend the patch and add a windowHandle()->isVisible() as a condition.
In c153066baa, an autotest for the title
propagation (QTBUG-113591) was added to floatingTabs().
=> Harden the setWindowTitle() test function. Move the tests related to
QTBUG-113591 and QTBUG-117764 to this function.
Fixes: QTBUG-117764
Pick-to: 6.6 6.5
Change-Id: Id37a9a22d4d13abad4ea55c74ea4e834bdb2bfab
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Qt a11y(ATSPI) support only depends on DBus and ATSPI, it should
also work fine on Wayland when xcb was disabled.
Task-number: QTBUG-117535
Pick-to: 6.6 6.5
Change-Id: Ibd7ebb32b94de1888920f0fe2b85ae3bd4d2c77a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This amends 6802065da8 .
Pure Wayland runtime and build envs without X11/xcb are more common.
Need to find solution for ATSPI_MODIFIER_SHIFTLOCK on Wayland later.
Pick-to: 6.6 6.5
Task-number: QTBUG-117535
Change-Id: I65d41546e3dbb86c3a939a496ed43ac1737cf539
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
These methods return a struct which is implicitly convertible to
QString/QByteArray respectively. Don't hide the return type from QDoc,
this simplifies telling users what those methods return exactly.
Fixes: QTBUG-117705
Pick-to: 6.6 6.5
Change-Id: Ibb22a1e54fffce8f5f20aaabe47983870ccfba1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The server used to hardcode the name while the client allows the
user to specify it. The server's UI is adjusted to let the user first
specify the server name he wants to listen to and second stop listening
to the current server.
Task-number: QTBUG-117064
Pick-to: 6.6 6.5
Change-Id: I80fc976151ead7a181fbc32080597277bc515313
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
By fixing how many requests we are expecting to _finish_.
Since the nRequests variable is only decreased once a
request is finished, we only actually expect 1. No matter
how many times it gets redirected.
This was the slowest test-function in the test, clocking in at
10 seconds. Now it's sub 500ms.
Pick-to: 6.6 6.5
Change-Id: I544360f0928466c1bc0fbc6806952ccec588d131
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The QIODevice is owned by the caller of data(), so we should have
freed it.
Amends a6776de0c7
Fixes: QTBUG-117787
Pick-to: 6.6 6.5 6.2
Change-Id: Ic5575649038480f52cc13ee229980ee1c7cee728
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
Misc cleanup for the PostgreSQL driver:
- use constexpr instead const for some constants
- use new signal/slot syntax
- unconditionally call PQfinish() - check is done inside the function
Change-Id: I47b83ef3436225f698fca24c68e5c9cde32c1163
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Otherwise characters in right to left languages like Hebrew might
mess up the output.
Change-Id: I8753e7e672159ed515dc6152c3629adf91cfd4a9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The QKeyMapper class never got a platform integration companion.
As we might be adding more functionality here in the future, let's
fix that now, instead of adding more hooks directly to the platform
integration class.
The QKeyMapper will soon update its possibleKeys signature to
return QKeyCombination, but for now transform the result.
Change-Id: I88ef498180b2a8a7937a74627b7eb6b5156e872a
Reviewed-by: Liang Qi <liang.qi@qt.io>
All platforms except Wayland fail to check for input direction change
when the locale changes, and only emitLocaleChanged.
We can simplify this for the platforms by checking if the new
locale caused a change in input direction, and if so emit
inputDirectionChanged on their behalf.
Change-Id: I84d8df9392db5e716f5c277d0cc9e17e5a21783f
Reviewed-by: Liang Qi <liang.qi@qt.io>
Change "qpaths" to "qtpaths" since the former is not a valid option.
Fixes: QTBUG-117817
Pick-to: 6.6 6.5
Change-Id: Ib8c8c80f31c1c54747340442c6bf3185c7c69001
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
in top level, which are in used very common for KDE and GNOME.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-117488
Change-Id: I88fe7b4afe44e4ac8f07e60e990cbe68498e98d9
Reviewed-by: Nicolas Fella <nicolas.fella@kdab.com>
Reviewed-by: Ilya Fedin <fedin-ilja2010@ya.ru>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
QItemDelegate was superseded since Qt4 by QStyledItemDelegate but it
took until Qt6.7 to remove the last occurrences in qtbase.
- remove unused includes / replace with qabstractitemdelegate.h
- replace references in the documentation with QStyledItemDelegate
- adjust the examples and tests to use QStyledItemDelegate
Pick-to: 6.5 6.6
Change-Id: I246755004ce2d01192a726ca0972106c237df0cc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
On some xcb platforms the xcb_configure_notify_event_t is sent after the
window is fully exposed which leads to a wrong position for
QWidget::mapToGlobal() which makes the test fail.
Fix it by waiting for a move event with a position != 0,0 before
starting the drag'n'drop operation.
Fixes: QTBUG-94250
Change-Id: If91a15815205ba9dcea36248d9de03ed0a7e5822
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
and add QChar overload to reduce allocations
Also port tests from char* literals to char16_t literals
Change-Id: I99381a2da08d9d35e6135c48bd92bd8d72533065
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
in Qt::mightBeRichText, Qt::convertFromPlainText
and emitFrameStyle to support large strings
Pick-to: 6.6 6.5 6.2
Change-Id: I7187bd81d3cbcc11ba898e015bd2a8ec64e3bf34
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Don't call resize on QVLA, just wrap pointers in QSV
As drive-by, fix typo in comment
Change-Id: Id90236cfb53d861b8bd57fa9452aba4b8d9b20bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Construction from nullptr wasn't, before, because it was using the
QPointer(T*) constructor, which cannot be constexpr. Add a constexpr
QPointer(std::nullptr_t) constructor to enable this use-case.
This requires to mark the (T*) constructor as Q_WEAK_OVERLOAD,
otherwise legacy construction from a literal 0 would be ambiguous.
No documentation changes needed, as the set of valid expressions
(apart from constinit'ing) has not changed. Mention the nullptr ctor,
though, without \since.
Add a test to confirm that contruction from derived still works.
Change-Id: If9d5281f6eca0c408a69f03fecba64a70a0c9cf0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Initializing QPointer with nullptr is currently still going through
the (T*) ctor, which is not constexpr, so is initialized at runtime.
This will change in Qt 6.7, but that doesn't help the older branches.
Use the default constructor, which is constexpr, and assert that no
runtime initialization happens by using Q_CONSTINIT.
Amends f929756578.
Not picking to 6.2, 5.15 because, while affected, they're in too
stable a mode for this, and they also lack Q_CONSTINIT.
Pick-to: 6.6 6.5
Change-Id: I41bb6f36d529effda008f166fd05a8896157edc9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
The last QPointer user was removed in commit
07d6d31a4c. Prune the include.
Change-Id: Id48ffd2f8f5c1790bbdc54d66ac0c404b0af9cd2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
It's currently its only user, so drop the extra code and inheritance.
Change-Id: I6e525a9629b7289cc770133936e089683b763289
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Ignore expected warning messages when looking up classes, methods, or
field that don't exist. Make the test implicitly fail for any other
warning messages.
Change-Id: I79ec799102b1ab9424aa39c5255413931b8ad152
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The std types do that on their smart pointer types, so while it's not
100% correct (the function has the precondition !isNull()), follow
upstream and mark this operator noexcept, too.
Change-Id: Ie688598215afe2db4c0c26fcfa192fc7c8e22150
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Mark almost all public functions of the clas as noexcept.
Exceptions:
- assignment and construction from T*: allocates an ExtraData in
QObjectPrivate
- dereference: the std types do that, but it's not 100% correct, so
not proposed in this patch
As a drive-by, remove pointless inline keywords.
Change-Id: Ice91dfc429a4268546c0b8275da329be05f4edcb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
We don't support or implement state restorations via the AppKit
state restoration APIs, but if we did, we would/should support
secure state restoration. This is the default for apps linked
against the macOS 14 SDK, but as we target versions below that
as well we need to return YES here explicitly to silence a runtime
warning.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-117745
Change-Id: I0145504a79e53499852832d23dc7d4d6838dfa1b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
All operations they perform (copy/move construction + swap()) are
noexcept, so these functions should be noexcept, too.
Amends 93019dc0dee3dd3d568775250e3fae8eda072850 and
(FIXME)93019dc0dee3dd3d568775250e3fae8eda072850(ONCE MERGED).
Change-Id: I9010f87f93ce3efcefd8b28d848a3eadd6e74542
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When 6c504f2519 added the conversion
copy-constructor to fix an ambiguity, its commit message argued at
length why a move-assignment conversion operator was not possible. But
we actually have the existing converting move and copy ctors, so we
can just use copy-and-swap and move-and-swap, so do that.
As a drive-by, make the copy-assignment operator use copy-and-swap.
[ChangeLog][QtCore][QPointer] Added missing converting move-assignment
operator. This is forwards-compatible with Qt 6.6.0: compiling against
6.6.0 will just use the lvalue overload.
This is BC and SC, forwards and backwards (inline code, and going back
in time will just use the lvalue overload), so picking to 6.6.
Pick-to: 6.6
Change-Id: Ibbefb0927c08d8c716a952c6c592a02df2a89008
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>