When the scroll mode is ScrollPerItem and uniformRowHeights is not set,
the offset has to be calculated by iterating over all items.
Optimize the loop by calculating the last item before the loop instead
of checking at every iteration.
Task-number: QTBUG-61763
Change-Id: I1d4439fe0fc3f32194f5f368c0486e793048d965
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
When painting the background for a QAbstractScrollArea, the brushOrigin
was calculated for every brush type although it was not needed. Since
this can be very time consuming (e.g for a QTreeView with non-uniform
row sizes) it should be avoided when possible.
Therefore check if the brush is a texture and skip the calculation if
it is not the case. Also do not restore the old brushOrigin since the
painter is not used at all afterwards.
Task-number: QTBUG-61763
Change-Id: I66cbe1b796cb5cad4c78e656fb86d199d8e4bde9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
it must end up in front of QMAKE_LIBS{,_PRIVATE}, but not of
LIBS{,_PRIVATE} (which are preceded by QMAKE_LIBDIR).
Task-number: QTBUG-61982
Started-by: Liang Qi <liang.qi@qt.io>
Change-Id: Id3de01ee0e9b66af02f79949aeb5a0eabd55363f
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
In NDK r18, libc++.so was renamed to libc++.so.XX where XX is the Android
API level.
[ChangeLog][Android] Fixed build issue with NDK r18+.
Task-number: QTBUG-70631
Change-Id: Id0d2955648197e3054e3c69263b5a90d57964f6c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
the early merging of LIBS* into QMAKE_LIBS* meant that we could not
interleave them properly. defer the merging until the points of use.
Task-number: QTBUG-70779
Started-by: BogDan Vatra <bogdan@kdab.com>
Change-Id: I890f98016c3721396a1f0f6f149a9e2b37d56d8e
Reviewed-by: Liang Qi <liang.qi@qt.io>
it's unused now, and just complicates matters. its interaction with
LIBS_PRIVATE & co. has always been a bit shaky. google produces no
public hits outside qt itself, so let's assume it really remained
internal.
Change-Id: I6606bbabd44f1b76d84e97219e155e38d6f1b3a6
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
this was introduced in 2002 supposedly for qnx4, but doesn't appear to
have actually been used ever. remove it, as it's in the way now.
Change-Id: I54dcabb61e1d3609a1e7a9fa4ff4b25509cfdb7a
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
QWinRTBackingStore::flush() was not considering the possibility
that the supplied region may fall partially outside the bounds
of the paint device. This resulted in possible accesses to invalid
memory addresses, causing a crash. This bug was exposed by an update
in ANGLE that was causing a crash when running tst_QTableView::bigMode
with a small screen size. With this fix the function will use the
intersection of the supplied region with the paint device bounds.
Change-Id: I2f0f0f7f5510688bfa1459320a0c146df6be65d1
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
lld for coff/mingw doesn't support linker scripts, which qmake used
for passing larger numbers of input file names to the linker.
Instead of using a fullblown linker script for this, just use a plain
response file, which both lld and binutils ld support.
Change-Id: I3aace7902fa6ca861a0a9fe67feaa236e7ea417b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This reverts 4fe68ffbe5,
1dfc16f6da and
9545bee98a2431d4ef4c3449631a5fcb8d9bd57a; this feature has not been in
use for some time, so is just dead code.
[ChangeLog][QtTestLib] Removed support for GPU_BLACKLIST files.
Reimplementations or equivalents of QTEST_MAIN() should remove their
uses of QTEST_ADD_GPU_BLACKLIST_SUPPORT and its _DEFS; they are still
vacuously defined, but serve no remaining purpose and shall be
undefined in due course.
Change-Id: I94ffd5c37ce4e1f7cf25d3c7ae8d40696b74c911
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
It is not always easy to spot the compiler version in the build or
configure log, so report it explicitly to make our lives easier when
trying to figure out why a specific build might have failed.
Change-Id: I1c84199aad4a98a30b0b4c4fbf2554008dc3ba2d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This reverts commit 341bfcd1ea.
As it turns out there might be use cases where we want to have proper
windowing system event integration with glib dispatcher via g_source_attach().
For example with gtk_dialog_run, where GTK blocks in a recursive main loop.
We want to continue dispatcing our windowing system events during this nested
event loop. Not having a proper glib integration can result in rendering issues,
e.g. when resizing parent window via mouse while GTK-based dialog is shown. Can
be seen on examples/widgets/richtext/textedit/ -> Format (from menu) -> "Color..."
The issue from 341bfcd1ea actually should be fixed inside XCB platform plugin,
by improving integration with event dispatcher. That is handled in follow-up patches.
Change-Id: Icabc6d841a554aefbdd460765a3165d22e65f651
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
xcb_poll_for_queued_event() was introduced in libxcb 1.8.
The minimal required libxcb version was bumped up to 1.9 in
1f5d791708. Before this version
bump we needed the runtime check to support older versions
of libxcb.
Updated connections in the event reader to use the new signal
and slot syntax. Removed threadedEventHandling() method because
now it is always 'true'.
Change-Id: I0bce61fd478a871d35e676239ee5280c4f40be8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We had this information internally but there was no public API for it
Fixes: QTBUG-4071
Change-Id: Ic7f855e32a6870129e7723a47d31a629e0ea1aca
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This is an opt-in feature to control whether font and palette should
be propagated, and there is no reason this should be removed in Qt 6.
This has been introduced in commit
7293200ace .
Change-Id: I666c09d716bf7033953e98108da3f7711f3bc321
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: Martin Koller <kollix@aon.at>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The flakiness was reported for macOS 10.8 a long time ago and I
am not able to reproduce it, so lets remove the workaround for
it.
Task-number: QTBUG-32690
Change-Id: I92e64065c7480b8f4c5d1d1e6cb5fdd218a70313
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
A few places we didn't check if detach() succeeded including
in reinterpretAsFormat(), where it can be undone.
Task-number: QTBUG-70785
Change-Id: Ibcc8e26e2961f6288eb7a045ae1cb28e59213a49
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This fixes configure with win32-clang-g++ as the native compiler.
Change-Id: Iced43d70b9a0aa413d1f5f6034b42b976cb7c39e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
QWidgetTextControl is a base class for controls of text widgets
and widget-specific code should be used in derived classes, so
override loadResource() in QTextEditControl.
Change-Id: I6d829ead0837419530094d19e0ca53a964413e92
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
and fix handling of incoming binary data
Change-Id: I31e97505ad4ff64cf8e380df5d0d6b70c3cd60b0
Reviewed-by: Ryan Chu <ryan.chu@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Two cases with no code between them don't need a fall-through marker.
The only code in the first case is subject to #if-ery; it either
returns, without falling through, or has no code there. Putting in an
overt Q_FALLTHROUGH() confused a rather dumb compiler ...
Change-Id: Icc034be08859cc1656401af1c62367aec302668b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This reverts commit 4bdd8d4eca.
It contains an error.
Change-Id: I51052029f001b9e82c2a53de15b4ba354aafdbae
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
These functions have not been used by the font selection algorithm
in Qt 5. Calling lastResortFamily() always gave you "helvetica"
and lastResortFont() would actually crash.
Since we cannot remove them before Qt 6, we deprecate them for now
and update the documentation to give a more accurate description
of how the font matching works in Qt 5.
Note that in the non-native QFontDialog, it tries to implement its
own font matching algorithm and therefore was calling
lastResortFamily(). Since fixing QFontDialog is not within the
scope of this patch, I have just replaced the call by "helvetica"
directly, so that it will continue to behave the same.
[ChangeLog][QtGui][Text] Deprecated QFont::lastResortFamily()
and QFont::lastResortFont() which are not in use in Qt 5 and
did not provide any useful information.
Task-number: QTBUG-60813
Change-Id: Id8fe7bfdd427292ef86bc8405de03cb466b9b62a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Adding standard behavior for text selection, when user want to select text
and there isn't any previous line then selection will end on start
[ChangeLog][QtWidgets][QWidgetTextControlPrivate] Move cursor selection to start
Task-number: QTBUG-69735
Change-Id: If222d37747772f60774f671ffdd273d63cdaf571
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
QList, QVector and QVarLengthArray check the validity of iterators
passed to member functions using isValidIterator(), which checks that
the underlying pointers are in the range [begin, end]. This check is
well-defined when the outcome is positive, ie. when the iterator is
valid. But if the iterator is not valid, and does not happen to point
into [end, begin + capacity], the comparison, which uses normal
operator<, invokes UB.
Fix by using std::less<T*>, which defines a total ordering.
Change-Id: I1e5757789b4b9779f5e3e298e7f2b2dd0b27576c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The version we're using is at least seven years old.
Let's try staying up to date ...
Change-Id: I450a2fc37c22740fe554a81b471bf0fad340498e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use a template on the size of the char[], as suggested by Ville
Voutilainen. This resolves ambiguity about whether such look-ups
should be done via QString or QCborValue (not that it would have made
any difference).
When we come to add mutating indexing of QCborValue, chained
dereferences like map[i][j][k] need to stay in operator[] const
throughout, to avoid detaching intermediates to create references into
them due to using the mutating operator[] on the earlier dereference's
return. So const-qualify the QCborValue operator[] const variants at
the same time, to match those of QCborValue itself.
Change-Id: Ib1652ae9440fe3767a653afa2856b74040210e07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Likewise have mutating operator[] insert an invalid entry at its
target index, if beyond the end of the array. This makes it possible
to fill an array from high index to low, for example.
Change-Id: If71699c20e2623142214ce2c11c4d6e4a120c989
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch adds the missing overload for QRegularExpression to match the
QRegExp one for QPlainTextEdit.
[ChangeLog][QtWidgets][QPlainTextEdit] Added QRegularExpression find()
method overload.
Change-Id: Id156971d3fa0372712bfa8b72a55550942a767e0
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
This patch adds the missing overload for QRegularExpression to match the
QRegExp one for QTextEdit.
[ChangeLog][QtWidgets][QTextEdit] Added QRegularExpression find() method
overload.
Change-Id: Ic7be224dcc59fc8d832daddd1999a713b7f04253
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
Theoretically, it could improve the speed. Some of the modified lines
also make the style homogeneous.
Change-Id: Iaed7b16fa75e485be0f825220c366903525448ce
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Applications with target SDK version lower then 28 running on a device
with version greater or equal to 28 will cause compatibility warnings,
so default to none when the extract_android_style value is set to
default.
Note that the new value "default" was introduced to allow this kind
of changes in the future, i.e., selecting the best solution based on
some simple heuristics. Adding a new value also keep compatibility and
allows the user to explicitly set a value when needed.
Task-number: QTBUG-69810
Change-Id: I68301716767870ce6de40e45742d9c5fc263ee25
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>