Commit Graph

63232 Commits

Author SHA1 Message Date
Edward Welbourne
77fdd21cbf Serialization converter example: const-ify the Converter type
Its methods act on their parameters without changing the converter, so
can all be const. Its instances thus have no non-const members to
exercise, so can always be const.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Ifcdb2f2159c2cfcd7998dd118aa327a32d299ccf
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-09-08 18:17:37 +02:00
Edward Welbourne
eaebb5c4d2 Separate streaming dumper and converter in the convert example
The two were in the same files but mostly unrelated to one another -
aside from the converter defaulting to the dumper for output.
Furthermore, the dumper actually uses QDebug and QTextStream, not
QDataStream; rename it to reflect this reality.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: Id65c120c319b555039f7fd186ed262f35ff5260a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-08 18:17:37 +02:00
Edward Welbourne
d8517fb1ab corelib/serialization examples: clang-tidy and coding style clean-up
I overrode clang-tidy where it uglified or obfuscated and did some
clean-up provoked or made possible by its changes. Konrad pointed out,
in review, a constructor that could be = default; it could, in fact,
vanish entirely as a result.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I9b7744a3abaa29e6f9e0689d0f6985bfd88cd0fd
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-09-08 18:17:37 +02:00
Edward Welbourne
319b2e0e86 corelib/serialization examples: use string literals more
A couple more compilation units could use Qt::StringLiterals. Prefer
QL1SV for the code constants, to keep code small. Convert fpToString()
to take QL1SV instead of const char *, with suffix empty by default.
Also rearranged some spacing, some if it suggested by clang-tidy.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I03d810d52afcd4a760d18f2553914b75af716b74
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-09-08 18:17:36 +02:00
Mårten Nordheim
e4d545b4c6 QWindow: Fix error for unused capture
Amends 89ce65c2d0

Pick-to: 6.6
Change-Id: Ifddf6b2e849929137d1db8f777a7cb9fa3cd2038
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-09-08 18:17:36 +02:00
Ahmad Samir
09b852b1d8 examples/: compile with QT_NO_CONTEXTLESS_CONNECT
Examples are usually a good way to get to know a new codebase, do not
teach developers who are new to Qt about the 3-arg connect() to begin
with.

Drive-by changes:
- `this` can't be implicitly captured with [=] in a lambda, instead
  capture by reference
- Update docs related to the sqlbrowser example; the overloaded signal
  it mentions has been removed in Qt6
- In the sqlbrowser example, rename addConnection() (no-arg) overload to
  openNewConnectionDialog, suggested in code review

Change-Id: I30c9f35bda4ac2f460d767ab7f84422ae3ed09f7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-08 19:17:36 +03:00
Christian Ehrlicher
9016def4dc tst_QAbstractItemModelTester: fix unittest
rowsAboutToBeMoved() and rowsMoved() signals aren't emitted for
QSortFilterProxyModel, which meant the two connections in the
ObservingObject's constructor didn't trigger the slots, which let the
test pass (the store/checkPersistentFailureCount stayed at 0).

- Instead connect to layoutAboutToBeChanged() and layoutChanged()
  respectively, these two are emitted for QSFPM
- Use PMF syntax
- Verify m_persistent{Proxy,Source}Indexes aren't empty

Change-Id: I8b83989de02c2bfb22bde9b230cb5b68814f74b6
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-08 19:17:36 +03:00
Anton Kudryavtsev
9c819c9073 tools: use const methods more
to avoid implicit detach

Change-Id: I6268d4397631a2a2ff54263dfd0b28a7990c5993
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-08 19:17:36 +03:00
Anton Kudryavtsev
d232acbce0 dialogs: use const methods more
to avoid implicit detach

Change-Id: I2d46696a29f2a454452239e0400af2e2de534cbb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-08 19:17:36 +03:00
Anton Kudryavtsev
9a198e23d9 Tidy up qgraphicsview: use nullptr more
Change-Id: Ie4d2b64175cba12e884260455814774bce8c8787
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-08 19:17:35 +03:00
Anton Kudryavtsev
6327e3679c QGraphicsScene: use const methods more
Avoid unnecessary detach.

