Commit Graph

51971 Commits

Author SHA1 Message Date
Fabian Kosmale
27952957d7 Revert "QMetaType: Don't normalize name which should already be normalized"
This reverts commit f6fa4b39ee.

Reason for revert: c76a2d7c9c was
not enough to catch all cases.

Pick-to: 6.2
Change-Id: I5830ab20b1f4d26a0a201c3dd5aaee6b10aa12ac
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-09 07:05:45 +00:00
Laszlo Agocs
03650696a1 windows: gl: Print GetLastError() when makeCurrent fails
This matches the behavior of other implementations, such as
QEGLPlatformContext: doing a qWarning with the relevant error
from eglGetError() or equivalent is helpful when something
goes wrong and should be common among QOpenGLPlatformContext
implementations.

Pick-to: 6.1
Task-number: QTBUG-85714
Change-Id: Ifa5d22b83808c92ae92efcbcddc8d8c3d3ba34b1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-06-08 23:51:54 +02:00
Volker Hilsheimer
ddc886d670 QListView: add assert for static analyzer
The loop that initializes the item should execute at least once, so the pointer
should be pointing to something valid. The static analyzer doesn't see that,
and warns about unguarded access to the item pointer in report with hash
d008dbef4573afca54be0139e2971a4a. Add asserts for both the condition that makes
the loop run at least once, and for the item pointer not being nullptr.

Pick-to: 6.1
Change-Id: I94b9f3db3b3ce3d82445cf66788c05854b441aaf
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-06-08 23:10:11 +02:00
Volker Hilsheimer
4a23a1fbb5 Correct examples for int validation in QValidator documentation
QIntValidator::validate documents correctly that any input with "at most
as many digits as the top of the range" returns Intermediate. This is
needed to avoid input deadlocks where one can't go from 9 to 15 if the
range is 8 to 16.

Fixes: QTBUG-94269
Pick-to: 6.1 5.15
Change-Id: I6776e09fc231249fe78f9e6106492f8454b70a03
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-06-08 21:10:11 +00:00
Giuseppe D'Angelo
ae8b21c3df QPromise: doc fixes
Add a noexcept from a doc signature that was missing it.

Change-Id: I30b429a6ec4d182551ca68767d1c8aa61c9e4c09
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-06-08 22:41:58 +02:00
Giuseppe D'Angelo
d598066dcf QFutureInterface(Base): code tidies
refT()/derefT() can be marked noexcept; we don't care about not
overflowing the refcounter as a precondition. (This is BC, as no
compiler mangles noexcept.) This in turn allows to mark a constructor
calling refT() as noexcept.

Driveby: mark also the same functions to not be `const` in Qt 7.
They clearly are meant to modify *this, and constness only works
because of the unmanaged (raw) d-pointer.

Change-Id: I8d7d365640ff2e1cedc0a234c9abccdfc95ba6e3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-06-08 22:41:58 +02:00
Giuseppe D'Angelo
49c5724cb8 QPromise/QFutureInterface: in Qt 7 take std::exception_ptr by const-ref
std::exception_ptr is a reference-counted "smart pointer", so we
shouldn't copy it around freely. Unfortunately QFutureInterface
has exported functions taking it by value, so we can't just change
the signatures and keep BC. Simply prepare the code for Qt 7.

Change-Id: Ic5aae6a095c8c842872a40db440c99d2dfe371f1
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-06-08 22:41:58 +02:00
Alexandru Croitor
524b957d1f CMake: Fix global 'apk' target to apply to Qt EXTERNAL_BUILD examples
This means calling 'ninja apk' in a Qt build with examples configured
will build all example apks, regardless of whether the examples are
built as external projects or in-tree.

Fixes: QTBUG-94264
Change-Id: I5c7af0354858898a2e154a6d54fb025e4d81ff80
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-08 22:37:50 +02:00
Alexandru Croitor
8b8679f73d CMake: Fix global 'apk' target to actually build all apks
This means calling 'ninja apk' in a user project with multiple android
applications will build all their respective apks.

