Commit Graph

51147 Commits

Author SHA1 Message Date
David Faure
b4aac2af19 QAbstractItemModelTester: fix false positive when model has zero columns
Regression introduced by me in commit 72e0d699ce

Fixes: QTBUG-92220
Change-Id: Ic7dd4eda0a1993f9763933882baf928bfc83b08b
Pick-to: 6.1 6.0 5.15
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-30 10:36:06 +02:00
Piotr Mikolajczyk
c80f262258 Android: Add select and copy capability to read-only text widgets
In case of a read-only text editing widget it was imposibble to copy text
from it. In QtWidgets you could not even see the selection handless.
Text selection in QtWidgets module was filtered depending on readOnly
property of the widget. Additionally, in InputMethod the read-only state
was translated into disabled.

Patch also makes the edit menu to be aware of the read-only status of
the control - the menu items are different for rw and ro controls.

Task-number: QTBUG-91417
Change-Id: Ic7b27f78678eeaa87a38607af787f254db1383b8
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-30 10:35:59 +02:00
Alexey Edelev
9275edbc31 Remove the redundant code related to the QT_NAMESPACE variable
Change-Id: Ib82b199fc7761c8b84f915c2808c7f57bf23927c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-30 10:31:34 +02:00
Fabian Kosmale
b786c86b91 QList: replace typedef with using
Change-Id: Ie3fa605cf05d65ca422df738dcce1fa49d6371c7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-30 10:01:50 +02:00
Volker Hilsheimer
ccf1a1a953 Replace QTextDocumentResourceProvider with a std::function
376e3bd8ec added the new class for Qt 6.1,
but during header review we concluded that using a class introduces
complexity wrt instance ownership and API design that can be avoided by
using a std::function instead.

The functionality is tied to QTextDocument, so the type definition and
the default provider API is added there.

Since std::function is not trivially copyable, the atomicity of the
previous implementation is not maintained, and concurrent modifications
of and access to the global default provider from multiple threads is
not allowed. The relevant use case can be supported by implementing a
resource provider that is thread safe.

Task-number: QTBUG-90211
Fixes: QTBUG-92208
Pick-to: 6.1
Change-Id: I39215c5e51c7bd27f1dd29e1d9d908aecf754fb7
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-03-30 08:11:27 +02:00
Andy Shaw
b050d4867f iOS: Protect against a possible crash after the window is deleted
If we are in a case where the original window is deleted before a new
one is shown then we need to make sure that we are not still expecting
that the original one has the focus. So we protect against the crash
by only outputting the address of the object that previously had
focus.

A follow-up patch will be done for inclusion from 6.2 that will fix
the root cause of the pointer being invalid when the only window is
deleted before a new one is shown.

Fixes: QTBUG-92173
Pick-to: 6.1 6.0 5.15
Change-Id: Ifdb3fd6b6cb8fb8e8b79d2c325a30c27b298d8a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-29 20:47:02 +01:00
Qt CI Bot
ea0ee870c9 Merge integration refs/builds/qtci/dev/1617036658 2021-03-29 19:03:00 +00:00
Qt CI Bot
3e6b7b3bf6 Merge integration refs/builds/qtci/dev/1617030826 2021-03-29 17:36:45 +00:00
Alexey Edelev
361daa2990 Fix plugin SKIP_INSTALL option
If SKIP_INSTALL option is specified for the qt_internal_add_plugin
function the install_directory variable become empty and finalizer unable
to call qt_finalize_plugin, because of lack of the second argument. It
makes sense to use the INSTALL_PATH single argument instead.

Change-Id: I2d4b40c8cf812a834c0e045569b45a649d339508
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-29 18:49:40 +02:00
Andreas Buhr
b56fef2da2 Remove outdated comment
In qproperty_p.h and qpropertyprivate.h there were comments
stating this would be used only in certain other headers.
Now qproperty_p.h contains functionality to implement bindable
properties, so it is used pretty much everywhere in qt.
qpropertyprivate.h is only included in qproperty.h.
This patch removes the outdated comments.

