Commit Graph

11774 Commits

Author SHA1 Message Date
Dongmei Wang
e253a30238 QFileSystemModel fails to locate a host from root's visible children
In QFileSystemModel, in some cases the hostname in a UNC path is
converted to lower case and stored in the root node's visibleChildren.
When QFileSystemModel sets the UNC path as the root path, it tries to
get the row number for the host, but it didn't convert the hostname to
lower case before getting the row number, which resulted in the host
not found in the root node's visible children. As a result, it returns
-1, an invalid row number. Change the behavior to find the node for the
host using the host name case-insensitive and then get the row number.

Fixes: QTBUG-71701
Pick-to: 5.15 6.0 6.1
Change-Id: Ib95c7b6d2bc22fd82f2789b7004b6fc82dfcb13b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-05-20 15:02:38 +00:00
Mårten Nordheim
a5dc381b4c QByteArrayView: add compare
There was previously no way to compare QByteArrayView to with another
QByteArrayView case-insensitively without allocating memory.

[ChangeLog][QtCore][QByteArrayView] Added compare(), enabling case
sensitive and insensitive comparison with other QByteArrayViews.

Change-Id: I7582cc414563ddbde26da35a568421edcc649f93
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-20 17:02:38 +02:00
Alexandru Croitor
6fcc272ac9 CMake: Introduce finalizer mode handling of static plugins
Allow linking all plugin initializer object libraries directly
into the final target (executable or shared library).

The finalizer mode is triggered when the project adds a call
to qt_import_plugins, as well when the project has an explicit
call to qt_finalize_executable or when it is defer called by
CMake 3.19+.

Otherwise the old non-finalizer mode is used, where each plugin
initializer object library is propagated via the usage
requirements of its associated module.

A user can explicitly opt in or out of the new mode by calling
qt_enable_import_plugins_finalizer_mode(target TRUE/FALSE)

The implementation, at configure time, recursively collects all
dependencies of the target to extract a list of used Qt modules.

From each module we extract its list of associated plugins and
their genex conditions. These genexes are used to conditionally
link the plugins and the initializers.

Renamed QT_PLUGINS property to _qt_plugins, so we can safely query the
property even on INTERFACE libraries with lower CMake versions.
QT_PLUGINS is kept for backwards compatibility with projects already
using it, but should be removed in Qt 7.

The upside of the finalizer mode is that it avoids creating link
cycles (e.g. Gui -> SvgPlugin -> Gui case) which causes CMake to
duplicate the library on the link line, slowing down link time as well
as possibly breaking link order dependencies.

The downside is that finalizer mode can't cope with generator
expressions at the moment. So if a Qt module target is wrapped in a
generator expression, it's plugins will not be detected and thus
linked.

Task-number: QTBUG-80863
Task-number: QTBUG-92933
Change-Id: Ic40c8ae5807a154ed18fcac18b25f00864c8f143
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-20 00:55:46 +02:00
Karsten Heimrich
06689a2d7a Fix QUrl::fromLocalFile with long path prefix
After commit 3966b571 the function was kinda broken already, though
this got unnoticed since it was not covered by an the auto-test.
This commit adds another test case with Windows native separators
and removes the use of QDir::fromNativeSeparators. Instead use the
original code from QDir::fromNativeSeparators to replace the backslashes.

Pick-to: 5.15 6.0 6.1
Change-Id: I190560d0e75cb8c177d63b142aa4be5b01498da2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-19 21:38:38 +02:00
Laszlo Agocs
8827cd657d rhi: gl: Add support for importing an existing renderbuffer object
Normally we only allow creating wrappers for texture objects. These
can then be used with a QRhiTextureRenderTarget to allow rendering into
an externally created texture.

With OpenGL (ES), there are additional, special cases, especially on
embedded. Consider EGLImages for example. An EGLImageKHR can be bound to
a renderbuffer object (glEGLImageTargetRenderbufferStorageOES), which
can then be associated with a framebuffer object to allow rendering into
the external buffer represented by the EGLImage. To implement the same
via QRhi one needs a way to create a wrapping QRhiRenderBuffer for the
native OpenGL renderbuffer object.