Change-Id: I206a7df677119ec309c6c176de881469db057165
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-08 16:17:35 +00:00
Anton Kudryavtsev
d6bd73a343 widgets: use const methods more
to avoid implicit detach

Change-Id: I44b2924decd3c650ece377784f4a73b4e5bbd6c6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-08 19:17:35 +03:00
Anton Kudryavtsev
e312fbc990 qcompleter: avoid implicit detach
by const method usage

Change-Id: Iade97ee80ed9a89915e89b9f17f12b1842c1baab
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-08 19:17:35 +03:00
Anton Kudryavtsev
a9ffdc59a7 testlib: use const methods more
to avoid implicit detach

Change-Id: I8c7de3b7d6a84299714f837da5c9feb39074d0c2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-08 19:17:35 +03:00
Anton Kudryavtsev
8e88797b36 qtls_schannel: avoid implicit detach
by const method usage

Change-Id: I27863d691c228275fc795dfcfbcbcd11e438abc9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-08 19:17:35 +03:00
Anton Kudryavtsev
bf06af559c qxdgdesktopportalfiledialog: avoid implicit detach
by const methods usage

Change-Id: Icbe3e7764ddbb385293c371463d1619d8bd388b6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-08 19:17:34 +03:00
Giuseppe D'Angelo
5e2f22f8a1 QHostInfo::lookupHost: do not violate lookupHostImpl preconditions
lookupHostImpl requires either `receiver` or `slotObj` to be non-null.
Since this code path deals with the string-based slots, `slotObj` is
going to be null, therefore check that `receiver` is non-null.
For completeness: also check that `member` is non-null.

Emit a warning (à la QObject::connect) in case the user did something
wrong.

Change-Id: Ic6dcd51d7ddd977b121484369b1aef48844364c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-08 13:30:36 +02:00
Simo Fält
a2e731e7e2 COIN: Increase timeout for running sbuild for debian packages
Change-Id: Id0b53dece8d4bbf1faa89c1ec409c5d241129779
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 208a587b01)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-09-08 11:30:36 +00:00
Marc Mutz
de6f405313 QLibraryInfo: fix GCC ubsan build
Same bug that plagues tst_qbytearrayview.cpp, similar fix: drop the
static checks for GCC. Except that here, following code uses the
variable, so it needs to exist. Fortunately, the GCC ubsan bug does
not affect construction from a string literal, so we can use
that. This is losing the position checking for "." in qtConfEntries,
but the the original author (Thiago) informs me that was just a way to
save two bytes, we don't actually need the assertions, so remove them.

As a drive-by, remove the unneeded, and potentially pessimizing
(forces the compiler to allocate storage for it in the binary), static
keyword from the constexpr variable, which should more than make up
for the extra two octets.

Pick-to: 6.6 6.5
Change-Id: I88397ac61c5cd8f53d39e957212c895239aace04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-08 11:32:44 +02:00
Marc Mutz
defabd265e tst_QFont: fix -Wsign-compare
Amends 17f8e2c441.

Pick-to: 6.6
Change-Id: I896027866c11b5e135c39848cefcf45942f1cf99
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2023-09-08 11:32:44 +02:00
Marc Mutz
9c63667d01 tst_QHashFunctions: fix std::pair test to use QFETCH_GLOBAL seeds
Because the local `seed` variable shadowed the member one, this test
was run for each QFETCH_GLOBAL with the same data and seed. That
doesn't make sense, so make the test use the member variable `seed`,
as all other tests already do.

Since zero is one of the seeds coming from QFETCH_GLOBAL, drop the
seedless calls to qHash(), too.

Amends 64bfc927b0.

Pick-to: 6.6 6.5 6.2
Change-Id: I1e22ec0b38341264bcf2d5c26146cbbcab6e0749
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-08 11:32:44 +02:00
Marc Mutz
8ca319a172 tst_QHashFunctions: test with actual 64-bit seeds
The old code only tested with seed = 0 and seed = 1045982819, the
latter being a "random number", which, however, fits into
32-bits. Since Qt 6.0 increased the seed from uint to size_t, amend
the test to actually test a seed value with some of the upper half of
bits set, too, also in 64-bit mode.

