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>
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>
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>
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>
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>
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>
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>
"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>
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>
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>
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>
While at it, move tst_android under corelib/platform/android.
Change-Id: Icf91cd75cb5e04d03fe6a81d52fba52a485ca41f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
[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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The QCOMPARE made dead code of a more verbose QVERIFY2 below
Change-Id: I26b8286f61534f88b649fffd166b67d8603280a7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
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>
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>