Change-Id: Ie7328691215f875e33e58a13160ce88bf41ca228
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2021-03-29 16:31:04 +02:00
Friedemann Kleint
e49e5d87be QFontDialog: Fix crash when passing QFont constructed from empty string/stringlist
The standarddialogs example showed a crash when opening the font dialog
due to the empty list.

Amends d8602ce58b.

Pick-to: 6.1
Change-Id: I93191485c72712d9b2d3ea0ae104f5edb9621f0c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-29 14:19:12 +00:00
Andreas Buhr
dfe86d0150 Fix some warnings
Change-Id: I546300b4e630a2234c83c03ece65a08f4c8652d2
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-03-29 16:06:25 +02:00
Volker Hilsheimer
5925daf969 Silence a bunch of gcc warnings for the moc test
We deliberately expose moc to warning-worthy C++, but we don't want the
compiler warnings coming from those.

Change-Id: I09c36d7c8bfbb88f7bde61fa7bcc52a5adde81da
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-29 15:59:48 +02:00
Volker Hilsheimer
c8f6f8a222 Rename QUrlResourceProvider to QTextDocumentResourceProvider
While the class name is now a bit more than a mouthful, it's purpose
is very narrowly tied to QTextDocument, so don't use a very generic
name for it. That resources are provided based on a URL is to some
degree an implementation detail, and URLs are resource locators so
we don't need that in the class name.

Address code review comment for 6.1. Add documentation and links to
existing APIs with a similar purpose.

Task-number: QTBUG-90211
Task-number: QTBUG-92208
Pick-to: 6.1
Change-Id: I4f09057cc2f53a5595513c1c9422e6ccaad6ca13
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-03-29 15:59:40 +02:00
Alex Trotsenko
db1c238a66 QProcess/Win: do not use extended API for polling
We avoid entering an alertable wait state there, so calling
WaitForSingleObject() instead of the ...Ex() analog would be
appropriate.

Change-Id: I7cd23805519f18b3174f66537dcf4c0da5061ca0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-29 15:54:14 +02:00
Alex Trotsenko
d8c6052815 Repair tst_qwineventnotifier
- add missing include
- fix platform detection in CMakeLists.txt

Change-Id: If7d04765eb40310d2841e792e8f80e083e067ad2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-29 15:54:05 +02:00
Samuel Gaist
e65558c230 Fix Editable Tree Model example model rowCount and model instance leak
The rowCount method has been fixed to correctly pass the "Common error
test #3: the second column should NOT have the same children".

It also fixes the model being leaked.

Fixes: QTBUG-92178
Pick-to: 5.15
Change-Id: If92973e6f83ea9a2715bd335269f6e50d80f52c6
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-03-29 12:09:41 +01:00
Volker Hilsheimer
69dcdbc8da Make getter const, add const overloads
The supportedApiVersions member is new in Qt 6.1, make it const.

We can't change supportedLayers and supportedExtensions, but we can
add const overloads that call the non-const version for now. This
way, those APIs can also be called on const QVulkanInstance
instances or references.

Addresses header review comment.

Pick-to: 6.1
Change-Id: Ie99d74f62cad72990b42566e56234b9c686e86de
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-03-29 11:58:52 +01:00
Volker Hilsheimer
76b3d024e4 Use official names for Android versions
Google ditched the dessert names as of Android "Q". "Q" and "R" were
development names, the released versions are called  Android 10 and
Android 11, respectively.

Pick-to: 6.1
Task-number: QTBUG-90211
Change-Id: I36225067cc802ebd3ebd1289d509759ae1b2d83d
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-03-29 12:58:39 +02:00
Laszlo Agocs
9e662a0baf Skip a tst_QRhi test case with the Android emulator
Pick-to: 6.1
Task-number: QTBUG-92211
Change-Id: I63ff17b226d502189bc769b0b28640b849b8d39a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-29 09:57:48 +02:00
Craig Scott
aa4a1006cb Refactor qt_internal_add_plugin() and qt6_add_plugin()
Remove code duplication by calling qt6_add_plugin() from
qt_internal_add_plugin().