Here we add a createFrom() to QRhiRenderBuffer, while providing a dummy,
default implementation. The only real implementation is in the OpenGL
backend, which simply takes a renderbuffer id, without taking ownership.

Task-number: QTBUG-92116
Change-Id: I4e68e665fb35a7d7803b7780db901c8bed5740e2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-05-19 17:35:35 +02:00
Thiago Macieira
80cf3053f4 tst_QFile: confirm behavior is the same on pipes and socketpairs
Whether we're using stdio or not.

Task-number: QTBUG-92905
Change-Id: Ia8e48103a54446509e3bfffd167682828c6bd190
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-18 21:15:49 -07:00
Tor Arne Vestbø
d0b0db0d6d tst_QSharedPointer: Fix Clang warnings about self assignment
Change-Id: I32feb86eee5f15e6ec0f0e6fb6811648b172fe7e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-19 02:48:47 +02:00
Joerg Bornemann
92185d417d Fix BASE argument of qt_add_resources
The BASE argument of qt_add_resources now denotes the root point of the
alias of the file.  Before, BASE was merely prepended to every file that
got passed to qt_add_resources.

Old behavior:
    qt_add_resources(app "images"
        PREFIX "/"
        BASE "../shared"
        FILES "images/button.png")

Alias is "../shared/images/button.png", and pro2cmake generated
QT_RESOURCE_ALIAS assignments to fix this.

New behavior:
    qt_add_resources(app "images"
        PREFIX "/"
        BASE "../shared"
        FILES "../shared/images/button.png")

The alias is "images/button.png".  No extra QT_RESOURCE_ALIAS assignment
is needed.

The new behavior is in effect for user projects and for Qt repositories
that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE.  Qt repositories will be
ported one by one to this new behavior.  Then the old code path can be
removed.

Pick-to: 6.1
Task-number: QTBUG-86726
Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-18 16:02:52 +02:00
Allan Sandfeld Jensen
86bf3a4ddb Blacklist tst_QWidget::multipleToplevelFocusCheck() on SLES 15
Pick-to: 6.1 5.15
Task-number: QTBUG-64446
Change-Id: Ic1f7a1e7b89a9802e4d3103a6755d7df85b1fd81
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-05-18 11:56:06 +02:00
Andreas Buhr
8278879c19 Fix QItemSelectionModel::selectionChanged emission
QItemSelectionModel has the property selectedIndexes with
the notification signal selectionChanged. When a row is deleted
or inserted above the current selection, the row number of the
current selection changes and thus the return value of
selectedIndexes changes. This should trigger its notification
signal.
This signal was not emitted. This patch fixes this and
adds a unit test to verify this.

[ChangeLog][Important Behavior Changes][QtCore]
QItemSelectionModel now emits the selectionChanged signal
if only the indexes of the selected items change.

Fixes: QTBUG-93305
Change-Id: Ia5fb5ca32d658c9c0e1d7093c57cc08a966b9402
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2021-05-18 08:49:56 +02:00
Giuseppe D'Angelo
9a94c4a415 Long live qToUnderlying
"Cherry-pick" of C++2b's std::to_underlying.

[ChangeLog][QtCore][QtGlobal] The qToUnderlying function has been
added, to convert an value of enumeration type to its underlying
value.

Change-Id: Ia46bd8e4496e55174171ac2f0799eacbcca02cf9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-18 02:09:11 +02:00
Giuseppe D'Angelo
8b8ff64be2 PRIx macros: add some actual testing
Not just a compile-time one (that the macros compile and don't
raise warnings).

Change-Id: I5642bf242a6c26a33730708f3c1710237fc107a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-18 02:09:06 +02:00
Giuseppe D'Angelo
5ea50054a1 QArrayData: store the right flag type, not an int
There's no reason to be storing `int` in the array data header and
then using it as a QFlags. Just store the QFlags.

Change-Id: I78f489550d74d15a560dacf338110d80a7ddfdd2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-17 00:11:12 +02:00
Giuseppe D'Angelo
c4947c1c4c QFlags: add test(Any)Flag(s)
QFlags was lacking a named function for testing whether a QFlags object
contains _any_ of the bits set by a given enumerator/other QFlags.