For user projects, make the 'apk' target part of the global 'ALL'
target, so that a regular 'ninja' call implies the 'apk' target.

We don't do it currently for Qt builds, because certain test
executable apks fail to build.

Add a QT_NO_GLOBAL_APK_TARGET_PART_OF_ALL variable to allow removing
the global apk target from the 'all' target.

Pick-to: 6.1
Task-number: QTBUG-94264
Change-Id: I171b9da50eb7d670176704bd26dc1c492118b434
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-08 22:37:50 +02:00
Robert Löhning
9b625ec89d rhi: Use QByteArray for storing data in QGles2Buffer
Mainly to avoid leaking memory again. A possible reduction of memory
allocations would be a welcome side effect.

This reverts parts of 89f7389494.

Change-Id: I65a7529f532175967a4e408450aa55549b77d7e4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-06-08 21:27:41 +02:00
Robert Löhning
7661fdce0a QIcc: Update test for invalid values
This should have happened when changing the code in
f493d41722

Fixes oss-fuzz issue 31633.

Pick-to: 5.15 6.1
Change-Id: I7945c3f90651f8fa04df20fbaf0b0c7f68619407
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-06-08 18:46:34 +02:00
Tor Arne Vestbø
3d7bdf0d61 qmake: Switch to using Xcode's new build system
Now that inputs (81152194) and outputs (3f0858ed) are explicitly set for
the preprocess stage we can enable the new build system.

Using the legacy build system will produce a build error in Xcode 13,
but the build will succeed:

  error: The Legacy Build System will be removed in a future release.
  You can configure the selected build system and this deprecation
  message in File > Project Settings.

Fixes: QTBUG-71035
Pick-to: 6.1 5.15 5.12
Change-Id: I108d2103872255d10de2ff5161eef892065da1c4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-08 17:28:47 +02:00
Timur Pocheptsov
096b186004 tst_QNetworkReply::ignoreSslErrorsList, use the right error
The error that the actual runtime will encounter, and not the one that compile-time
ifdefs will (potentially) erroneously select.

Change-Id: I8ef4c34bcb8b3e568bc39f8c8ea6bfb7732f9e27
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-08 16:17:23 +02:00
Fabian Kosmale
f6fa4b39ee QMetaType: Don't normalize name which should already be normalized
The name stored in a QMetaTypeInterface should already be normalized, as
a static metatype uses typenameHelper, which takes care of
normalization via QTypeNormalizer.
For dynamic metatypes, we don't have that guarantee, but those can only
be created by Qt, as there is no public API for it. We can thus ensure
that we only create normalized typenames (which we currently do anyway),
and skip the normalization in registerCustomType.

Change-Id: I18728031825cd39fdbe17cad0fbc6e3b5fd03c93
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-06-08 15:37:38 +02:00
Fabian Kosmale
c76a2d7c9c normalizeTypeFromSignature: Beware of anonymous struct/union
Do a quick check whether the type name contains an anonymous type. If
so, do not try to use optimized version. The simple check should still
be faster than calling normalizeType unconditionally.

Also only apply the faster version for clang and gcc, instead of all
non-MSVC compilers. Applying it to other compilers would require further
testing to handle anonymous structs.

Moreover, remove space before '(', which is necessary for function
pointers.

Fixes: QTBUG-94213
Change-Id: I795d1964f7a68daa6f9a5f262816d51ee7728788
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-06-08 15:37:38 +02:00
Mårten Nordheim
14b74af060 QNetworkInformation: Adjustments to captive portal API
Make it return bool since the TriState was really only used signify that
the property was unsupported but there is already a separate way to
check if it's supported. More importantly there is no different set of
actions available to a user if they're in the Unknown or False state.

Because of the change to bool, we also rename the property to have an
'is'-prefix.