Separate out the public and internal arguments for the
variables defined in QtBuild.cmake for these functions.
Provide them via commands instead for greater robustness.
This separation allows other Qt repos to access the appropriate
set of keywords where they define commands that forward
on to *_add_plugin() in their implementations. Retain
the old variables for now to simplify the integration
steps for updating other repos. The old variables can
be removed once there are no more references left to
them in any repo.

Task-number: QTBUG-88763
Pick-to: 6.1
Change-Id: I0105523afd95995923bd20fc963d245bbb15d34d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-29 18:10:22 +11:00
Qt CI Bot
2801c19887 Merge integration refs/builds/qtci/dev/1616767130 2021-03-26 17:16:33 +00:00
Qt CI Bot
ebf9b3d096 Merge integration refs/builds/qtci/dev/1616760368 2021-03-26 15:17:07 +00:00
Qt CI Bot
de3c842d89 Merge integration refs/builds/qtci/dev/1616756003 2021-03-26 14:15:18 +00:00
Giuseppe D'Angelo
8b9c8d417b tst_qobject: fix the detection for GCC
Q_CC_GNU is defined on compilers that masquerade as GCC (Clang, ICC),
so using it to work around GCC-specific bugs is wrong. Introduce a
local define for _only_ GCC and use it in place of Q_CC_GNU.

Drive by: version-fence a test we now know it's been fixed upstream,
and correct the link to the corresponding bug report.

Pick-to: 5.15 6.0 6.1
Change-Id: I9059d6e6bf86157aca71590ac22afb1a1c114313
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-26 14:57:45 +01:00
Qt CI Bot
cbb0ef5a86 Merge integration refs/builds/qtci/dev/1616748388 2021-03-26 13:45:09 +00:00
Qt CI Bot
16eee0d5cc Merge integration refs/builds/qtci/dev/1616752022 2021-03-26 13:12:46 +00:00
Edward Welbourne
1bdc74ad7b Document a peculiarity that might plausibly confuse readers
It at first sight seems perverse to null-check a variable we've
repeatedly dereferenced before, without visibly setting it since;
however, its address was stored where an event handler could get at
it, to clear it if deleting the object it points to. The check against
null really is needed, but the reason is non-obvious; so document the
reason and save the next developers to come this way some confusion.

In the process, relocate a related comment that belonged one line
earlier.

Change-Id: Id67b86edc5a9a76a827d66b5c0abcd017d98a2bb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-26 13:04:48 +01:00
Joerg Bornemann
98e8180e56 Fix error when re-configuring an already installed Qt repository
When building and installing a Qt repo that provides plugins for a Qt
module within a different repository (for example, qtimageformats
providing imageformat plugins for QtGui), re-configuring that repository
would result in configuration errors like

"add_library cannot create ALIAS target "Qt6::QTgaPlugin" because
another target with the same name already exists."

This happened, because the find_package(Qt6 COMPONENTS Gui) calls pulled
in the Qt6*PluginConfig.cmake files that create imported targets for the
plugins we want to build.

To fix this, when building Qt, we now load only plugins that are
provided by repositories the currently building repository depends on.

We read the repo dependencies from dependencies.yaml when the
Qt6BuildInternals package is loaded, but only in static builds and only
if we're currently building a Qt repository.

To find out whether we're building a Qt repository, we check whether
QT_REPO_MODULE_VERSION is defined. We cannot check QT_BUILDING_QT,
because that variable is not available for the first find_package calls
in the repository's top-level project file.

In each Qt6*PluginConfig.cmake file, we bail out if the plugin's
repository is not one of the ones in QT_REPO_DEPENDENCIES.