Drive-by, add testFlags taking a QFlags, not just an object of the
enumeration; and simplify the implementation of testFlags to more
closely follow what its documentation says it does.

[ChangeLog][QtCore][QFlags] The testFlags, testAnyFlag and
testAnyFlags functions have been added.

Change-Id: Ie8688c8b0dd393d34d32bc7786cdcee3eba24d1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-15 17:34:01 +02:00
Assam Boudjelthia
23780891a5 Add tests for QAndroidApplication's sdkVersion and activity
While at it, move tst_android under corelib/platform/android.

Change-Id: Icf91cd75cb5e04d03fe6a81d52fba52a485ca41f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-05-13 01:41:36 +03:00
Fabian Kosmale
5b681bea90 QPropertyBinding: Do not reevaluate if not installed on property
Since we changed binding evaluation to be always eager, we notify and
evaluate all bindings as soon as any dependency changes. This includes
bindings which have been initially installed on a property, but which
were later removed.
With lazy evaluation, we would only notify those bindings and mark them
as dirty, which is unproblematic. With eager evalution, we attempt to
evaluate the binding, though. While that part is still fine, afterwards
we would attempt to write the new value into the property. However,
there is no property at that point, as the binding is not installed.
Instead of adding a check whether the propertydataptr is null, we skip
the reevaluation completely by removing the bindings observers - and
thus the cause for the binding function's reevaluation. As soon as the
binding is set, we reevaluate the function anyway, at which point we
also capture the observers again.

Task-number: QTBUG-89505
Change-Id: Ie1885ccd8be519fb96f6fde658275810b54f445a
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-05-12 14:49:46 +02:00
Allan Sandfeld Jensen
e381977b21 Blacklist tst_qnetworkreply::ioHttpRedirectMultipartPost on Linux
Already blacklisted on the other linux versions, but is failing on
SLES now in 5.15

Pick-to: 6.1 5.15
Change-Id: I267908adf94ede51e5520aa2cb806b394fb0438e
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-05-12 14:49:45 +02:00
Fabian Kosmale
524c187af3 QProperty: Cleanup QPropertyAlias leftovers
This removes traces of QPropertyAlias which is internal API which is
a) not really working even before this change (no compatibility with
   QBindableInterface due to QPropertyAlias not being derived from
   QUntypedPropertyData)
b) not used anywhere

For BIC reasons, we need to keep some methods still around until Qt 7,
though.

Change-Id: I5bb4735a4c88cba275dc2cc6e29a46ca09622059
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-05-11 22:22:08 +02:00
Ivan Solovev
bdaaf99228 QSFPM: make filterRegularExpression and filterCaseSensitivity bindable
This takes care of the last two QSFPM properties. They were postponed
because of the tricky relation between them and some bugs in handling
the changes.
The bug was fixed in bcbbbdb2d6 and
now the behavior is well-determined: updating filter regexp does
trigger case sensitivity change and vice versa. However updating
only regexp pattern (via QString overload or setFilterFixedString
or setFilterWildcard) does not change case sensitivity.

Task-number: QTBUG-85520
Change-Id: Idc41cf817de9e6263ed65a80fa40fc8415c8c856
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-11 21:05:09 +02:00
Ivan Solovev
9134113c4f QSortFilterProxyModel: port to new property system
filterRegularExpression and filterCaseSensitivity
will be handled in a separate commit

Task-number: QTBUG-85520
Change-Id: I848c5c6cbe8642efa156f4f5d33467976bbf0351
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
2021-05-11 21:05:09 +02:00
Luca Beldi
811a6c6b77 Fix QStandardItemModel signals on takeChild
takeItem and takeChild do not signal the change correctly to the
external world, this change fixes the problem

Fixes: QTBUG-89145
Pick-to: 6.1 5.15
Change-Id: Ib4844ace53007068a2cd62eba64df99e6e45fdc0
Reviewed-by: David Faure <david.faure@kdab.com>
2021-05-11 18:55:09 +01:00
Piotr Srebrny
867c0b8d8a Do not remove non-widget items when removeWidget() called with nullptr
child->widget() returns null if the layout item is not a widget.
Thus, calling removeWidget(nullptr) will remove all non-widget items
such as layouts or strechers.