Change-Id: Iaaaad5ac31e663c36e00223bf5b0e719f412fc69
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-06-08 14:54:16 +02:00
Mårten Nordheim
c34b596119 QNetworkInformation: Some cleanup in NetworkManager
Change-Id: I7e0fce63883019278ceb9dc757bf10ee9d77097c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-08 14:54:16 +02:00
Mårten Nordheim
0baf172611 QNetworkInformation: Captive portal support for NetworkManager
Task-number: QTBUG-93848
Change-Id: I0d31e7ed75e9dbf5c7aac851982d9ed1ac226693
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-06-08 14:54:15 +02:00
Mårten Nordheim
2a60c4b99f QNetworkInformation: Captive portal support for Windows
Task-number: QTBUG-93848
Change-Id: Ic1ca895a73c98772aba900bbc3be18ba62be6c0f
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-08 14:54:15 +02:00
Volker Hilsheimer
c8cb240947 Calculate space requirement of menu items based on widest elements
Since icon, checkmark, text, and shortcut are each rendered aligned
within their own column, we need to take the widest of each element
into account when calculating the size requirement of each item. Otherwise
an item with very long text but no icon will get enough space for the
text, but no space for the icon, resulting in the text running over the
shortcut or edge of the menu.

Fortunately, QStyleOptionMenuItem provides us with the necessary
information.

Fixes: QTBUG-86754
Pick-to: 5.15 6.1
Change-Id: I0cf0e9adfe480d1004106e7475e498e718bf027b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-06-08 13:27:27 +02:00
Andy Shaw
e5aada1ba7 Doc: Add a note about a limitation in QDockWidget on macOS
Pick-to: 6.1 5.15
Change-Id: I3599304d2dab9a6e64f110644b22e65494f3c0a8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-06-08 12:56:38 +02:00
Kai Köhne
a880c791ec Fix MSVC compiler warning in code snippets
Fixes
 warning C5046: 'testObject::MyTestObject::toString': Symbol involving type with internal linkage not defined

Change-Id: I9925eb15e262f29e636c019c87311a6ea2c47505
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-06-08 08:33:56 +02:00
Lorn Potter
6ab665b9f3 wasm: fix up compiler message
It's Emscripten compiler, not wasm compiler.

Change-Id: I39e754be9486500d9bba71006642fbdb1261c84c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-06-08 09:26:04 +10:00
Lorn Potter
1b4fe5d388 wasm: fix threaded builds
set the thread pool size default to 4

Change-Id: I038a81610c82ac4d162c044d0e1f58196cffc7b7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-06-08 08:10:43 +10:00
Volker Hilsheimer
14e09ada69 Fix rearranging of icons in listview via drag'n'drop
Since 0f1008a593, views record if they
moved the item in the model, and prevent the deletion of the source item
in QAbstractItemView by setting the dropEventMoved private data member.

However, QListView in icon mode is special: it doesn't rearrange the
model, it repositions the icons in the view. While the dropEventMoved
logic was applied to the drag event filter to prevent deletion, the
variable was never set in the filterDropEvent handler. The drop event got
ignored, breaking rearranging of icons.

Fix this by setting the dropEventMoved member in filterDropEvent.

Fixes: QTBUG-94226
Pick-to: 5.15 6.1
Change-Id: I963f5db0f81bcd0d25eef05d9a265be00a5871f6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-06-08 00:10:42 +02:00
Volker Hilsheimer
efdaba37d6 QAItemView: in MultiSelection, press deselects only if no drag can start
In MultiSelection mode, items are by default toggled on press, which
follows the example of standard Windows controls. However, when dragging
is enabled, then the press might be the beginning of a drag'n'drop
operation, and deselecting the item on press breaks the selection and user
experience.

Don't toggle the selection for presses on an already selected item that
might get dragged; instead, wait for the release event.

