cf043a785a unified QtConcurrent::run() and
QtConcurrent::runWithPromise(). Remove the last mentions of
runWithPromise. Also did some minor cosmetic improvements.
Pick-to: 6.3
Change-Id: Ie3b39600978ccfa4a009d3ff68567a348dc7b166
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Remove Integrity and Android specific code that explicitly adds
test data to the resource files. qt_internal_add_test functions
implicitly adds test data to resources for Android and Integrity
platforms by default.
Change-Id: Ia1d58755b47442e1953462e38606f70fec262368
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Multiple tests use qt_internal_add_resource that copies the
functionality that is already implemented inside the
qt_internal_add_test function. Simplify these test by replacing
the qt_internal_add_resource call with the new BUILTIN_TESTDATA
option.
Change-Id: I18475b817d6f87264f0de53817d6c26c5ccab4e2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
To enable its use in the http2 protocol handler.
This factors out the error-reporting code for HTTP 1, which in
any case has to be done differently for HTTP 2, saving duplication
and simplifying the redirect handling code.
Task-number: QTBUG-100651
Pick-to: 6.3 6.2 5.15
Change-Id: I4b470646a9ad5ee702c9b1921d115e137d3d5b8b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Setting a value for the QT_RESOURCE_ALIAS source file property on a
path ending with a slash (a directory) is not handled properly by
CMake. This leads to unpredictable values being set for multiple
directories. Fix this by stripping the the final slash from the file
path, which makes CMake think it's a file rather than a directory.
Change-Id: I7a39be68e6f58bf2726c80108da9947057e7add6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
On several platforms std::bit_ceil() returns 1 for input values that
would overflow the output. Our test expects 0 though. Since the value
is documented as undefined, avoid it.
Pick-to: 6.3 6.2
Change-Id: I00556893a8f0e1e24f08f73cd112b56148bc5bd0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
We are storing a copy of the this pointer in the constructor,
and later deference it to access EventCallback object
memebers. This makes the class noncopyable: delete
the copy constructor to make sure it isn’t.
Also change the callback API to propagate the event
to the event callback.
Change-Id: Ida4bb192b3e905b260ebeec30293aad71b7d8c49
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Allocate a PATH_MAX-sized buffer on stack only in case we are not using
realpath(X, null), i.e. on platforms with older POSIX versions, macOS,
or Android.
This fixes the build on platforms that do not have PATH_MAX (e.g.
GNU/Hurd), and it provides a minor optimization on realpath(X, null)
platforms.
Change-Id: Icd92a1b15ec18c5eef8113408e9610dfac774101
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Size a QMdiSubWindow is no real toplevel widget, QLayout::activate() did
not properly set the minimum size based on it's children. Fix this by
treating a QMdiSubWindow as a toplevel widget during the calculation.
Fixes: QTBUG-100494
Change-Id: Ia2e6c519c7214c36383facd244711bd932231d40
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
If one calls setPlainText("") before setting a placeholder text,
the placeholder visibility is not updated, and the placeholder is not
visible. Fix it by updating placeholderVisible properly.
Fixes: QTBUG-96212
Pick-to: 5.15 6.2 6.3
Change-Id: I1bd3f0cb4c59973a847bcf3787e35d7c17b6d673
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Introduced in commit d07742f333. Reported
by GCC 12:
qlibrary.cpp:672:9: error: dangling pointer to ‘candidates’ may be used [-Werror=dangling-pointer=]
672 | if (isValidSuffix(*it++))
| ^~
qlibrary.cpp:634:29: note: ‘candidates’ declared here
634 | const QLatin1String candidates[] = {
| ^~~~~~~~~~
This is a false positive report because the lambda does not return a
pointer or iterator. But it's a good update anyway to keep the array
outside the lambda, so it won't be recreated every time.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104492
Pick-to: 6.3
Change-Id: I74249c52dc02478ba93cfffd16d230abd1bf6166
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
On the Hurd there is the standard GCC toolchain, so it is possible to
query GCC for -dumpmachine.
Change-Id: Idc8e80c0937147a8ea656bc0320a83d647278455
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Don't allow the compiler to inline them in qHashBits() because they
require a lot of register use and add to the hot code path to aeshash().
Now all calls in this function are tail calls.
Change-Id: I54f205f6b7314351b078fffd16cf7f2f97d99144
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
...that may lack GetCurrentProcessToken. The definition in the new SDKs
is:
FORCEINLINE HANDLE GetCurrentProcessToken (VOID)
{
return (HANDLE)(LONG_PTR) (-4);
}
This is a partial revert of ae7e11e5c6.
Pick-to: 6.3
Change-Id: I74249c52dc02478ba93cfffd16d23c487229f95d
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
In one case, cast an int to qsizetype rather than the other way round,
in order to compare them.
Change-Id: Id8dffe61f9565040f1a5ee24867956397f814a55
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Some of the else if lines exceeded 100 characters, so should have been
split; and some lines already were split. So each whole chain should
have had braces on its bodies. Instead make it a switch, as this makes
it more evident what's going on in any case. Furthermore, as each
branch did the same thing with dbType-specific strings, change to just
setting QLatin1String variables, so that the rest of the code needn't
be duplicated in each branch; it can simply be done once after the
switch, using the string's .arg() to embed fragments. In the process
break up the SQL query strings more gracefully, purge spaces just
inside C++ parentheses.
Change-Id: Ie26166e098ad74720bb6d7c4d9fe47718c33a13c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Telling us the condition tested should have been true is what
QVERIFY() does anyway, so don't go to the whole trouble of saying the
same thing - and wrapping it in in a QString() merely in order to then
qPrintable() it back out again, pointlessly converting a C-string to
unicode and back again.
At the same time, skip one other qPrintable(QString("...")) without
.arg() formatting; and change the check it's the message for to use
QL1S::arg() instead of QString::arg().
Change-Id: Ie71a79da8017916d301a38b69fc422e55a5a3649
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Expected warnings are clutter for anyone reding the output, so
suppress them when they're correct behavior.
Change-Id: Idf47ba4fab8069237067d9b20afef3041e0c2f8c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Doing the tidy-up after the last check has the problem that it gets
skipped if any check fails, as the premature return skips the tidy-up.
In the process, added the missing tidy-up to prematureExec().
Repackage the code for one tidy-up as a named lambda so that the
duplicate can share it with the scope guard. Made some existing scope
guards const, while I was about it, so that the one that isn't -
because it gets dismiss()ed - stand out.
Change-Id: I96d6834d5d7675f15018169a7093b0211db6f8a9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It's relied on implicitly, which is no longer valid in dev.
And may accidentally be broken in other branches.
Pick-to: 6.3 6.2
Change-Id: I2272b6914e883e20d0989a1762eb1a5c1aef4e0e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Implemented as an alias to keep c++2a working and remain consistent with
the way this was handled for the c++20 switch in cmake and the c++17
switch in qmake.
Pick-to: 6.2 6.3
Change-Id: I9a5f6d6b3a3adec748cf7207ceaa6da98d053cdb
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Roboto is the default font on Android. So far, Helvetica
was used, which is usually unavailable on Android.
Task-number: QTBUG-87405
Change-Id: I53332403a43f6a005ce73ece68b8dddc41b4b58c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This code triggers warnings about mixing enums of different
types, which breaks compiling with warnings-are-errors.
'bitwise operation between different enumeration types is deprecated'
Pick-to: 6.3 6.2
Change-Id: Ib6c19f02f7c7593c9e22da5e648ea1f2f2ae757b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Before this patch, Clang versions greater than 11.0.0 emitted
-Wsuggest-override warnings whenever the Q_OBJECT macro was used.
Excerpt from compiling GammaRay against Qt 6, using Clang 13.0.0:
```
.../qtbase/src/corelib/io/qfile.h:96:5: warning: 'qt_metacall' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
Q_OBJECT
^
.../qt5/qtbase/src/corelib/kernel/qtmetamacros.h:166:17: note: expanded from macro 'Q_OBJECT'
virtual int qt_metacall(QMetaObject::Call, int, void **); \
^
.../qt5/qtbase/src/corelib/io/qfiledevice.h:54:5: note: overridden virtual function is here
Q_OBJECT
^
.../qt5/qtbase/src/corelib/kernel/qtmetamacros.h:166:17: note: expanded from macro 'Q_OBJECT'
virtual int qt_metacall(QMetaObject::Call, int, void **); \
^
```
This was also discussed on the QtCreator mailing list:
https://www.mail-archive.com/qt-creator@qt-project.org/msg08500.html
Pick-to: 6.2 6.3
Change-Id: I149782472ce8a2e30ed8062ada460c39926f1613
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Q_ASSERT goes away in release builds, Q_UNREACHABLE() does not.
This also solves the GCC 12 warning about out-of-bounds access in
QAbstractEventDispatcherPrivate::allocateTimerId():
In member function ‘_PTp* std::__atomic_base<_PTp*>::load(std::memory_order) const [with _PTp = QFreeListElement<void>]’,
inlined from ‘_Tp* std::atomic<_Tp*>::load(std::memory_order) const [with _Tp = QFreeListElement<void>]’ at atomic:579:25,
inlined from ‘static T QAtomicOps<X>::loadAcquire(const std::atomic<T>&) [with T = QFreeListElement<void>*; X = QFreeListElement<void>*]’ at thread/qatomic_cxx11.h:249:29,
inlined from ‘X* QBasicAtomicPointer<X>::loadAcquire() const [with X = QFreeListElement<void>]’ at thread/qbasicatomic.h:233:64,
inlined from ‘int QFreeList<T, ConstantsType>::next() [with T = void; ConstantsType = QtTimerIdFreeListConstants]’ at qfreelist_p.h:245:34,
inlined from ‘static int QAbstractEventDispatcherPrivate::allocateTimerId()’ at kernel/qabstracteventdispatcher.cpp:99:24:
bits/atomic_base.h:820:31: warning: ‘long unsigned int __atomic_load_8(const volatile void*, int)’ writing 8 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
820 | return __atomic_load_n(&_M_p, int(__m));
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from qglobalstatic.h:1,
from qglobal.h:1395:
qglobalstatic.h: In static member function ‘static int QAbstractEventDispatcherPrivate::allocateTimerId()’:
qglobalstatic.h:127:23: note: at offset -8 into destination object ‘holder’ of size 56
127 | static Holder holder;
| ^~~~~~
Pick-to: 5.15 6.2 6.3
Change-Id: I74249c52dc02478ba93cfffd16d232b275d5d216
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Since the value returned by CGDisplaySerialNumber is uint32_t,
comparing it with a long data type can cause overflow when the
value is greater than or equal to 2^31. And since this is a serial
number, in some machine this value can be greater than 2^31.
In those machines, QScreen::name will be empty due to the failed
check here.
Pick-to: 6.3 6.2 5.15
Change-Id: Ia037ba9e7a6d8025cc4b41c1b428eba38455330d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Raster pipeline is not supported on webOS OSE: trying to use it causes
an exit(1).
Fixes: QTBUG-100654
Pick-to: 6.3
Change-Id: I00325fc1330a2d0d4abfdee054343ecfac767309
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
On most platforms, the old struct had a padding hole before the FP
members, as well as after the character array.
By packing the integer members into bit fields, we compress five ints
incl. the padding hole (24 bytes) into 64 bits w/o padding (8
bytes). The size of the struct shrinks from 80 to 64 bytes, saving
almost 2KiB in TEXT size. Four bytes of tail padding remain, and are
available to grow the character array in the future.
More compactification could be had by changing the FP members (either
by turning them into floats and/or by making them a union over {mm,
in}, because one can be calculated from the other), but these are for
another patch, because they change return values.
Pick-to: 6.3 6.2
Change-Id: I0e7f354a0341e94e9a9401a7d3b4529a8ff20a3d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QPainter should not try to be smart and optimize IntersectClip with ReplaceClip when working on a QPicture paint device. Doing so will change the end result as the actually state when replayed might be different from the one it was recorded in.
QPainter will no longer try to replace IntersectClip with ReplaceClip if the paint engine is a QPicture.Consistent with QPainter::setClipRect and QPainter::setClipRegion.
Fixes: QTBUG-100420
Pick-to: 6.2 6.3
Change-Id: I1e0ebbc2d6e1ffd98b9f3f537e83893579606a4b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Since e02293a76d and
2e0c29a4bb was committed,
If a item width more than others,the selectionRect.x() always consist
of currentStartSelection item's rect.center().x(),this will cause
selectionRect size is not right.
Because the code of 2e0c29a4bb is to fix
the new bug introduced by e02293a76d,
we need to use a better way to solve QTBUG-78797.
When itemview enable drag,we need always update pressedPosition because
pressedPosition was used to determine the drag distance, otherwise keep
previous logic.
Fixes: QTBUG-78797
Fixes: QTBUG-81542
Fixes: QTBUG-99512
Pick-to: 6.2 6.3
Change-Id: Ibc5020e35b0eb319e4b5546bdba39ff527c209a6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
[ChangeLog][Potentially Source-Incompatible Changes] The qtextstream
header no longer includes <QString>, <QStringEncoder> and
<QStringDecoder>. Code which relied on the implicit inclusion of those
classes might now need to include the headers explicitly.
Task-number: QTBUG-97601
Change-Id: Ifb8c8452026195a772c0588dbbbc53fb51cac548
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use custom script to copy big Android artifacts on Windows platforms.
The script uses 'copy' but not 'copy_if_different' when source file
size is bigger than 2GB. 'cmake -E copy_if_different' only compares
first 2GB of files because of cmake issue, so this step only
workaround the problem.
Pick-to: 6.2 6.3
Task-number: QTBUG-99491
Change-Id: Id076734700e334dfc3330da412462c2b53829b33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Hurd supports largefile, so enable it also in Qt.
Change-Id: I8384ca2cb5c6250376916b6a890e1a873c0a0e96
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
If an app is loading QML from a string at runtime from C++, the
dependencies/imports might not be bundled into the app package,
and then the app might fail at runtime. A fix is to have a QML
file with needed imports to properly deploy those impots' libs.
Fixes: QTBUG-100394
Pick-to: 6.2 6.3
Change-Id: I10136dc2dd1ac1f4ffe00bcf2cfd6c98e050ef28
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
It only stores one layer of state, and pausing twice in a row will just
overwrite the previous state. This doesn't happen often but can happen,
especially on Windows if a certificate needs to be looked up in the system
certificate stores (socket gets paused) and then a recoverable error
occurs in QNAM (socket gets paused again).
Fixes: QTBUG-100362
Fixes: QTBUG-63196
Fixes: QTBUG-98476
Pick-to: 6.3 6.2 5.15
Change-Id: Ie524c48e11b6fa8010b78cc1bf3931efe2ce3351
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Before this patch the accessibility focus on a selected element could
be drawn incorrectly after the screen orientation has changed.
The reason for that is that wrong X and Y offsets were used for it.
The offsets are used to take the sizes of different panels (like
buttons and notifications bar) into account.
Normally they are updated only when getNodeForView() is called and the
whole accessibility info is reconstructed.
However, when the screen orientation changes, we get some
getNodeForVirtualViewId(selectedId) calls before the whole accessibility
tree is recreated. This is when redrawing happens, and as I understand,
this is an internal Android event, so we can't do much about it.
The most straightforward fix for the problem would be to query the
offsets also in each getNodeForVirtualViewId() call. However, offset
calculation seems to be quite heavy operation, and
getNodeForVirtualViewId can be called very often (esp. if we have a lot
of UI elements). As a result, this fix can't be implemented.
In this patch I came up with the second approach - once getNodeForView()
is called, and it detects that the offsets have changed, we force
re-focus of the currently selected element. This allows us to retain the
offsets-caching mechanism.
Fixes: QTBUG-93402
Pick-to: 6.3 6.2 5.15
Change-Id: Ic420afe1fe5e80fbdf91b2b2651f2daa71c6e44d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Removes a static string literal. QtMiscUtils allows the compiler to
possibly avoid the array, or share with other TUs
Pick-to: 6.3
Change-Id: I449800f113620a53d2f4b11fe027ebcb710f7b86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's used as a thread_local static, so it better be.
What prevented it was the unused inheritance from QObject and the
missing constexpr ctor of the StatIdent() data member.
Fixed both.
Pick-to: 6.3
Change-Id: I312ed6dc8bf7193cdaa7dc708bf19b018e56ec8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>