Fixes: QTBUG-86670
Fixes: QTBUG-91887
Change-Id: I8f6c8398032227032742f1ca019e983ff2bcd745
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-26 11:52:00 +01:00
Qt CI Bot
27ebeeb50e Merge integration refs/builds/qtci/dev/1616744759 2021-03-26 10:09:36 +00:00
Giuseppe D'Angelo
0b4ccbf81e QPainterPath: fix handling of fill rules
fillRule() contained a major blunder: instead of checking if the
d-pointer was allocated, and return a default value if it wasn't,
it checked whether the path contained any points. This means that

  QPainterPath p;
  p.setFillRule(x);
  Q_ASSERT(p.fillRule() == x);

was failing.

As a drive-by to test this change, fix another mistake in clear():
clear is documented to clear the elements in a path, but instead
it also changed the fill rule.

This commit partially reverses 697910e5fb.

Change-Id: Ieb8145694b672439c3380d9ccb87d1206a2dd115
Pick-to: 5.12 5.15 6.0 6.1
Done-with: Milian Wolff
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-26 10:45:46 +01:00
Assam Boudjelthia
b9f27335e7 Rename QJniEnvironment exceptionCheckAndClear to checkAndClearExceptions
Address feedback from header view.

Task-number: QTBUG-90211
Pick-to: 6.1
Change-Id: Iad2b609598b16f66fd6ab09484fe6e6899981263
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-26 09:29:18 +00:00
Fabian Kosmale
e05d666d42 QMetaType::id(): Fix ABI breakage
We cannot replace a non-inline method with an inline one without
breaking the ABI. Instead, we now create a version with a dummy int
parameter (to avoid ODR violations), and hide the non-inline version
behind an ifdef, so that it is only visible in qmetatype.cpp.

Pick-to: 6.1
Change-Id: Ib4e82e44071bdf5c37227409a56d377ff2e07ee0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-03-26 09:26:51 +01:00
Bartlomiej Moskal
547228bf86 Android: fix wrong position of cursor hander in split screen
Use activity window position to fix position of cursor hander. In case
without splti sceen, position of activity window is equal (0, 0), so it
does not have any effect.

Fixes: QTBUG-91362
Pick-to: 5.15
Change-Id: Icae9f19308112a78bdddf168abe81ffe7b6e4fae
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-26 08:05:13 +00:00
Bartlomiej Moskal
e402e1103b Android: fix for isSoftwareKeyboard method
isSoftwareKeyboard() method will rely on visibility flag from
activityDelegate. In such case it also need to consider that keyboard is
during the hiding.

Fix the regression related with commit:
e6ca200a3a

Before this change Software Keyboard is not showing after changing the
focus. It is happening when Keyboard is already visible and focus is
changed to widget that also need the keyboard. In such case keyboard is
hiding (and NOT showing again).

Pick-to: 5.15
Fixes: QTBUG-92051
Change-Id: I6a5d07b25442429fda6e715d09ea104432c5ef50
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-26 09:05:04 +01:00
Andreas Buhr
30016562c2 Add documentation how to formulate a property binding
To correctly formulate a property binding, some rules must be
followed. So far, these rules are not documented. This patch
adds such documentation.

Task-number: QTBUG-90511
Change-Id: Ibb509ea9098212c95f03433feb1f1aac751c4b2e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-26 08:42:25 +01:00
Andreas Buhr
59b0212215 Beautify bindable properties documentation
Some minor formatting changes

Change-Id: I336a442d01cb048397b2a65977cfb96bb7179752
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-26 08:42:07 +01:00
Fan PengCheng
35dd643b07 Fix coding style
Curly brace is supposed to go on the same line as the if.

Change-Id: I92fbd984e9ccdb06acdfe89e45c34b26a08df0cb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-26 06:24:04 +00:00
JiDe Zhang
3e65d0408b Use QOpenGLContext::openGLModuleType() instead of QT_CONFIG(opengles2)
In the QOpenGLContext::openGLModuleType(), it will correctly judge
QT_CONFIG(opengles2), there is no need to use QT_CONFIG(opengles2) alone
in QGLXContext.

