This renames all qml files added before to allow qmlimportsanner to
include the necessary modules into Android packages, into
android_dummy_imports.qml, and also adds a comment in each one
describing why it's needed.
Pick-to: 6.2 6.3
Task-number: QTBUG-97056
Change-Id: I7fc0514dd9e5bc10849fdd0503547e1a75242414
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This allows us to enable testing on declarative for the module
as a whole and have some sort of test verification for the mean
time, and fix the fails over time.
This also disable tests like qdom and qjsscope which are host tests.
Pick-to: 6.2 6.3
Task-number: QTBUG-100991
Task-number: QTBUG-99194
Task-number: QTBUG-101005
Task-number: QTBUG-101006
Change-Id: Ie7ae5b8e0ccdf2f55ce3568091d513a073c48417
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2nd round of test failures fixes for Android. Mostly resource bundling
related issues still.
Pick-to: 6.2 6.3
Task-number: QTBUG-97056
Change-Id: I2fac0710a7b5528fcef4480babd0cbf749e488b3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Problem: The layout is initialized with a copy of the current font
before the laying out begins.
In cases when setupTextLayout() iterates through the main loop multiple
times, it will update the layout font, if it differs. (See code below)
if (!once) {
if (pixelSize)
scaledFont.setPixelSize(scaledFontSize);
else
scaledFont.setPointSizeF(scaledFontSize);
if (layout.font() != scaledFont)
layout.setFont(scaledFont);
}
The whole reason why we might update the font in the first place, is
because the QQuickText has a fontSizeMode property which can be set to
e.g. HorizontalFit, which will cause the layouting to downscale the font
in order to fit (assuming the text doesn't fit the space available),
instead of eliding.
The problem here is that QFont internally uses a float to store the point
size, and we would convert that value to an int when temporarily storing
it on the stack. This would modify the pointSize value in cases where
the pointSize is fractional, and cause a mismatch between the QQuickText
and QTextLayout.
The lineWidth is set only during the first loop iteration. During
successive iterations of the main loop, the layout's font would be updated
to one that has either a floored or ceiled pointSize.
If the pointSize is a fractional value, and is ceiled when being updated
during the second loop iteration, the layout would use a larger font
value, which would cause the QTextLayout::naturalTextWidth() to return a
larger value than that of the lineWidth, triggering eliding.
Solution: Keep the font precision, by storing the values as floats
instead of ints.
Fixes: QTBUG-92006
Pick-to: 6.2 6.3
Change-Id: Ibf64ac2dfbf262c6aae05b8eb8251d2f5a869b69
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
It is not impossible for (1.0 - visualPos) to be negative.
Which can cause the max parameter to be smaller than the min
parameter in the qBound() call.
This is a followup to c77b9bae69
which partially fixes the issue, but forgot to apply the same
change to the statement before it.
I somehow managed to crash the dialogs manual test, when clicking
around randomly in the FolderDialog.
(thus reproducing it might end up being difficult)
Pick-to: 6.3 6.2
Task-number: QTBUG-101174
Change-Id: I92b2228f1cf92d3e3d79b05d281e05c765466101
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
As the module was developed for touch interfaces first and foremost, we
can state that bringing desktop support up to par is an ongoing process.
Change-Id: I769731efbd7131b8ffe47ac1db937808dbb3495b
Pick-to: 6.2 6.3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
We can now suggest a template string to use instead that is properly
escaped. Once auto-fixing becomes available we can automatically replace
deprecated multiline strings with the new suggestion.
Task-number: QTBUG-92448
Change-Id: I4e77820b66ae960cde558a62689c5da328b8df5b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This looks bad and doesn't follow our coding guidelines or what our
formatter would produce.
Change-Id: Iceccb4cd1d9cccd84d49ded426f7ce184839b095
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
It seems MOC does not like methods named "isnan" on Android.
It generates a call to "__builtin_isnan".
This patch is a workaround. A real fix in MOC would be better.
Pick-to: 6.3
Change-Id: If73a4d7580ac51f6c60f4fb92c9699d077f4452f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
There two functions will be used in subsequent patches to be
able to determine the geometry of loaded rows and columns.
Task-number: QTBUG-100696
Change-Id: I8619957bcfeafe11b3965e9179a4b7e8c612bbd4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Later patches that implements animation support for moving
the currentIndex around will need to load edges synchronously, even
if it can theoretically be inside an asynchronous loader. Add
an extra argument to loadAndUnloadVisibleEdges() to be able
to specify this from the caller.
Task-number: QTBUG-100696
Change-Id: I3dc8e2c137ba0223cd820b7b7286829942f79821
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Some of those make the compiled code slower than the interpreted code.
That is bad enough of a bug to pick it back to 6.2.
Pick-to: 6.2 6.3
Fixes: QTBUG-100847
Change-Id: I823ff688d3aead364e21ae1e90e16a4bfaedb1f5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
- Store the "binding content", i.e. the literal, object, interceptor or
value source in a std::variant. This saves space compared to the
previous approach (where we had individual fields), and also helps
with type-safety. We also get rid of m_bindingType, which can now be
obtained via BindingType(m_bindingContent.index()), as long as we keep
the types in the variant in the correct order.
- Remove a few methods that were not used anywhere. Those can be brought
back once we actually need them.
- Removed the setLiteral method in lieu of type-safe setX methods where
X is one of the literal types. QQmlJSImportVisitor has been refactored
to make use of this, and its parseLiteralBinding method has been
changed into a parseLiteralOrScriptBinding method. This simplifies the
control flow, and ensures that we always add the parsed binding.
- Literals no longer store the literal type (as in, the actual
QQmlJSScope pointer) themselves. Instead, literalType takes a pointer
to a QQmlJSTypeResolver, and we use that one to resolve the type on
demand.
Change-Id: I0612d49f2f46fec0fa90f0f5047d8c9f831214ef
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
If you do QUrl::fromLocalFile() on a file name starting with ":" you get
a rather curious URL.
Change-Id: I07d35e792b87a66fffc9c992462d92a4c0c8040d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If you give qmltyperegistrar an invalid URI it should still not generate
invalid C++ code. In fact the module will still be somewhat usable. You
just cannot import it.
Pick-to: 6.3
Task-number: QTBUG-101072
Change-Id: I21232f99c1ef486a62dbe339f7d0ae1b9abc8871
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
You cannot just pass a resource path or absolute path. We expect a URL
after all. A relative path is a relative URL, so you can pass that.
Pick-to: 6.2 6.3
Fixes: QTBUG-98181
Change-Id: I010bc08b8cb0ff06712f7b0353955bee96ae36c1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The loader's context may have been removed from the context hierarchy or
it may not have a context in the first place. We should not crash then.
Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-67950
Change-Id: I1058d5b1f978aa040f8b2f018c4357dd7a3ef333
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
As we don't store void, null and empty lists, moving those is a noop.
Don't generate invalid code for that.
Pick-to: 6.2 6.3
Change-Id: Ica6714acd0ce8a5ddca44d9a397e776eb3df4247
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Returning void from any JS function doesn't quite cut it.
Pick-to: 6.3
Fixes: QTBUG-101285
Change-Id: I199813627614061ec25139277e8ea23cb844aac5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
We will need to iterate the annotations in program order. Therefore, we
need an order map. QFlatMap fits here.
Change-Id: I9a7fe68b0e5aa817257ceabb4853b1554d3ad709
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
- Some qtdeclarative tests don't need GUI library, but QT_GUI_LIB definition is generated for static build
qt/qtdeclarative/tests/auto/qml/qjsprimitivevalue/CMakeLists.txt example.
The thing is linking of PUBLIC_LIBRARIES Qt::Qml brought plugin linking and generation not full GUI dependencies.
Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: Iad923735ff4d487dabab927f8c49b0100bef2525
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
We need to do it "manually" since qt_copy_or_install only copies files
in non-prefix builds
Task-number: QTBUG-98011
Task-number: QTBUG-101163
Pick-to: 6.3 6.2
Change-Id: Ie8e23fe15ad07054a15cc8f403079373382a5b83
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Previously the filename was only available for C++ types that have been
exposed via qmltypes. Now every scope has a valid filename to reference.
This is important in order to give more useful hints to the user and
will also prove useful for debugging.
Change-Id: I6142b58278f388814514fffd86cbc241eb969bb2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The defaultVulkanInstance stuff moves to a private helper in QtGui to
allow reusing the same code by QRhi users in other modules.
The cleanup is now performed by QGuiApplication and is not tied
to the render loop.
Change-Id: Ic2233d62529a4aca254239e47742c1bc7394ab4c
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
In order to have a separate basic block analysis pass we need to track
which registers are read and converted into what types at each
instruction. In addition, we also track which of the instructions are
merely register renaming operations. Those do not introduce a new
tracked type and have to be handled specially. Finally, we also record
which operations have side effects beyond the movement of values through
registers. Those operations cannot be optimized out.
Change-Id: I32900cbe130149f36439132850a2d76078aab31d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Implements a styleHints property to QQuickApplication for accessing QStyleHints
so it can be utilized in a way that's compatible with tooling and compilers.
[ChangeLog][QtQuick][New Feature] Qt.styleHints should now be accessed as
a property of QQuickApplication via Application.styleHints
Fixes: QTBUG-100993
Change-Id: I377c59072678a67d20f519cb5d329863111f295b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
We need quite a few more methods for this. The methods will be taken
into use in follow up changes.
Change-Id: I94e9f5b5fb3da277d90ea040b0219585ba6df397
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If there are no enums in a type, we don't need the int type to resolve
them. This is commonly the case for sequence types.
Change-Id: I18b2960ef845ef797b6ef6d755648e6add1854db
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This allows us to convert to other types than the ones listed in the
guesswork we do so far. It also clarifies the meaning of that
inconspicuous '=' used to assign to the out accumulator.
Change-Id: I041145ab451f5e8b44ae529a66414251b81fe072
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We have to add the methods first, so that the properties can be
associated with their proper notification signals once we add them. If
we add the properties first, the "missing" notification signals are
synthesized.
Pick-to: 6.2 6.3
Fixes: QTBUG-101155
Change-Id: I1aacbf33a24f7a98d05dece77c804bd7cba8a041
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We cannot convert to QVariant using QMetaType::convert(). But we can
just construct a QVariant with the desired type and data. This will
become an issue once we automatically convert argument types to match
the desired type inside the function.
As a side effect, also allow declaring "var" arguments to functions.
Change-Id: Idc14021d8d85d3d09ee7b7f286de91b56ea02bfd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Previously whenever a property was called the warnings qmllint emitted
made it seem like the property was just not found instead of not being
callable.
Now we will warn if you try to call a property and warn about
properties shadowing methods, slots or signals. We also discourage
calling variant properties now that may or may not be a function.
This change also fixes an assert being hit in isMissingPropertyType
due to our previous, lackluster checks.
Fixes: QTBUG-101074
Pick-to: 6.3
Change-Id: I0790b4a4584f3430ee1d8ddf549611225a36cc5b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The initialized = true statement either went missing or it never was
there. This has zero effect on the common usage where the client does
not bother with invalidate(), but rather destroys the
QQuickRenderControl. However, more complex usages, such as in
QQuickWidget do need to invalidate for various reasons, without
destroying the entire QQuickRenderControl.
Pick-to: 6.3 6.2
Change-Id: Iaabc6309cb42cfdd624321863a5504cdeb01275d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Check for contents of environment variable QML_PLUGIN_PATH
and add them to Qml plugin path. In some cases it would be
preferable to add additional Qml plugin paths without having
to call QQmlEngine::addPluginPath() in the application code.
Qt Android apps have already been doing this with
QT_BUNDLED_LIBS_PATH, but the naming could be a bit misleading
outside bundled Android apps.
The option to provide these additional paths with environment
variables is already commonly used, e.g. for other Qt plugins
and Qml imports.
Change-Id: Id81bb4fc6caa3c9c3adfd73be6ea45be74c5d8c4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Both TableView and TreeView needs to be able to set and update
required properties. So move this helper function from
QQuickTreeView into QQuickTableView, so that they both can
use it. This will also make it easier to update how we deal
with required properties in TableView/TreeView once
QMetaProperty::isRequired() works.
Task-number: QTBUG-100696
Change-Id: Iff0a86fe46cecdc4db8d307787fe148c7e71bbf6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Unfortunately when searching online for "dialog qml", the only
doc.qt.io links are for Qt Quick Dialogs and Qt Labs Platform,
which makes it difficult to find the Dialog from Qt Quick Controls.
Link to it from the detailed description to make it clearer.
Change-Id: I8874b9111be5938b4e77e4dbd397f5eace2e5242
Pick-to: 6.2 6.3
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
These were accidentally catching other links.
Pick-to: 6.2 6.3
Change-Id: Ifc2d9eeef8d4629e25c217fc39d9f01ef134538c
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Moves the QModelIndex value types from QtQml to QtQml.Models as they
cannot otherwise be properly resolved in tooling.
Pick-to: 6.3 6.2
Fixes: QTBUG-100338
Change-Id: I30fc18b388974238ba8353e87ef09f57f8ceabd1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Renamed the checkRestricted method in order to make it clear
what the boolean return value means.
Change-Id: I4f25b5a320779cabd53ea6091f42f60634ea3a97
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>