Change-Id: I772c1158d0f7e8e2850b6e571b0405a2896f09b8
Pick-to: 6.0 6.1 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2021-05-11 16:57:17 +00:00
Alexandru Croitor
3a62f9e0c9 CMake: Resurrect test_import_plugins cmake build tests
Now that we run tests for static Qt builds in the CI, it makes sense
to restore the CMake build tests that check that static plugin
importing works correctly.

Resurrect the previously commented out test_import_plugins project and
port the mockplugins qmake projects to CMake.

mockplugins is a CMake project that uses the internal Qt CMake API to
build and install some Qt modules and plugins.

test_import_plugins depends on that test (via a CMake fixture) to
build public projects that use those plugins.

The installation of the mockplugins modules pollutes the Qt install
prefix, but in the CI that only happens on the test VM, which means
the release packages are not affected.

Locally on a developer machine the Qt install path will be polluted,
but it's not that much of a big deal. We could try and address that in
a future change by using the QT_ADDITIONAL_PACKAGES_PREFIX_PATH
functionality added for Conan to allow the installation of Qt packages
into a non-standard prefix.

Task-number: QTBUG-87580
Task-number: QTBUG-92933
Change-Id: I0841064a60a5ffba5118640d3197527a38ba6c30
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-11 14:35:30 +02:00
Alexandru Croitor
22a992cb12 CMake: Skip building CMake build tests in a prefix in-tree config
The Qt CMake packages are not installed yet, so the CMake build
projects can't find Qt and fail to configure.

Skip the CMake build tests in a prefix in-tree configuration and issue
a warning for informational purposes.

Change-Id: Ie5cb5b9f6f1d8ec258b70528680e31c711c20f85
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-11 14:35:30 +02:00
Chen Bin
aeef92c3c3 Check scrollbar visibility when computing QListView margins
When the listview setWordWrap is true and ScrollBarPolicy is
ScrollBarAsNeeded, if the text needs a newline display and the
vbar is not shown, the width of the item was subtracted from
the width of the scrollbar.

In most cases, the listview needs to reserve the size of the scrollbar.
But if the flow is TopToBottom and the vertical scrollbar is not
visible, the width of the vertical scrollbar cannot be reserved.

Fixes: QTBUG-92366
Pick-to: 5.15 6.0 6.1
Change-Id: I73cce691099a253d409019dbb3fe9a16e1830bb1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-11 20:35:30 +08:00
Karsten Heimrich
ec9e856563 Fix QSaveFile and QTemporaryFile issues with windows network shares
The commit amends commit 3966b571 to take UNC prefix into account as
well. Fixes the weird file name output as reported in QTBUG-74291 and
QTBUG-83365. Replace manual separator normalizing in qt_cleanPath(),
this is another spot where UNC prefix handling needs to be applied.

Also make QTemporaryFile operate on '/' as file separators to fix
creating both file types with native path separators on network shares.

Fixes: QTBUG-74291
Fixes: QTBUG-76228
Fixes: QTBUG-83365
Pick-to: 5.15 6.0 6.1
Change-Id: Iff8d26b994bf4194c074cd5c996cda3934297fa5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-11 13:22:44 +02:00
Tor Arne Vestbø
edceff30b4 Move QtX11Extras into QtGui as private API
from qt/qtx11extras 0e67fb41cfc4b4bfbaa7dc75f8ddebdf5a08e836.

The plan is to expose these as native interfaces, so this is a first
step.

Task-number: QTBUG-83251
Change-Id: Iecba8db9a4f616a08a3750ddaae08cc30ec66f89
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-05-10 21:19:46 +00:00
Allan Sandfeld Jensen
f94b0e1dd9 Allow background inheritance between non-body block elements
Most nested block elements are merged together, so while we shouldn't
do real inheritance we need to do it when block elements are combined.

Pick-to: 6.1
Fixes: QTBUG-91236
Change-Id: I9e37b15f705db92c79a620d0d772f25d0ee72b8d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-05-08 09:28:02 +02:00
Fabian Kosmale
300dec66ce QMetaMethod: Store method constness in metaobject system
[ChangeLog][QtCore][QMetaMethod] It is now possible to query the
constness of a method with QMetaMethod::isConst.

