| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This is the more modern way of doing things, so demonstrate that in our
examples and documentation.
Change-Id: Icd5316fbeeb00c34d470c8d871851945dc831244
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
Similar to script imports from .qml files, the .mjs extension is used to
distinguish between ES modules and plain script files.
Change-Id: Id5f9b59fb77e99e3c9d6a404e6d091d96b501ad6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
With one engine per worker script, we can replace the onMessage and
sendmessage wrappers with plain properties of the WorkerScript object
that we can access. The code is further simplified by merging
WorkerEngine into WorkerScript.
Change-Id: I25e9fb253b6b0dd1fe63676392b1c760a83215db
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
Now that we have one JS engine per worker script, we can get rid of the
per-script QML context and let the script simply run in the global
object, which is now also mutable.
Change-Id: I36d8616b85b2c0ff3a356ee7be9d242c3da624cf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
Multiple WorkerScript {} elements would share the same underlying
JavaScript engine. This complicates the design.
Change-Id: I17f240bc393f669c23248c96d1aeb6b5a70a2802
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| | |
Change-Id: Ib4dd56aa31ea0f2026b61dbae061d0b333426d0f
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When executing an interpreter instruction, the code pointer points to
the next instruction. However, sometimes a pointer to the current
instruction is needed. That was hacked-around by having startInstruction
be called before updating the pointer. This is confusing and leads to
unexpected off-by-one-instruction cases.
So now during startInstruction calls and generate_instructionName calls,
there is a currentInstructionOffset() and a nextInstructionOffset() that
do what's on the tin in both places.
Change-Id: Ie8dd35ff0a7d236f008030ef4c29ec3f31c07349
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
which was added in qtbase e09f5b17.
Change-Id: Id16ba131ac8a92beccaecb52a1e73627557a4939
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After 6008c5ded48b6d03d56bf4c4ab96177fbb185f93,
QQuickPointerHandler::wantsEventPoint() does not check parentContains()
so we have to do it in HoverHandler itself.
Change-Id: I5bdebc251091367dbebfbab1fcb81c0b120d7902
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In other places where qqmladaptormodel_p.h is included, there are lots
of other includes which eventually result in qqmlglobal_p.h being seen.
In the new qqmldelegatecomponent.cpp, there aren't so many, so this
missing dependency became clear, at least on Windows:
c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.12.0\qtqml\private\../../../../../src/qml/qml/qqmlguard_p.h(119): error C3861: 'QQml_setParent_noEvent': identifier not found
c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.12.0\qtqml\private\../../../../../src/qml/qml/qqmlguard_p.h(113): note: while compiling class template member function 'void TestNamespace::QQmlStrongJSQObjectReference<TestNamespace::QObject>::setObject(T *,TestNamespace::QObject *)'
c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.12.0\qtqml\private\../../../../../src/qml/util/qqmladaptormodel_p.h(72): note: see reference to class template instantiation 'TestNamespace::QQmlStrongJSQObjectReference<TestNamespace::QObject>' being compiled
c:\users\qt\work\qt\qtdeclarative\include\qtqml\5.12.0\qtqml\private\../../../../../src/qml/qml/qqmlguard_p.h(125): error C3861: 'QQml_setParent_noEvent': identifier not found
The error was because QQml_setParent_noEvent(QObject*, QObject*) was
not defined, but it is defined inline in qqmlglobal_p.h.
Change-Id: I972e2795d5a705e1170ef50b2ef7f9b124a28472
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds a specific abstract QQmlComponent subclass,
QQmlAbstractDelegateComponent, and a default implementation,
DelegateChooser, that, together with the type DelegateChoice
allows determining the delegate type by role and/or index.
The patch also adds QQmlAbstractDelegateComponent support
to QQmlTableInstanceModel, that is a simplified version of
the delegate model, currently only used in the new table view.
DelegateChoosers are intended to behave just like Components
in the context of the view. This means that they can be declared
outside of the view, and also in separate files, and the same
delegate component can be used at the same time in multiple views.
[ChangeLog][QtQuick][Item Views] Added a DelegateChooser Component
to host DelegateChoice instances to choose different delegates in
an Item View (e.g. TableView) depending on model roles.
Done-with: Michael Brasser <michael.brasser@live.com>
Task-number: QTBUG-26681
Change-Id: Ibe24a31daf9142c8a9ff45ef6c65da0aec8a14dc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In order to support quick loading of scenes with lots of text,
we support preloading the contents of the distance field cache
from a generated file instead of creating all the distance fields
on startup.
The idea is that when creating a distance field cache for a specific
font, the data will be prepopulated. This is stored in a table in
the font file and is picked up automatically by Qt when available.
[ChangeLog][Text] Support pregenerated loading distance field
glyph caches to decrease startup time for applications with
large amounts of text.
Task-number: QTBUG-69356
Change-Id: I7cff0c4c782f819b1c893041405970ea4553fb8d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This builds more complete documentation than qdoc, including
internal classes, and a full set of UML class diagrams and
collaboration diagrams.
Change-Id: Ibfbcdd8605e334857644d4de29169c5d49a20b2c
Reviewed-by: Martin Smith <martin.smith@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Needed with newer qtbase.
This amends 218fb96808f9ca4470427f68141eac64d1ad96f6.
Task-number: QTBUG-69971
Change-Id: I970e65d8e0a977c52c6f187f955987811e774348
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I028fc16b0e0f06efc1738a07a76c43379d07371d
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
|
| |
| |
| |
| |
| | |
Change-Id: Iea29cc7abbfc73fb58b59f8ff4d9f8ba33ce09c3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: If57543709fb7ecb649307c7fa95835dd20a3f558
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I9b64ab9fb99b885ad66acebb82dd7b614401f143
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make sure to start the search for a potential focus item on an item that
will be visited again later, otherwise we'll loop for ever.
Fixes: QTBUG-68271
Change-Id: Icb330e4e726132511810027a33b9fb346c7fa131
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Improve the test so that you can click on
the cells to change their color.
Change-Id: Ia74620894f2885242f587c4c863bcf3544b13488
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a TableView initially loads as many rows and columns it can fit
inside the viewport, it will always be one less than the number it
will show while flicking. The reason is that, as soon as you flick
half a column out on the left, half a column will move in on the right.
And this will increase the number of visible columns by 1 (but without
reusing any items from the pool, since the first column is not out).
Since this is always the case, it makes sense to preload one extra
row and column at start-up, so that they're ready when the flicking
starts.
Note that this doesn't load more items in the background than
what we need (like the cache buffer would). The viewport will fit
_all_ the loaded items into the viewport once you start flicking.
But the extra items loaded at start-up will instead be moved direcly
to the pool for reuse, and the application will be informed about it
(using the onPooled signal).
Change-Id: Icea85c1d44f74ab54f1b96325489e8d6d1c0889e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The current implementation would unload a column/row if the right edge
was greater than the right edge of the viewport. At the same time, it
would load a column if the left edge was less than the right edge
of the viewport. But we did nothing if the edge was exactly at the
edge of the viewport. This patch will fix that, so that an edge is
seen as either inside or ouside (and never on the edge).
By handle this (corner) case, it will be easier to test the layout
from the auto test, since a column will either be seen as inside or
outside the viewport (and not exactly an the edge in addition).
Change-Id: I95fccaa4a1bb583036027d2fc8c6eb4895eeefc8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Needed with newer qtbase
Change-Id: I84222b06c615d60ad004512e43d3b6c6e904baea
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After we removed cacheBuffer from the public API, giving
the users no way to switch if off, the safest thing is to
also remove it from the implementation. The cache buffer
can easily load add a lot of hidden items to the view, and
the user now has no way to tweak or hinder it.
As an example, lets say that you in a ListView can fit 10
items on screen. And then you have a cache buffer set that
loads two more items, both on top and below. You then end up with
14 items added to the view. Now, lets consider the same case
for TableView, where you show 10x10 items on screen. With the
same cache buffer, you end up loading 2x10 items in the
background on all sides of the table (pluss 4 items in each
corners). This sums up to 96 extra items. This is really bad
and unacceptable. It's more performant to just switch the
caching off completely.
Change-Id: Iddbd78ef1d7c7197eb4a847ec5067184149fe9a0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The enabled property was added with QtQuick/QtQml 2.3 as part of Qt 5.7,
but due to multiple bugs, the property became visible across all
versions, breaking lookup as outlined in the linked task.
The first issue was that property revisioning needs to be specified via
the REVISION tag inside Q_PROPERTY, not using Q_REVISION.
The second issue was that in type registration the unversioned type must
be registered first followed by the revisions. Otherwise the call to
QQmlMetaType::qmlType(const QMetaObject *metaObject, const QHashedStringRef &module, int version_major, int version_minor)
that will look through the metaObjectToType multi-hash will find the
last inserted type first and that satisfies the minor version
requiremend. In the case of the Connections type, that would be the base
version registered last with
qmlRegisterCustomType<QQmlConnections>(uri, versionMajor, versionMinor,"Connections", new QQmlConnectionsParser);
Lastly, if we were to just call that one first and then register
revision 1 afterwards, then only the first version would have a custom
parser attached and we would fail to process the bindings correctly if
using the newer revision.
So to fix this, we introduce another private qmlRegisterCustomType
specialization that includes a meta object revision, thus allowing us to
register the Connections type in the correct order and both with a
customer parser.
That's not ideal, but also not worse than the previous three registration
and it fixes the visibility.
[ChangeLog][QtQml][Connections] Fixed the visibility of the enabled
property to only appear when importing QtQml/QtQuick >= 2.3, which was
introduced with Qt 5.7. Otherwise it would accidentally shadow for
example an "enabled" context property.
Task-number: QTBUG-69884
Change-Id: I888374d96f19502466358df81007bcb3c65d3a79
Reviewed-by: Michael Brasser <michael.brasser@live.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
It's compiled as a C file, so reinterpret_cast and nullptr cannot be
used.
Change-Id: I864a400f3752a4de51775a443a3049365bf2c5c1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I30ddca4402254e1cde17712d07ea0bff2ea5f595
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For function expressions such as
var foo = function foo() {
return foo;
}
it is important to have a separate binding for "foo" within the scope of
the function. However for function declarations this does not apply:
function foo() {
foo = 2;
}
foo()
console.log(foo) // should print 2
Therefore we should enter the ThisFunctionName type of binding only for
function expressions or (generally) for the case where the name is not
intended to be entered into the surrounding environment at
defineFunction() time.
This is covered implicitly in
language/module-code/eval-gtbndng-indirect-update-dflt.js
Change-Id: I1e5114a93ac7db9e5fcea04b1b3e1de4ad7bff6d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It does not make sense to declare a property that has a setter and mark
it as constant. Moc also complains about it and notes how the constant
attribute is ignored. Therefore we might as well remove it from the
declaration.
Amends a9b9875acc6155f85558bb27cdb75f2dda5e2b66
Change-Id: Ib78d6e9c5e3415bc2a3dc26477d1d2a4e5b4dcfe
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Amends commit 18d2f78437d28987297148b63b99ceed6313a78a
Change-Id: I5e81d6f0de945a06580fb7d8faedd4ee9df184a5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is also pretty straight-forward by adding .mjs as supported
extension in the qmake and cmake support.
This also tweaks qv4engine.cpp to share the same module compilation
function across all code paths.
Change-Id: Ia0e23c78a794f2330ecf8f991ee6ea948f4ac89d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Two minor fixes needed for this otherwise straight-forward change:
(1) When compiling modules, use the full url for the source file of
the compilation unit, as that's what we use for the relocation check
when loading the cache file.
(2) Record the proper source time stamp for cache invalidation.
As a bonus, when importing scripts from .qml files, we now also attempt
to use the cached version that we created on the fly in an effort to
replace heap memory with mmap backed memory - just like we do for .qml
files.
Change-Id: I5b03a18e3c44d537c3242cb1d969636df32fe42a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is a straight-forward hook into the module implementation in
QV4::ExecutionEngine. Modules are pre-compiled in the QML type loader
thread. That thread keeps track of all pending loading scripts through
the type loader's m_scriptCache. Once a module is compiled, it's
thread-safely registered with the execution engine.
Script instantiation and evaluation is done solely in the QQmlEngine's
thread.
ES Modules are identified in imports as well as qmldir files by the .mjs
extension.
Change-Id: Ie9c59785118afcb49f43a1e176a9f7db00f09428
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
A little example goes a long way :)
Change-Id: I5aaac011e5a3e1348d7a084b669ec66349d441fa
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Now that the standard defines the concept of a module, it makes sense to
offer a function in QJSEngine that can read files and load them.
[ChangeLog][QtQml][QJSEngine] Added function to import ECMASCript
modules from the file system or the Qt resource system.
Change-Id: I72f8d49de948872221ac1b54fcfb066404bed9b9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I171e571a336a15c27881999a10ffe3c52e92d816
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The spec says in 14.4.12 that an anonymous generator declaration can
only occur as part of the export declaration. The same applies to
anonymous function declarations in 14.1.20.
It is only in the default export declaration rule that we can detect
that we have an anonymous declaration/generator, so that is where we
implement the step of setting "default" as the function name.
It is safe to use an empty string in GeneratorDeclaration_Default and
FunctionDeclaration_Default because that rule is only referenced from
HoistableDeclaration_Default, which in turn is only referenced from
ExportDeclaration.
Change-Id: Ibd341b941f67cbcc727da4df23af04af313b6251
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When registering a default export, make sure that the local name
points either to an entry that we've entered into the environment or
the synthetic entry we create.
Change-Id: I37e160dc1e3231214bb68f72d6bb0746d7aee3b3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ib07d1a215492640e82f4f4791ba714688508f3db
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
They must be sorted, no duplicates and only one default entry at most.
Change-Id: Ia9c0e54a761ce7cbfebb837330bf3769d505eb3b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
This function should not only return the names but also keys (symbols).
Change-Id: I431e4aa8fa31ac6c16a415f00fb9f98405632562
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
One module test remains an expected failure but it comes with an
explanation now.
Change-Id: Id58bcbc840e2cde5f493ff88af972d29485f6c55
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We correctly produce a syntax error for a const declaration that is
without an initialize, such as
const x;
but we have to make an exception if it's part of a for declaration, such
as
for (const x of [1, 2, 3])
Change-Id: Iab86d73f2edc1f3deaf62f0f43f8b04789696b65
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ia5ed7afc67122f4d70bf2e0169537f936df036a9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I767b27faab912e91962797ca154d929473113cc1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: If9f7c07ea657ba8503b9188a7b77e301f23423ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I5a2c9cb1e9dcca664526b3949671d72d2ffee427
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ie966628d020eb010eb5ecc3279fed2b002975728
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
The implementation is supposed to call arg[Symbol.match].
Change-Id: Ia8028d259e152b1e65eb6b0e817ef60bdc0d37e2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Id632a4f4648f68f3b46d31f84e4ee05c86391f3e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|