Extend the test case slightly to cover the special case. Dragging a
selection in a drag-enabled and MultiSelection item view wasn't possible
before either.

Fixes: QTBUG-59888
Change-Id: Ibd3e95a71ea63dd1e9bc3c8a723eafa9a1c21afa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
2021-06-08 00:10:42 +02:00
Karsten Heimrich
8654192f8f Switch-ify QFSFileEngine::fileName and update implementation
Adapt to coding guidelines and use raw string literals.

Change-Id: Ice9a87cafb22e01a361ad44221d561a298e5af05
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-08 00:05:44 +02:00
Assam Boudjelthia
b216b360ac Android: Use the new runOnAndroidMainThread() call
Remove the [&] capture in runOnAndroidMainThread() for void type.

Replace the old private QtAndroidPrivate::runOnAndroidThread()
with QAndroidApplication::runOnAndroidMainThread().

Task-number: QTBUG-90501
Change-Id: I41eaf1ea9ee68b22861bf498f12a97a02515cc47
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-06-07 22:43:01 +03:00
Assam Boudjelthia
c08b9a49ba Android: don't call qmlimportscanner if no qml dir exist
If only qtbase is installed, androiddeployqt might call qmlimportscanner
which will fail to find a qml dir under the Qt install path. Thus, we
check if the qml dir exists before calling qmlimportscanner otherwise
throw a warning.

Fixes: QTBUG-89588
Change-Id: I706eb2a233e9ab5b250652cd46aae75cab178648
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-06-07 18:40:27 +00:00
Assam Boudjelthia
1365a1c7a7 Android: fix androidtestrunner passing when output file doesn't exist
Task-number: QTBUG-88508
Change-Id: If19d2b272b1760228b6a1e6e1af6db3bfbf0ec1e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-06-07 18:40:27 +00:00
Mårten Nordheim
6765dbf77a QTimeZonePrivate: make windowsId return a QByteArrayView
In debug this cuts off about 4 seconds off of the qtimezone test on my
machine. In release it's about 300-400 milliseconds.

Change-Id: I92ec18794247e3846704a7c8e87a8c34fdae5e3c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-06-07 20:23:17 +02:00
Volker Hilsheimer
dc5e8aa81c QAbstractItemView: don't toggle extended selection on Ctrl+Press
In ExtendedSelection mode, a Ctrl+Press might be both the start of
a selection toggle, or the start of a Ctrl+Drag operation.

If we already toggle on the press, then it's impossible to drag the
existing selection while the Control key is pressed. Ignore Ctrl+Press
events and let the corresponding release event toggle the selection.

Adjust the relevant test cases accordingly. The QItemDelegate test
case used a click+control event incorrectly, such an event doesn't
change the clicked state and should not be eaten, and now it does
change the selection, so fix the test.

Task-number: QTBUG-59888
Change-Id: Ia76126e31c28bc97d3e93e54965bdb1d0b8ac6a4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-06-07 20:23:17 +02:00
Edward Welbourne
ad554707dc Simplify QDate::weekNumber()
Eliminate two local variables and don't even compute the year if we
don't need it.

Change-Id: If968c619750cead317641885a0fb9b9974954782
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-07 18:43:17 +02:00
Topi Reinio
c1ab14496a Doc: CSS: Update selectors for target highlighting
Certain targets on the generated HTML still use the obsolete
<a name=""> method of creating an anchor. Add a rule for a
replacement <span> element, using the id attribute.

This ensures that the highlighting animations continue to work
after the use of obsolete HTML is dropped from QDoc.

Change-Id: I2b70470b08d0e0f70702ad2820f4e065f2c08ff5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-06-07 16:44:23 +01:00
Topi Reinio
fade72913f Doc: Fix QRgbaF documentation
Template parameters were missing from the \fn statements.