Change-Id: I012703b6a81b88fa4b8aa53cc1077c8b42d34ed5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-03-26 11:20:36 +08:00
Qt CI Bot
9c28080f49 Merge integration refs/builds/qtci/dev/1616701589 2021-03-25 22:14:31 +00:00
Qt CI Bot
87308fb95d Merge integration refs/builds/qtci/dev/1616690051 2021-03-25 20:23:15 +00:00
Andreas Buhr
dff67218bc Add documentation for internal Q_OBJECT_COMPUTED_PROPERTY
The internal class QObjectComputedProperty and the associated
macro Q_OBJECT_COMPUTED_PROPERTY did not have any documentation
so far. This patch adds some initial documentation.

Task-number: QTBUG-90511
Change-Id: Ibd31b9c482962b1618daf04fef4256aa52d589e3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-25 20:45:10 +01:00
Qt CI Bot
4e5f203df6 Merge integration refs/builds/qtci/dev/1616686367 2021-03-25 19:44:35 +00:00
Qt CI Bot
0c6b0fdcc3 Merge integration refs/builds/qtci/dev/1616682375 2021-03-25 18:47:45 +00:00
Qt CI Bot
ee200cc258 Merge integration refs/builds/qtci/dev/1616678767 2021-03-25 17:47:14 +00:00
Qt CI Bot
2220ddddf0 Merge integration refs/builds/qtci/dev/1616675134 2021-03-25 16:40:07 +00:00
Fabian Kosmale
cb43aaca11 Introduce QMetaObject::metaType
This function returns the metatype corresponding to the metaobject, or
an invalid metatype for namespaces.

This works as follows: First we increment the metaobject revision for
new metaobjects. Metaobjects with older revisions are handled by doing a
lookup by name. That fallback is also used for dynamic metaobjects (from
QtDBUS and those created by QMetaObjectBuilder).
For new metaobjects, we store the metatype in its metatype array, behind
the property metatypes. This avoids any changes to the property and
method metatype extraction logic: For properties, the metatype access
does not change, as the new metatype is after their metatypes. For
method metatypes, we already have an indirection layer (using offsets),
so by adjusting those offsets by one, the same logic keeps working.

To distinguish between namespaces and dynamic metaobjects, namespaces
store the metatypeinterface pointer for void in the metatype array,
whereas dynamic metaobjects store a nullptr.

One nice additional benefit is that this simplifies the generator logic
in moc, as the metatype array is now never empty.

Task-number: QTBUG-92077
Change-Id: Id3f920f28553f12032a71a1a87dad29e5374dbe7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-25 17:33:07 +01:00
Joerg Bornemann
9f444ce533 Add a way to install versioned hard-links for tools
Add the option argument INSTALL_VERSIONED_LINK to qt_internal_add_tool
and qt_internal_add_app. For tools/apps with this argument we create an
install rule that creates a versioned hard link. For example, for
bin/qmake we create bin/qmake6.

Note that this only applies to prefix builds.

Apply this argument to qmake.
The qt_internal_add_app change is necessary for qtdiag and in qttools.

Task-number: QTBUG-89170
Change-Id: Id32d6055544c475166f4d854aaeb6292fbb5fbb5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c19d957f45fa27f61b5ecc566f8dbc19f12a44c3)
2021-03-25 16:31:39 +01:00
Qt CI Bot
9145650302 Merge integration refs/builds/qtci/dev/1616671507 2021-03-25 15:25:08 +00:00
Andreas Buhr
96796f0619 Add example to QObjectBindableProperty change handler docs
QObjectBindableProperty has a callback, which is called whenever
the value changes. This patch adds an example showing this.

Task-number: QTBUG-90511
Change-Id: I56c0bce15af8121159630b5c0922c287c15b7618
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-25 14:52:37 +01:00