Change-Id: I8a94480b8074ef5b30555aeccd64937c4c6d97d4
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-05-07 21:50:58 +02:00
Samuli Piippo
57ede9217e tst_qlibrary: don't use absolute paths for symlinks
The libs and symlinks are in the same directory, no need
to have absolute paths.

Change-Id: I22dab933b1f3bdf244b0953c6bb7caaeedef5697
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-07 11:11:51 +03:00
Volker Hilsheimer
e3b2b12a91 QTabBar: take a style sheet's font into account when laying out tabs
If a tab has a font assigned to it through a style sheet, then take the
font size into account when calculating the contents rectangle.

Add a test, which hardcodes the windows style to avoid flaky behavior
when e.g. macOS lays tabs out in the center.

Fixes: QTBUG-92988
Pick-to: 6.1
Change-Id: Ifb0ac97db7647cc25367972737be8878e50f6040
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-05-06 20:06:44 +02:00
Friedemann Kleint
8886462872 QMdiArea: Fix top level window title when using DontMaximizeSubWindowOnActivation
When trying to find the original window title, check for another
maximized sub window and use its title. Protect the calls to
setWindowTitle to prevent the original title from being cleared.

Pick-to: 6.1 5.15
Fixes: QTBUG-92240
Change-Id: I55175382ab261b4cf8b5528304adaaec4fbe2c31
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-05-06 13:08:14 +02:00
Fabian Kosmale
f8c1d339ec tst_moc: Use qtpaths instead of qmake
We only need to the location of certain paths for the test. For that,
qtpaths is sufficient.

Change-Id: I5af0d56b548629edc48949150ed8fbd408b617a6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-05 23:43:45 +02:00
Allan Sandfeld Jensen
50b9a4b357 Remove Qt6 switches from QtGui
Removing now dead code

Change-Id: I021539da6517fdb8443f8ae9431fc172b7910cfc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-05-05 19:26:56 +02:00
Andy Shaw
72a5151403 Write out the HTML correctly for nested lists
When we are having nested lists then we need to ensure that the HTML is
outputted correctly so that the closing list and item tags are placed
in the right order.

[ChangeLog][QtGui][QTextDocument] The output of toHtml() now handles
nested lists correctly.

Fixes: QTBUG-88374
Pick-to: 6.1 5.15
Change-Id: I88afba0f897aeef78d4835a3124097fe6fd4d55e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-05 15:14:12 +00:00
Oliver Eftevaag
38f4e1f3e7 Unit test for checking text-decoration in html export
This unit test is related to the parent commit.
Html export used to omit the text-decoration for the default font,
this unit test ensures that this property is added to the exported
html.

Fixes: QTBUG-91171
Change-Id: Ib68bec27f9963cdcac5c553b2c07557717b1c22e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-05-05 16:28:54 +02:00
Allan Sandfeld Jensen
720defd2ca Export text-decoration
It used to be ignored because we couldn't disable it, but that works
fine now. So re-enable it.

Fixes: QTBUG-91171
Change-Id: I4cf966211bb200b73326e90fc7e4c4d3d4090511
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-05-05 16:28:54 +02:00
Edward Welbourne
358df462a0 Fix assertion on matchingLocales(Abhkazian, Any, Any)
CLDR v39 has no locales for Abkhazian, so the locale_index[] entry for
it actually indexes the last entry before the next language up the
enum. This has m_language_id less than Abkhazian.

Change-Id: If8b88f30476a981b3ee00ff8760a46ede0b7aab7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-05-05 16:28:53 +02:00
Assam Boudjelthia
45daea19c3 Fix set*Field JNI template calls
The calls were trying to pass a JNIEnv* from a QJniEnvironment using
conversion operator which was removed, and weren't detected since they
are templates and were missing tests. This fix that and add test cases
for setField() and setStaticField() calls.

Pick-to: 6.1
Change-Id: I6e1e6b7f557bbc664248ad364c48d63f58b70756
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-05 16:28:27 +03:00
Assam Boudjelthia
afd7460aff Add new app permissions API under QCoreApplication
The API allows users to request and check the status of various
permissions. A predefined enum class of the common permission types
on different platforms is used to allow requesting permission with
a common code. Platform specific permissions are defined only on their
relevant platform. For permissions that are not predefined, they can
be requested via a string variant of this API.