Task-number: QTBUG-93995
Change-Id: I742f49c6f9686d3ed3a9d330dda32506d76ba287
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-06-07 15:44:23 +00:00
Topi Reinio
e33ea267f7 Doc: QtCore: Fix more documentation warnings
* Omit 'Bluetooth' enum value in QPermission::PermisionType (sic)
    as that seems to be unimplemented.

  * Comment out \sa links to internal/undocumented functions.

  * Fix incomplete template parameters in \fn commands for
    QProperty methods.

Task-number: QTBUG-93995
Change-Id: Ic8e63fca22c9c72325c76f90f537b221f56ebace
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-06-07 17:44:23 +02:00
Fabian Kosmale
1924f78df6 QProperty: Fix source_location feature testing
The presence of the source_location header does not guarantee the
availablility of std::source_location. For instance, if using clang 11
with a modern libstdc++, the source_location header is available, but
std::source_location is not available as it would  require
__builtin_source_location, which clang does not implement.

Consequently, we need to explicitly check the feature test macro
instead, and only use std::(experimental::)source_location when it is
defined.

Task-number: QTBUG-94194
Pick-to: 6.1
Change-Id: If6fda9a1b98244b1f2944fff6fe1991def30fc0f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-06-07 17:14:14 +02:00
Edward Welbourne
1a49d7d1e0 Report unused enum members after CLDR data scan
We should at least know when members of QLocale's enums aren't adding
any value, and it may make sense to deprecate the unused ones.

Change-Id: Icf202f81d2a35904c13ccdc202d41985bcb3f2e6
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2021-06-07 17:14:14 +02:00
Edward Welbourne
cce3445e70 Always include standard name in QLocale::uiLanguages()
Previously, for locales other than the system locale, no entry was
added to the list for the actual locale whose variants - with and
without likely sub-tags - were being appended. In most cases the
standard name will in fact coincide with the variant without likely
sub-tags, so this was unlikely to cause a problem, but it should be
present regardless.

At the same time, turn tst_QLocale::uiLanguages() into a data-driven
test and add another row to its table.

