| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It makes little sense that you can construct an error object but not
throw it. The test was definitely meant to actually throw the error
object, not return it.
[ChangeLog][QtQml] QJSEngine has gained an additional overload to the
throwError() method, with the effect that calling throwError() with a
character literal as argument is now ambiguous. You should explicitly
construct a QString instead.
Change-Id: I90c6c9edf10509daa142a86581d6a3f7ff45af2c
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.
Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
... a.k.a InternalClass. This is a faster way of creating multiple
similar objects, compared to a sequence of setProperty() calls.
Change-Id: Iecc8c581e50b9062895dae9500ffe2482d88028e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
If you access a string as an array you get a one-character string of the
index you are asking for.
Change-Id: Ie2ac3243c9e23f37b8904c54d824946646a596eb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
|
|
|
|
|
|
|
|
| |
The engine should really always be available if we have a d pointer.
Change-Id: If620e69de07c6d365b45e714bae3ec0fb7eb86ef
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
'function' is a separate type in JavaScript and should be treated that
way. Replace the isCallable() method with a new isFunction() to reflect
that, and add an entry to the Type enum.
Change-Id: I09cc28a9edf8aa0380eb9caeb738dfc298a02567
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
| |
Pick-to: 6.0
Change-Id: I1bf34b68ecfa2d6eb8e687a0b12def5e7c96c318
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
| |
We need a way to easily get a primitive from a QJSValue.
Change-Id: I91a55d92ffa4ba6139b1e3f2e9308800b7047563
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
The JavaScript engine does this, so we should do the same here.
Change-Id: I011a60bc2c013f19306c843da7a9c22dc80a39cb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This is rather handy. Without it, we have to go through either QJSValue
or QJSManagedValue, which causes much greater overhead.
Change-Id: I40e2ecb6e2005f80c8f52b5e9a59028b3984eea4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A QJSManagedValue is a view on a QJSValue which always knows the engine
the value belongs to. This allows us to implement the JavaScript
semantics of the various QJSValue methods in a much more rigorous way.
[ChangeLog][QtQml] The new QJSManagedValue should be used instead of
QJSValue for manipulating properties and prototypes of JavaScript
values, as well as for calling JavaScript functions.
Change-Id: I9d445ffcf68dfa72dba9bae0818e83c80665ad66
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
We don't want to call into the engine just for adding two numbers.
This implements the most common operators on primitive JavaScript
values. More are to follow in the future.
Change-Id: Id51a5af59a3af9fec78a2d8f293e59e6567e9204
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The QJSValue to QVariant conversion is traditionally messy. The recent
addition of a special case for FunctionObject did not make that better.
Rather, we now add a way of specifying that the conversion should be
lossless, which avoids all conversions of JS objects and arrays.
Amends commit 6b08c24297f39f3c67bc5c16f46198b33af66529.
Change-Id: I6d4506b52d3175ed2f2984f8a26d560cf6311ab6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
As you can manually throw an error, you should be able to catch it
again, too.
Change-Id: I82475df1969a1fd76f4cf5fc0a8d921dfafaef89
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
Also, allow conversion from UrlObject and String. We allow the string
conversion because we treat string and url as interchangeable in various
places.
Change-Id: Ib229c6d190e1c5d849ea18798925965b8dbeef7e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We cannot retrieve anything sensible from those. Therefore, just wrap
the QJSValue into a variant.
Change-Id: I8acd9fb59a8859c8b2c389efb7934b597a2e479f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Idb26e2df6d4fe8940db57066a30fa8c243f6d2c9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-88156
Change-Id: Ic6127c6128b4c7736cb4b5ab8ce51629388b59ca
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
| |
Since we depend on C++17 now, all of these can go.
Change-Id: I0484fd4bb99e4367ec211c29146c316453729959
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
|
|
|
|
|
|
| |
Change-Id: Ie0e6d975079e4cbedad2dd4f17d3efe8aee553bc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QML][QJSEngine] QJSEngine::evaluate gained an optional
stackTrace parameter. It can be used to check if the returned
QJSValue comes from an uncaught exception, and to retrieve the
backtrace of the execution leading to the error.
Fixes: QTBUG-54925
Change-Id: I2b5ada1f0c33c335b4b9d0d1268e70ca63a1fad1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
| |
Pick-to: 5.15
Change-Id: I4c51c40697e410d56b6a2d2446ed9f8ae218576d
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
|
|
|
|
|
| |
Change-Id: I2a983cf8188e88d80d3b7726208d821427eb8f3c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QJSValue] The deprecated function QJSValue::engine() has
been removed.
Change-Id: I2be35379e0a9e51f5371a2c98b955282955b7147
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QJSEngine] The deprecated installTranslatorFunctions() has
been removed.
Use installExtensions() with TranslationExtension instead.
Change-Id: I58345793ea154ec37d0c64f13c958193e6fa461b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
The internal QVariant constructor taking a QMetaTypeId has been removed.
Thus, construct QMetaTypes where necessary from the id, or avoid a
QMetaType -> ID -> QMetaType roundtrip where we already have a metatype.
Also fix a few missing includse that were previously transitively
included.
Change-Id: I56ce92281d616108a4ff80fe5052b919d1282357
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As noted in QJSEnginePrivate::cache, there can be a race between
calling addRef on the QQmlPropertyCache and another thread derefing and
consequently deleting it. To avoid this, we introduce a doRef flag in
QQmlMetaTypeData::propertyCache, which tells it to ref the the cache.
This fixes the issue, as the QQmlMetaTypeDataPtr in propertyCache() acts
as a mutex.
Fixes: QTBUG-84692
Pick-to: 5.15
Change-Id: I962d28cfd22696aad89a660e41c55f63a8791b44
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
Now that char16_t is used in Qt (for instance in QChar::unicode()), we
need to support it.
Change-Id: I527a70795524bfd883fc4d729aac714708b51181
Reviewed-by: Liang Qi <liang.qi@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QML] The setObjectOwnership and objectOwnership functions
have been moved from QQmlEngine to QJSEngine. This reflects the fact
that they have an effect on objects passed not only to a QQmlEngine, but
also to a QJSEngine. As QQmlEngine is a subclass of QJSEngine, existing
code continues to work.
Fixes: QTBUG-83657
Change-Id: Ib29cdb4a9884e1f1b68fcba64d32b1cb2e5a4297
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
| |
Change-Id: I439653123cdc96df97a1801664655c9d28a8b9b5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Being careful, we can now save primitive values inline. We use the heap
pointer of QV4::Value as either QString* or QV4::Value* for complex
types. We cannot store persistent managed QV4::Value without the double
indirection as those need to be allocated in a special place.
The generic QVariant case is not supported anymore. The only place where
it was actually needed were the stream operators for QJSValue. Those
were fundamentally broken:
* A managed QJSValue saved and loaded from a stream was converted to a
QVariant-type QJSValue
* QVariant-type QJSValues were not callable, could not be objects or
arrays, or any of the special types.
* Cyclic references were forcibly broken when saving to a data stream.
In general the support for saving and loading of managed types to/from
a data stream was so abysmally bad that we don't lose much by dropping
it.
[ChangeLog][QML][Important Behavior Changes] When saving a QJSValue to a
QDataStream only primitive values or strings will be retained. Support
for objects and arrays was incomplete and unreliable already before. It
cannot work correctly as we don't necessarily have a JavaScript heap
when loading a QJSValue from a stream. Therefore, we don't have a proper
place to keep any managed values. Using QVariant to keep them instead is
a bad idea because QVariant cannot represent everything a QJSValue can
contain.
Fixes: QTBUG-75174
Change-Id: I75697670639bca8d4b1668763d7020c4cf871bda
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I3a6c83ffc203bf27121f460ba23d31a39d1493ee
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In many places we carry major and minor versions or revisions that are
loosely coupled to minor versions. As the Qt minor version resets now,
we need to handle these things more systematically. In particular, we
need to add a "major" part to revisions.
QTypeRevision can express the current major/minor pairs more efficiently
and can also be used to add a major version to revisions. This change
does not change the semantics, yet, but only replaces the types.
Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QtQml] Added Qt.uiLanguage and QJSEngine::uiLanguage properties
These properties mirror the same value in QML and C++ and can be used
freely. They also provide API symmetry to Qt for MCUs.
QQmlApplicationEngine binds to this property and applies translations
accordingly by constructing a QLocale with the value and using
QTranslator::load(locale).
Change-Id: Id87d6ee64679b07ff3cb47844594e8eeebd8c8b6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Christian Kamm <mail@ckamm.de>
|
|
|
|
|
|
|
|
|
|
|
| |
as type is going to be deprecated.
This change was done automatically with the help of clazy.
In addition, ColumnRoleMetadata was changed to take an int instead
of a QVariant::Type
Change-Id: Ibc02d7b52e7d931a56c19fdebc4788b5e6df2a39
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/jsruntime/qv4engine.cpp
src/quick/handlers/qquicktaphandler.cpp
src/quick/items/qquicktableview.cpp
Done-With: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Done-With: Ulf Hermann <ulf.hermann@qt.io>
Done-With: Shawn Rutledge <shawn.rutledge@qt.io>
Change-Id: If9558a33f01693ce96420c094e0b57dfff0626cd
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After recent changes to QDoc, it now correctly warns about missing
documentation for QML method parameters - fix all of these and also
do some minor language editing.
Remove duplicated entries for
- \qmlmodule Qt.labs.qmlmodels
- \group qtjavascript
as they were causing issues.
Change-Id: I55cd670cc8a0cc6427cdb7945dbd7c28ea94f796
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: I5bf128b4479971e87d377707f2ebf267ccba1f1d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The old code used the implicit conversions from QAtomicPointer<T> to
T*, and QAtomicInteger<T> to T, and vice versa. The semantics of these
differ from the ones std::atomic uses, so we're going to deprecate
these, like we did for load() and store(), too.
This patch fixes some users of these APIs before we deprecate them.
Change-Id: I892d705c22280f1c6fdc62c1777248b44e9c4329
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
tests/auto/qml/qjsengine/tst_qjsengine.cpp
Change-Id: I34df194046a91ee8a076ce28022eb99d68e7f362
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
QVariants are commonly passed around between threads and QVariants can
wrap QJSValues. Therefore we need to allow this. The persistent value is
freed immediately if we're still in the same thread. Otherwise a
message is passed to the QJSEngine that owns it. If there is no
QJSEngine we assume that we can free the value immediately. As such a
thing can only happen via private API we can make sure this assumption
holds.
Fixes: QTBUG-75939
Change-Id: I14c09fd5d6ef7ba689f66656f2bcbb5c88bacf89
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I59f738402d51e39188bbbca2ef1fbc8a61612372
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add an atomic isInterrupted flag to BaseEngine and check that in
addition to the hasException flag on checkException(). Add some more
exception checks to cover all possible infinite loops. Also, remove the
writeBarrierActive member from QV4::EngineBase. It isn't used.
Fixes: QTBUG-49080
Change-Id: I86b3114e3e61aff3e5eb9b020749a908ed801c2b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/qml/qqmlmetatype.cpp
src/qml/types/qqmlmodelsmodule.cpp
Change-Id: Idc63689ba98d83a455283674f4b5cf3014473605
|
| |
| |
| |
| |
| |
| |
| |
| | |
This enables overriding the macro so that it translates
to 'None' in the Qt for Python context.
Change-Id: Ied1ddcb0f9e6e2299d9042e4cc4c2bb6d11a491b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ic135a863581d29a3afb9c6c7f070d2630b3913b4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/qml/qqmlmetatype.cpp
Change-Id: I517c001ea4eb0fdd8e469f9fffe5b7559a5b0795
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Depending on the type minor version recursive properties should be
available or not. Check for that when resolving grouped properties.
Fixes: QTBUG-33179
Change-Id: Id8f62befdc4a29d879710499e19d3d289bd18775
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The declarations and usage of runtime functions have seen a number of
changes:
- we don't use the array of method pointers anymore because we don't use
cross-platform AOT JITting
- the check if a method can throw a JS exception was invalid, and was
not used anymore
- value-pointer vs. const-value-ref was inconsistent
This patch cleans that up. By fixing the exception checking, we can now
use it in the baseline JIT to automatically insert those checks. To make
that work correctly, all runtime methods are in a struct, which gets
annotated to indicate if that method throws. (The old way of checking
which type of engine was used is fragile: some non-throwing methods
do not take an engine parameter at all, and those got flagged as
throwing). By using a struct, we can also get rid of a bunch of
interesting macros.
The flags in the struct (as mentioned above) can later be extended to
capture more information, e.g. if a method will change the context.
Change-Id: I1e0b9ba62a0bf538eb728b4378e2678136e29a64
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
| |
Task-number: PYSIDE-903
Change-Id: I0c4640eb20157673eabb131e8834e79cbbf95d5c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|