This adds the Android implementation only.

[ChangeLog][QtCore] Add new API for handling app permissions with an
initial implementation for Android.

Task-number: QTBUG-90498
Change-Id: I3bc98c6ab2dceeea3ee8edec20a332ed8f56ad4f
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-05 16:28:27 +03:00
Ivan Solovev
8161a9e5c0 QAbstractProxyModel: port to new property system
The biggest trick here is the getter (QAbstractProxyModel::sourceModel),
which is returning nullptr, while internally using a global
staticEmptyModel() instance.
This lead to inconsistency while binding to a proxy model without
source model. The bound object would point to staticEmptyModel()
instance, while sourceModel() getter returns nullptr.
To solve this issue a custom QBindableInterface is implemented.

Task-number: QTBUG-85520
Change-Id: I597df891c7e425d51b55f50ccbacabdfe935cbac
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-05-04 22:58:59 +02:00
Tor Arne Vestbø
0fb77f80b8 Blacklist and skip failing tests on macOS ARM
Task-number: QTQAINFRA-4431
Change-Id: I4ae47bb461634d524995077501b54322f6beccf3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-04 22:58:59 +02:00
Mårten Nordheim
48931167fb tst_moc: fix returning-reference-to-local warning
Although the code is never executed compilers still throw a warning
because it's compiled.

Amends 12b8283f89

Pick-to: 5.15 6.1
Change-Id: Ib790d4bcb33c4b9f2a55a784b852275b59debde9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-04 16:21:50 +02:00
Morten Johan Sørvig
07516c0811 Test at some Android DPIs in addition
Currently, we test at 1x, 2x, and mixed typical desktop
DPI values. Add android DPI values, with scale factors
in the 2.5 - 3.75 range.

This test currently uses 96 as the base DPI (and so
does the Android platform plugin), so we normalize
the values to use that base DPI.

Change-Id: I25b66f5e16d37c01758d5623b805e4141247a74a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-04 16:21:48 +02:00
Morten Johan Sørvig
5882131592 Remove setting of Qt 5 high-dpi attributes
This test is for Qt 6 now.

Change-Id: I839c2733d505cb4119b1fe3ad85d3c8d94a6c964
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-04 16:21:48 +02:00
Edward Welbourne
517745fc9d Ensure setDateTime clears status also when short
Previously, if multiplication overflowed when trying to set the date
and time of a formerly short-form QDateTime, its status didn't get set
to reflect the failed validity check. Added a test that now correctly
detects that it's produced an invalid date-time on overflow, where
previously it produced a wrong valid date-time.

Change-Id: Id46ca34d1e32e9b9b0630f3723cefd1c13b5761e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-04 15:21:48 +01:00
Mårten Nordheim
12b8283f89 Moc: parse trailing return type
Pick-to: 5.15 6.1
Fixes: QTBUG-71123
Change-Id: I1c3749f0892fddcc433c9afcb1d6d7c30c97c9d9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-04 01:39:48 +02:00
Thiago Macieira
f95d6bb09d tst_QProcess: increase wait time and remove ill-advised QCOMPARE
The QCOMPARE made dead code of a more verbose QVERIFY2 below

Change-Id: I26b8286f61534f88b649fffd166b67d8603280a7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-05-03 20:43:01 +00:00
Fabian Kosmale
98b4f4bc4d Q(Untyped)Bindable: Print warnings when operations fail
Instead of silently failing, we now print an explanatory warning to aid
with debugging.

Task-number: QTBUG-89512
Change-Id: I36dd2ce452af12d0523c19286919095e366bd390
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-05-03 20:32:42 +02:00
Ivan Solovev
d225c6afe7 QJniObject: add callStatic[Object]Method overloads for jmethodID
This patch extends the QJniObject::callStatic[Object]Method functions
with the overload which accepts a jmethodID parameter. This can be
convenient when the method id is already cached and you do not want
to query the method by its name and signature.

Task-number: QTBUG-92952
Change-Id: Ib0852a5a27da2a244ac63112784751ef9e32cfa5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-03 18:09:23 +02:00