Break out the offset-specific code (partly in preparation for handling
its localization better, but also) to ensure we try more candidates
and, when using the system locale, only use QTimeZone::displayName()
if we must - as it may oblige us to instantiate the system time-zone
instance. Tweak ordering of #include headers while I'm about it.
Change-Id: I183ddd1bcb181120df5561bfdc4d89a218292ee0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1b909695a66500b3cceb0fee668b12a663ed3b8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
so also we can call it directly from extended classes
without using get() calls.
Change-Id: Ie0aa7509620e3d675816b9efb1db8b092e1c4a8f
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 48f9ab09464a3e8259ceb75ff13b55901cd74760)
Not all test cases inspect all of failed, then, and canceled, but it
doesn't hurt to always collect all three.
Avoids having to write the same type of code over and over again.
Amends bf3fc5c95c (but really
1f22fc995a and
855c448469, which each duplicated the
initial pattern without refactoring).
Pick-to: 6.5 6.2
Change-Id: Ifb2a3589f8aed9017fbdff20e4edb64e8c9e2488
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9d0da873f0ddadb60e61fbd6c96c8b00f026e99f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In unit-tests, blocking operations should be timed, whenever possible,
so that a proper failure is logged instead of a watchdog timeout
(which is reported as a crash).
Wait for 60s and wrap the wait() in QVERIFY(). Since this can fail,
mark ThreadWrapper's dtor as non-noexcept.
Amends 385f0732d9.
Pick-to: 6.5 6.2
Change-Id: I3462017cb1a7580c901b98e9b1c3741853f32dc6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 32d12c2ebace41361c789e5aa58430ebf9f687b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test incorrectly failed on Linux because of a linker error
(unresolved symbol pthread_create()).
Fix by adding Threads::Threads, which provides -lpthread, where
needed.
Amends ced943e936.
Fixes: QTBUG-130621
Change-Id: I25f7a5d6528576700628a85953c2e5c1a88dfe41
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 129523280cb7a6c9af5c6edc2da09bb333bc7833)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So that we don't rely on building/running Qt auto tests just to
build the docs.
Change-Id: If3939717c57e8d4074afe0d611a1d04e65da7d36
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 876622c3e2702610ff8e26adc773441c07afb52b)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Text insertion from an input method such as Writing Tools can come in
without there being any marked (preedit) text. In this case, if there
is a selection, Qt's input-method protocol specifies that the receiver
should remove the entire selection before processing the range of the
input-method event. But we were not taking selection into account when
computing the range passed to QInputMethodEvent, resulting in inserting
the text at the wrong location.
We now consider both marked and selected text when sanitizing and
computing ranges. For now we assume that there can't be selected
text and marked text at the same time, and we also assume that the
incoming replacement range is not a subset of the selection range,
as this would mean we would need to extract parts of the selection
into the commit string up front.
Change-Id: I8948735a10265f92c01bc4e01870a7870fb1081f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 500d19bb54c8fff58b169bb3c5a9aaaa5277151f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Interface implementations related to child navigation might be
called while the object is getting destroyed, in which case the view
might already be degenerated to a widget. In that case, qobject_cast
will fail and we would dereference a nullptr later.
Prevent that by adding more nullptr checks. As a drive-by, reuse the
down-cast pointer in more of the implementation.
Pick-to: 6.5
Fixes: QTBUG-129582
Change-Id: I06a80576a5d71150787f493e2b6c9a58696eac99
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Dheerendra Purohit <dheerendra@pthinks.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9965f9a191a426e65e32b3f833f2aedcc19ef405)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Separate them with blank lines from the other ctor sets, remove an
internal blank.
Pick-to: 6.5 6.2
Change-Id: I5cb165930520681b68a85b57d05a86c0ca440805
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f68443d981babe9e2d98b9e7cad53b287d8229c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Drawing a CE_MenuItem with icons when some entries don't have an icon
resulted in a misalignment of the text for the entries without an icon.
Fix it by honoring QStyleOptionMenuItem::maxIconWidth which is set by
QMenu depending on whether on if it's entries has an icon or not.
Fixes: QTBUG-130704
Task-number: QTBUG-127536
Change-Id: I826cdce5ead5da0d1e5fdd8a5e2a6972306457b2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 44634c58ceb79a63102592ec4e1b8a7399a8a660)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The widget might become nullptr, especially after delivering events to
it. So consistently test for nullptr before calling the event function.
Fixes: QTBUG-128478
Pick-to: 6.5
Change-Id: Ieed4e8b68b41488fafd9946d718c1d77fad39a44
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 6b86d9d08b407a56bad2d37f65169e36356b0741)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 7a7f2547f3, which added the triplet
including the script before the language_Territory name without it. The
truncate-from-the-end algorithm in QTranslator ended up trying the pure
language first, and - if found - ignored any more specific territory-
variant that might be present.
To fix this, replace the truncate-from-the-end algorithm when we try
to find files, and instead create a comprehensive list of fallbacks,
avoiding duplicates as we go along. Insert those fallbacks right after
their base-entry. We then try to find files for each entry, with and
without the prefix.
This fix is needed only in 6.8 and 6.5; from 6.9 onwards, the change to
QLocale::uiLanguages in 84afaafc9c6968dd76fcadc5392065d340543521 fixes
this on the correct level, making kludges in QTranslator unnecessary.
As a drive-by, replace int indices in for-loops with qsizetype.
Fixes: QTBUG-124898
Pick-to: 6.5
Change-Id: Ia3deceb4ed2c6ef5ca0a815cc7b8878bf29ef088
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Fix tst_QSqlQuery::lastInsertId() for PostgreSQL - there must be no
other query inbetween insert and lastval() to acutally receive the
correct last inserted id.
Change-Id: I6c5bda4b1e54ec89b80caa6abf7afcc9cfe1e28b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4b9631359bd3c1cae7344846193e3d10c3a54725)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Similar to the display manager and the input delegate, keep the
accessibility delegate under the base class. Also, following the same
pattern as in the parent patch, assign a default instance for this in
the delegate in the constructor, and initialize anything later when
needed. Also, make sure calls for various objects under the
QtAccessibilityDelegate are safe and guarded.
Task-number: QTBUG-129704
Change-Id: I14a57d8e0916127ae8fa00acb3265b92803087dc
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit af73c7a99eeea346efb65bed1d6e643e74ef33a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While interfaction sounds like an interesting term, here we want to
use the more appropriate word interaction.
Fixes: QTBUG-130720
Pick-to: 6.7 6.6 6.5
Change-Id: Idbbe2176d8c3b68df80ba652312b60359d67e839
Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
(cherry picked from commit aa701532f63d0bb6b335e1ccd3acb55f682478a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We calculated the expiry at time of download by looking at Max-Age, but
as long as must-revalidate was true we would just perform the network
request anyway.
One issue this, further, highlights is our PreferNetwork and PreferCache
options having no behavioral differences while being documented to
do different things. They both consult the cache first and returns any
non-stale data from there.
Fixes: QTBUG-128484
Change-Id: I24b62e2bb072446e463482a778da7cfbd82a6835
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit e4a35df2afc306e566884f3d917daa08e41761f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
"Different" meaning here "different from the target's directory scope".
Consider a qt_add_resources call in a directory scope that's different
from the target's directory scope. Then CMake's AUTORCC would pick up
the generated .qrc file. This leads to duplicate symbols errors in the
linking phase.
The reason for that is that we add the .qrc file as source file to the
target, and the SKIP_AUTOGEN property is ineffective, because we're
setting it without the TARGET_DIRECTORY option.
This situation occurs, for example, with a qt_add_translations call in
the top-level CMakeLists.txt on a AUTORCC-enabled target that's defined
in a subdirectory.
Fix this by adding the TARGET_DIRECTORY option when setting SKIP_AUTOGEN
on the generated .qrc file.
Pick-to: 6.5
Fixes: QTBUG-130056
Change-Id: Iedc847eb85d918c5a1df20cb477e3192d1138b7f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d516a452232bd9b969db19a62586e969dfc54b39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Strangely when a QTreeview is put in GraphicsView using
QGraphicsProxyWidget, QTreeView header splitter cursor does not appears
though section can be resized without that. This change forces
the QGraphicsProxyWidget to take header splitter cursor from lastwidget.
Fixes: QTBUG-128912
Change-Id: I783e8357ae8386af70d28a1495e3b2367921df76
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 769392c3a8055af996f593dccd85ca3f775b1640)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the same value repeats many times the values y1 and y2
can end up being the same cauing an assert or division by 0.
Fixes oss-fuzz 42535976. Credit to OSS-Fuzz for finding the case.
Change-Id: I30afd5cd61163c51949a8c13d4034f4bc11d27a7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit aa1293f043f5df34ee7501efda6a6a2e8da5fa99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Change 0990bd49407aac4f96acf78761af1070ff934215 introduced a runtime
crash where callback object was being referenced rather than copied,
causing it to go out of scope and causing a segfault. This patch
captures the callback by copy explicitly.
Change-Id: I9670041273ec8f7bb53108cbaf816e895225cf02
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 05b4b1e1250843155d91c929b25d8a8e188315fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Making it easier to read following the conditions being
checked, and less temporary variables. Also, call it at
the end of onCreate() once all other operations are done.
Change-Id: Id16fb1a75ac5429e5132712a7824656ad16cbac1
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 42790db73ee5dff1dbdf3a18a516d806be3fa0ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A menu separator can contain text which is rendered by some styles (e.g.
the fusion style) so the text width should be considered during the size
calculation
Fixes: QTBUG-13404
Change-Id: I6bf0b727919d6d281df48623f0be2ca89822e85a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e45d78ecba9cfcb620b5e6815a87cf99b0f25128)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If QT_QPA_EVDEV_MOUSE_PARAMETERS=abs is used to force qevdevmousehandler
to use absolute coordinates, the first event coordinates are incorrect
(0,0)
Fixes: QTBUG-86104
Change-Id: I9352e809a4a62b15adcf279b00f2d07a72257012
Reviewed-by: Janne Roine <janne.roine@qt.io>
(cherry picked from commit de2706fa35fa0d9f43d97b7aa6a7c30d1bb22e33)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a manual cherry-pick from
2c1506b1bd551249852d43250d7919f5e3ac7ac1
With minor documentation modification (6.8.1 instead of 6.9).
Users may use their own AndroidManifest.xml and define permissions.
However in case the manifest defines a permission that a Qt module also
sets when the <!-- %%INSERT_PERMISSIONS --> template replacement is
done, an error will occur during the application build (duplicate
permission definition).
This patch prioritizes such manual permissions and removes any
previous ones a Qt module might have set.
Task-number: QTBUG-129944
Change-Id: If94c218928aa5672686dd468a8d66995508d591f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2c1506b1bd551249852d43250d7919f5e3ac7ac1)
This is a manual cherry-pick from
87cc6bb8c81b93b5c806a821e22332c80c0c37d5
Android permissions may have additional attributes such as
'minSdkLevel' and 'maxSdkLevel'. When generating the default
AndroidManifest.xml there may be duplicate permission entries, stemming
for example from two different Qt modules.
With this change the permission without any additional attributes is
given priority. The underlying assumption is that such permission is
likely the most permissive.
Task-number: QTBUG-129944
Change-Id: Id0416290780b68289c2cca0bc03dde40997d3c16
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 87cc6bb8c81b93b5c806a821e22332c80c0c37d5)
This is a manual cherry-pick from
bb8cf72233e05c88424d525ca578cbf21d66c938
With minor documentation modification (6.8.1 instead of 6.9)
Since Android-12 / API-level 31, the ACCESS_FINE_LOCATION is no longer
mandatory for Bluetooth usage. Removing it will avoid unnecessary
location permission query (user prompt).
There are less common use cases to derive the location too. In these
cases the user must override the BLUETOOTH_SCAN permission so that it
no longer asserts neverForLocation, and also request the
ACCESS_FINE_LOCATION permission separately (QLocationPermission).
This change relates to QtBluetooth change, which adds
android:usesPermissionFlags="neverForLocation" attribute to
BLUETOOTH_SCAN permission (in default-generated AndroidManifest.xml)
[ChangeLog][Important Behavior Changes][QBluetoothPermission]
ACCESS_FINE_LOCATION is no longer requested if API-level >= 31
Task-number: QTBUG-129944
Task-number: QTBUG-117358
Task-number: QTBUG-112164
Change-Id: I774d0aada4c08829860d252a616fd0c3992a853d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit bb8cf72233e05c88424d525ca578cbf21d66c938)
This is a manual cherry-pick from
5efbfcb032d801c7083d4a850d0279a075de7f1a
The function allows setting additional permission attributes like
minSdkVersion and maxSdkVersion. The function's implementation is such
that it should work alongside the older way of directly setting the
QT_ANDROID_PERMISSIONS target property.
Task-number: QTBUG-129944
Task-number: QTBUG-117358
Task-number: QTBUG-112164
Change-Id: I0f40692574848fccdf65f9baedd14351917ce4bf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5efbfcb032d801c7083d4a850d0279a075de7f1a)
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
A missing update of a "last" variable meant the loop inevitably did
nothing useful. Include type-annotation for last, while doing this.
Thankfully the check still doesn't find any duplications, now that
I've fixed it so that actually would, were any present.
Pick-to: 6.5
Change-Id: I672e6570359a3ff102a364d8af98c5c8c0bdc4d9
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 98db7a35d2ee56f5da11b4a8e745f2ee6a965077)
QTimeZone::displayName() may return empty if it has no
suitably-localized name for the zone. So QCalendarBackend's
dateTimeToString() can't rely on its tzAbbr() returning a string that
starts with UTC (and it may now, with proper L10n, start with some
other prefix) or indeed has length >= 3 (so sliced(3) could crash).
Rework the handling of offset name (mainly for the pick back to 6.8,
as I'll be back to get rid of the kludging in 6.9) to at least not
crash on empty return. In the process, use decreasingly appropriate
forms as fallbacks if we don't get what we want.
Fixes: QTBUG-129696
Change-Id: Id4f42778ca9a4806ac5dba23ce7068261a90500b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9e749df879a5bc76fa416c96f73378d81608801f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added a comment to the suppression, to make clear why it's justified.
Change-Id: Ibc8aea809a8e9467b3a194a142296ea6b79e1971
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b460d0bd809b10705d2658bfb62cb0d04835c015)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Q_GLOBAL_STATIC docs repeatedly used MyType as the name for an
illustrative type but staticType as the name for the variable of that
type. While this was surely meant to mean "static of MyType" it made
it sound like it was the name of a type. So rename it myGlobal.
Pick-to: 6.5 6.2 5.15
Task-number: QTBUG-130613
Change-Id: Ia1bb1dbdb27e45ea84daad5bd5ec77313a53236f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 60962e7a9cd765ac114de3c2eeee4ca2a7a6d21a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The documentation claimed that exists() would return true even after
destruction. This was not true when this implementation of QGS was
introduced by commit f7eff72517. The
docs in commit c0860d26a1, however,
claimed it and no-one seems to have noticed the error until now.
Both commits first landed in Qt 5.1.
Pick-to: 6.5 6.2 5.15
Change-Id: Ic92c8ead25faed0125ff583cb76420a4154af9df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e9226e6e44419affb13ebdd9c624ea8ef357dc2c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Seeing just "Enable thread support" sounds like an imperative, which
is strange to see because it is only shown if thread support was
explicitly enabled.
Reword it slightly.
Change-Id: I37596118dfc66204aa3ff81397caa818a5a91e66
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
(cherry picked from commit 649caf962f6ff9edf9bd01f5f48c32f713ba773b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Rename it to just LIBRARIES, as PUBLIC_LIBRARIES is not meant to be
used in tests.
Change-Id: Idcf35e2834de44b2dd8d11cdef0205b11e89d377
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 492deefc17435bef03964382e0abadb16d86669c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The _qt_internal_finalize_batch function had a bunch of problems,
style-wise and function-wise:
- it called find_package(Qt6) in its body, which broke when
configuring qtbase with in-tree tests
- it constantly rewrote the merged blacklist file on each
reconfiguration
- it used file(WRITE) to concatenate content
- it was in the public API file
The changes are:
- Move the function to the internal test helpers file.
- Change it to use qt_configure_file instead of file(WRITE).
- Call it at the end of the qt_build_tests for a repo, or at the end
of configuring a super build, instead of relying on a finalizer.
- Remove the find_package call. The reason this was added in the first
place, was to populate the __qt_core_macros_module_base_dir variable
so that qt_internal_add_resource configure_file call doesn't fail in
standalone tests build.
The variable was unset because the finalized function was called in
the top level directory scope, whereas the very first find_package
call was in the tests/ scope, meaning the variable was empty.
This is still a problem in the top-level build where the tests scope
and the top-level scope are different. Work around it by relying on
a global property to reset the value if it's empty.
Amends 6a9e89121d
Change-Id: Id6fe41ee86d09b8118bea52cac8a59965d7ecb9e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c997e3bb8b4a35a729f1c207b01385d1323cad2b)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Valgrind does not support those instructions yet so these tests always
fail. Skip them.
When it gets support for them, we can do a version check.
See https://bugs.kde.org/show_bug.cgi?id=383010
Change-Id: I954b2b6a9bbef1a31833fffd1cc4bc33dce353ed
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 0b41b81b9febc8f0dafd0a6a8e6571333e5415d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When Q_PROPERTY is used to define a property with type (for example)
Qt::Alignment the name of the type stored in the meta-object is
"Qt::Alignment".
When QMetaObjectBuilder.addProperty() is used it will instead use the
name of the meta-type (ie. "QFlags<Qt::AlignmentFlag>") which it has
obtained from QMetaType::fromName("Qt::Alignment").name().
In the QMetaProperty ctor it tries to resolve the QMetaEnum for the
property and uses the internal parse_scope() to extract the scope and
qualified key from the name. However it does not handle template names
and so fails with dynamically created properties.
This change to parse_scope() removes the "QFlags<>" so that the
template type can then be parsed.
Another solution would be for addProperty() to always use the type name
it was given rather than use QMetaType::fromName(). That has the
advantage that the layout of the dynamic meta-object would match that
generated by moc.
Change-Id: Iac9e2db2f134029709158b4e500286922396501d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5624060865e3ccd3c487f10355cb740b7322f93c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The qHash implementation for QModelIndex is not very good resulting in
hundreds of collisions in the hash table. This means most lookups in the
table essentially becomes a linear search. This was 'generically' fixed
for Qt 7, but couldn't be fixed for 6 because of the qHash
implementation is inline and would result in different hash values for
the same QModelIndex in different translation units.
To work around this for this particular instance, we wrap the
QModelIndex in a struct that has the fixed qHash implementation.
Fixes: QTBUG-130309
Pick-to: 6.5
Change-Id: I586fb10cadf73900f3d644f421c37b381224a419
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1558811a8485f6dcc51a50a2bba0846091ca8bf6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It should allow a through f for hex digits as well.
Fixes: QTBUG-130119
Change-Id: I79a13d4e5dfee5c4c229eb64c26a5530928d0495
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ff5bc9266a39dc1d63ca02f592089bd4c2d9c4f6)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
On Windows, file- and directory-names that end with a space (or a dot)
are invalid, even though it's possible to create them. Same for names
that start with a space (but starting with dots is ok). Even Explorer
chokes when trying to then delete or rename such a file or directory,
and often the only way out of the mess is to operate on the 8.3 path.
In Qt, we only sometimes fixed such paths by removing trailing spaces
and dots. This still made it possible to create a "bad " directory in a
non-native file dialog, which could then not be deleted. The node tree
even ended up with both "bad " and "bad", neither of which was handled
correctly.
Fix this by always chopping trailing space and dots when adding or
modifying a node, amending 3693d3d2a1e76f6e6d41db340505e00c6ddaeda1.
Fortunately, this can be reproduced with QFileSystemModel, so add a test
that exercises it in the same way as QFileDialog does, e.g. both by
creating the misnamed directory directly, and by renaming a directory to
an invalid name.
Given that this is very broken on Windows Explorer as well, don't
cherry-pick this back into branches under strict change management.
Fixes: QTBUG-129028
Change-Id: Iec1edf9fd2548dda4567134a9b5cf3e298589c19
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 53df22b42d73dbb48bc25ad05500993df56b928c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This makes tqtc/ branches to use the public branches.
Amends 2a0e89981a52633c497f62bad0c7d26c466493cb
Task-number: QTBUG-124453
Task-number: QTBUG-125211
Task-number: QTBUG-125569
Task-number: QTQAINFRA-3935
Change-Id: I1098165c3122befabc503d38c46d476920d835a2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit 701f688d9909c45f37d497746a6d6d893be4a5f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If an item's shape() path described a rectangle not starting at the
top left corner, the code setting up clipping would correctly identify
and attempt to use it as a rectangle. However the conversion to a
QRectF would produce a non-normalized rectangle, which could lead to
unexpected clipping results. Fix by ensuring the rect is normalized.
Fixes: QTBUG-128488
Change-Id: Icbd17a95dde46a1969994f5eac021ac7b8ac5689
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 0cba6115605f586109a9b167a7d220670c5cda03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since all it needs is Qt::HANDLE qglobal.h is an overkill.
Task-number: QTBUG-106722
Change-Id: Ib000532bae3500a06c548b3c308e28bf0abf80d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dee05596d3ef95572e97a84191f9141e9231e75f)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The code tells that it was deprecated since 6.2, but the docs were
incorreclty mentioning 6.1. Fix it.
Amends fe9d7bf759
and a2c8184b6b.
Pick-to: 6.5 6.2
Change-Id: Icff14ccc5d581d27d721241e8d594ac9fad8e7a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 65e9c215ff25f7b97520a2b502548c5f5af0e589)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>