While we're at it, also test with each seed's bits flipped for extra
coverage.

Remove a static assertion that prevented testing seeds with the MSB
set.

Pick-to: 6.6 6.5 6.2
Change-Id: I5ed6ffb5cabaaead0eb9c01f994d15dcbc622509
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-09-08 09:32:44 +00:00
Anton Kudryavtsev
003aa16e92 qthreadpool: use const methods more
Change-Id: I16c017e5ff89075aa8faabcc8540d3bd10c80d45
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2023-09-08 12:32:44 +03:00
Volker Hilsheimer
03d62322b2 QComboBox on macOS: guard against destruction while native popup is open
Since showing the native popup on macOS is blocking and processes events
the QComboBox might get destroyed while the popup is open. Guard against
this by using QPointer and returning early (dismissing the scope guard
that would otherwise reset the menu's parent, writing to freed memory).

The problem is then that the native popup remains visible, as the
destructor of QComboBox calls cleanupNativeCombobox which destroys the
platform menu (i.e. the QCocoaMenu instance), but that doesn't dismiss()
the popup. Add a call to dismiss() to the QCocoaMenu destructor to make
sure that destroying the menu closes it first.

Fixes: QTBUG-116155
Pick-to: 6.6 6.5
Change-Id: If0ac19796603667f4c8e80c302710dc4c9aded50
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-09-08 07:20:10 +02:00
Tor Arne Vestbø
6cf4c5b98f CoreText: Resolve color scheme (dark mode) via the platform theme
We might be drawing glyphs outside the main thread, which triggers
the main thread checker for our access to NSApplication from
qt_mac_applicationIsInDarkMode().

Change the CoreText font engine to pull out this information from
the theme instead, and teach the theme to only updates its color
scheme on the main thread.

Pick-to: 6.6
Change-Id: I02be713d9705c6e0c21107db7f7de039182f601d
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-09-08 07:20:03 +02:00
Tomasz Kozlowski
c8fb928029 Change MaxKeyCount type from enum to static constexpr int
The change was needed because std::fill_n(), which takes it, does not
handle enum type on VxWorks. As it was anonymous with only one member,
it could be changed to static constexpr int.

Task-number: QTBUG-115777
Change-Id: I7cb4d267ad21f6b963d851e30bc91042fbf5c15a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-07 14:36:46 +00:00
Timur Pocheptsov
28ab45182a macOS: Use non-native fallback for message boxes with rich text
The NSAlert messageText and informativeText properties only allow
plain NSString, so we need to opt out of the native dialog if the
user has requested rich text for any of these properties.

Fixes: QTBUG-116757
Change-Id: I3fd44ec94adad1dda1ed4dede46450a8a525d35f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-09-07 14:36:46 +00:00
Kai Köhne
bd9a32adca Doc: Mention reset methods for QCalendarWidget::maximumDate, minimumDate
Pick-to: 6.6
Change-Id: Ic3bfbcec1ac7d31ab704b52e6560d44f4a2054e7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-07 16:18:26 +02:00
Kai Köhne
9937181159 Doc: Fix documented default for QCalendarWidget maximumDate, minimumDate
The default minimum date and maximum date for QCalendarWidget are not
the 'earliest and last dates' that QDate class can handle. Instead,
minimumDate is initialized to November 25, 4714 BCE (first Julian day),
and maximumDate to December 31, 9999 CE.

Pick-to: 5.15 6.2 6.5 6.6
Change-Id: Ice9289853a7e825ff2b31567efb81cdfb7d678a1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-07 16:18:26 +02:00
Morten Sørvig
112e86a01e wasm: Mark switch case as unreachable
Fix "non-void function does not return a value in all
control paths" warning.

Change-Id: Idc58319b2704895ec56decabbdad67ffbf633ad7
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-09-07 14:18:26 +00:00
Morten Sørvig
bcd3e500e1 wasm: make all val() accessors const
Enable using them in a const context, for instance when
calling "const" native API.

Change-Id: I0b3fe33ab7fabf4bda8565d4de88bb21367d356e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-09-07 16:18:26 +02:00
Morten Sørvig
89ce65c2d0 Always run screen change side effects
processWindowScreenChangedEvent() returns early if the
screen for the (top-level) window has already been updated,
for instance by a call to handleScreenRemoved(). This was
preventing us from updating the DPR and window geometry.

Move the code a slot connected to QWindow::screenChange,
which gets emitted for all windows (also child windows),
whenever the screen changes.

Pick-to: 6.6
Fixes: QTBUG-116232
Change-Id: I44701fd001ab1fd54efe9c8451c6a58cfc0b285f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-09-07 16:18:26 +02:00
Morten Sørvig
fefb1e18b1 wasm: don't crash if app is deleteLater()ed
We check for a valid event dispatcher when waking up,
but there was no check after processing queued events,
and processEvents() would continue with a stale this
pointer if one of the queued events happened to delete
the application object.

Fix this by checking if this is still a valid pointer
after processing events.

Fixes: QTBUG-116330
Pick-to: 6.6 6.5
Change-Id: Ic4d91298986847e6095ce9daea51a4b974106c06
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-09-07 14:18:26 +00:00
Dennis Oberst
09e698d826 QList: use new assign() in operator=(std::initializer_list)
operator=(~) and assign(~) share similar names but, until now, have not
shared the same functionality. This patch introduces the usage of
QList::assign() within the non-sharing assignment operator to
effectively boost efficiency by reusing the available capacity.

Task-number: QTBUG-106201
Change-Id: I01a0511af336f2f410158a07d91e5759c8ff46db
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-07 15:05:05 +02:00
Dennis Oberst
3db9ef358d QArrayDataPointer: remove Q_CHECK_PTR in assign(it, it) again
This commit reverts 2d77051f9d.

When requesting an allocation of size 0, we will actually get
a nullptr.

 qarraydata.cpp:
    ~~~
    if (capacity == 0) {
        *dptr = nullptr;
        return nullptr;
    }

This will let the Q_CHECK_PTR trigger falsely. Such an occurrence was
initially detected during the cmake_automoc_parser build-step.

Found-by: Marc Mutz <marc.mutz@qt.io>
Task-number: QTBUG-106196
Pick-to: 6.6
Change-Id: Icb68c5dd518c9623119a61d5c4fdcff43dc4ac5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-07 15:05:05 +02:00
Anton Kudryavtsev
02e2a3f123 qtextengine: use RAII more
replace new/delete with unique_ptr

Change-Id: Iac36885041ee15bd2ecf6bb487dacf613e126475
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-07 16:05:05 +03:00
MohammadHossein Qanbari
d8b7c03cc5 doc: Remove QSettings' paths for embedded linux
Embedded Linux is just Linux nowadays.

Fixes: QTBUG-116715
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I1f64d27550db6f711c7f1f578e85cad12d0973aa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2023-09-07 15:05:05 +02:00
Safiyyah Moosa
a1d308a316 Doc: Add \examplecategory for qtconcurrent
Task-number: QTBUG-116071
Pick-to: 6.5 6.6
Change-Id: I7413a0d8085eec38e6480f6aa21c85620ca68f54
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-09-07 15:05:04 +02:00
Anton Kudryavtsev
b9c10312f9 qsslcertificate: use _ba literal more
to reduce allocations

Change-Id: I10a449887b79e40fb4e501634f64b9c86cc8f111
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-07 16:05:04 +03:00
Anton Kudryavtsev
576e7d49f5 qsslcertificate: use QStringView more
to avoid needless allocations

Change-Id: I54d159cbaa0854355286c942a6971e45c4494a14
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-07 16:05:04 +03:00
Anton Kudryavtsev
f5f78400e1 qsslcertificate: use QAnyStringView more
to avoid needless allocations

Change-Id: I03494d7075e2f333cbd3974797d9ea97f2c915fd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-07 16:05:04 +03:00
Anton Kudryavtsev
cd0f4d2eef qsslcertificate: avoid implicit detach
by using const methods

Change-Id: I62bf869ed1fd4109c855caafa88b8f29a6e5cc05
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-07 16:05:04 +03:00
Anton Kudryavtsev
996a0c85e7 QHttpNetworkConnectionChannel: reduce allocations
- don't use QMap::values, just iterate over QMap directly
- use const methods to avoid implicit detatch

While touching code, use isEmpty() to check container instead of size() with 0

Change-Id: I300b5f123f339dc92a4f932bd0b356f31ead3589
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-07 13:05:03 +00:00
Anton Kudryavtsev
ace5ec8179 QEvdevTouchScreenData: use string view types more
Change-Id: I28b3a8f48bf99cc87d2fdea9a370fce62a233959
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-07 10:46:15 +03:00
Anton Kudryavtsev
b601ea7f8b testlib: use string view types more
Change-Id: I59886bca9c90cce6aa00e3cbe09a3991b6b4ce79
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-07 10:45:08 +03:00
Øystein Heskestad
d83aabad0f Add static constexpr Boyer-Moore Latin-1 string matcher
QStaticLatin1StringMatcher is a static templated Latin-1 Boyer-Moore
string matcher which can be case sensitive or not. It should be used
when the needle is known at compile time so there is no run-time
overhead when generating the skip table.
The convenience functions qMakeStaticCaseSensitiveLatin1StringMatcher
and qMakeStaticCaseInsensitiveLatin1StringMatcher should be used to
construct the matcher objects.

Green Hills Optimizing Compilers are currently not supported.

[ChangeLog][QtCore] Added QStaticLatin1StringMatcher, which can be used
to create a static constexpr string matcher for Latin-1 content.

Task-number: QTBUG-100236
Change-Id: I8b8eed1e88e152f29cbf8d36d83e410fafc5ca2c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-09-07 09:38:36 +02:00
Giuseppe D'Angelo
f18082bbed QHostInfo::abortLookup: ignore -1
The id -1 is the one of a default-constructed QHostInfo (invalid).
It's also returned by various codepaths to mean a lookup failure.
Attemping to abort its lookup should simply be ignored.

Change-Id: I0413dd248a890f57195e4f5b5baea011b6737102
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-07 03:26:37 +02:00
Jonathan Ketchker
55f0738f16 Add StateLocation & GenericStateLocation to StandardLocation
The latest XDG spec (0.8) defines XDG_STATE_HOME that does not exist
in QStandardPaths::StandardLocation.

Some Linux distributions clean XDG_CACHE_HOME on restart which makes
XDG_STATE_HOME useful as a path for saving application state.

This commit adds StateLocation and GenericStateLocation to serve as a
StandardLocation for XDG_STATE_HOME for all platforms.

This commit also updates docs and tests to fit the new changes.

[ChangeLog][QStandardPaths] Added StateLocation &
GenericStateLocation to StandardLocation

Change-Id: I470602466c37f085062cc64d15ea243711728fa5
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-07 01:17:13 +03:00
Volker Hilsheimer
505ed52cd4 Dialogs: clean up native dialogs when object gets destroyed
QWidget::setVisible is virtual, and called via hide() by both the
QDialog and the QWidget destructor. A dialog that becomes invisible
when getting destroyed will at most execute the QDialog override.
Subclassing QDialog and overriding setVisible() to update the state
of the native platform dialog will not work, unless we explicitly
call hide() in the respective subclass's destructor.

Since e0bb9e81ab, QDialogPrivate::setVisible is
also virtual, and gets called by QDialog::setVisible. So the clean
solution is to move the implementation of the native dialog status
update into an override of QDialogPrivate::setVisible.

Add test that verifies that the transient parent of the dialog
becomes inactive when the (native) dialog shows (and skip if that
fails), and then becomes active again when the (native) dialog is
closed through the destructor of the Q*Dialog class. The test of
QFileDialog has to be skipped on Android for the same reason as the
widgetlessNativeDialog.

Fixes: QTBUG-116277
Pick-to: 6.6 6.5
Change-Id: Ie3f93980d8653b8d933bf70aac3ef90de606f0ef
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-09-06 23:12:33 +02:00
Anton Kudryavtsev
238d8795b1 qt_getImageTextFromDescription: use tokenize instead of split
to avoid creation of tmp list

Change-Id: I53917263fe9e904596ccc5af6a72bb3d906b21dc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-09-06 22:36:06 +03:00