Change-Id: I5cb2d805d78fc3415d82b169caa6154b0f284708
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-07 17:14:14 +02:00
Edward Welbourne
b2871765ce Fix augmentation of UI language list
Previously, the augmentation wasn't being applied to the system
locale, due to a mistaken test claiming the locale's name didn't
resemble the string from which it was constructed. The test dates from
before various fixes to likely sub-tag processing that should make it
redundant now. This makes QLocalePrivate::rawName() also redundant
(and its conversion of QLatin1String to QByteArray relied on '\0'
termination which wasn't actually present in the various codes).

Expanded the test of systemLocale() to also test uiLanguages() turns a
single entry into the list we expect; and add two new test-cases.
(The test uses a mock system locale class, making this independent of
the platform backend.)

Fixes: QTBUG-92234
Pick-to: 6.1 5.15
Change-Id: I0cdf6eae152a42dc377f4ea3e62c282ff4be1764
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-06-07 17:14:14 +02:00
Volker Hilsheimer
6829719575 macOS: allow Qt::AA_DontShowShortcutsInContextMenus overrides
Following the discussion in QTBUG-69452, the resulting change in
cc33dd0797, and the documentation of
QAction::shortcutVisibleInContextMenu, the intention is that the
attribute allows the overriding of the platform default.

However, QAction did ask both the attribute and the platform
integration, making the override impossible. Instead, ask only
the attribute, but default the value of the attribute to what the
platform integration provides.

[ChangeLog][QtGui][QAction] The shortcutVisibleInContextMenu property
defaults to the value of the Qt::AA_DontShowShortcutsInContextMenus
attribute, which in turn defaults to the platform integration. To
override the default, set the application attribute after
instantiating QApplication, or override the default for each
QAction instance.

Task-number: QTBUG-73990
Pick-to: 5.15 6.1
Change-Id: Iaba330913555d93d05efe1b3965a6aea39db5554
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-06-07 17:14:14 +02:00
Joerg Bornemann
33aa461ec9 Remove legacy code path from qt_add_resource
All repos use the updated version of qt_add_resource, and we can remove
the legacy code path.

Change-Id: I15ba64a08c3fad9712a5cf05715594b1ee755bfc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-07 14:17:46 +02:00
Joerg Bornemann
d23613acf7 Prevent overly deep build dir hierarchy on Windows
On Windows, building Qt with Ninja Multi-Config failed in a reasonably
named build dir. The reason for that is our deep build dir hierarchy,
created with add_subdirectory, and long target names like
QNetworkListManagerNetworkInformationBackend within that hierarchy.

Rename said target to QNLMNIBackend, and set AUTOGEN_BUILD_DIR to a
short string that does not repeat the target name.

Pick-to: 6.1
Fixes: QTBUG-94211
Change-Id: Iea6fee012fa46d9bfb01142b60e6cb5273893c50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-06-07 14:17:46 +02:00
Fabian Kosmale
f6f7d22c6c QMetaType: Avoid instantiating QMetaType in Q_DECLARE_METATYPE
Having a call to QMetaType::fromType in struct QMetaTypeId causes issues
if Q_DECLARE_TYPEINFO is used later, as it will already cause an
instantiation of QTypeInfo. Instead, use QtPrivate::typenameHelper to
obtain the name. We cannot use QMetaTypeForType::getName, as that would
cause similarissues with QMetaTypeId2. However, QMetaTypeId2 is only
used for builtin metatypes, which do not use Q_DECLARE_METATYPE. And
even if a user would use Q_DECLARE_METATYPE with them, the worst that
happens is a superfluous type normalization.

Fixes: QTBUG-94124
Change-Id: Ie4a993411214fd009a604de44306131c647095eb
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-07 14:17:46 +02:00
Friedemann Kleint
cafdb8d3ee Expose the native interfaces of QScreen/QWindow
Add the macros.

Task-number: QTBUG-84220
Change-Id: Ica23b9e4d5c1ca072acb5356e6f2be28d5199fa6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-06-07 12:17:46 +00:00
Assam Boudjelthia
19a154f57b Use new permission api for http example
Change-Id: I265ec42205a193e9862eef26e73805bbf4188640
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-06-07 14:59:14 +03:00
Zhang Hao
8ee2186830 Clarify the QLineEdit document of editingFinished signal
QLineEdit gets focus and don't type any character when QLineEdit
lost focus, document say QLineEdit will issue editingFinished signal.
In fact,QLineEdit doesn't issue editingFinished signal.
Fix this by clarify the document.

Fixes: QTBUG-94057
Pick-to: 6.1
Change-Id: I88eed2ec7a28823598dc46f1df26fd305eb99c1f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-06-07 11:51:45 +00:00
Fabian Kosmale
f6fb118c94 QProperty: Do not involve semi-destroyed QObjects in bindings
Once we're in ~QObject, only methods of QObject are still valid.
Notably, no setter of any derived class is still valid. Thus, to be safe
we must no longer react to binding changes of those properties. To
ensure that this happens for QObjectCompatProperty properties, we
explicitly clear the binding storage.
Fixes a particles3d example crash.

Change-Id: I10d2bfa5e96621ce039d751cffaf3ac41893623e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-06-07 13:14:00 +02:00
Volker Hilsheimer
0ebe5c9ef6 QAbstractItemView: Don't change selection if editor ate release event
If a QItemDelegate implementation eats a release event (which they don't
do by default), then don't change the selection.

Task-number: QTBUG-59888
Change-Id: Ia08637627ce1da34ff9bdac63dfc72e5f53befac
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-06-07 09:45:16 +02:00
Ulf Hermann
ab52b176f4 Avoid unnecessary work when linking observers
We already do most of the work of setFirstObserver() in the method body
before.

Change-Id: Ia31f19ca656675dddb692609d8875c5d48e967f1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-05 09:22:34 +02:00