| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quite obviously, the Qt object is a singleton, extended with a
namespace, backed by a member of the JavaScript global object.
Defining all the methods as JavaScript functions is unnecessary and
duplicates the general type transformation code. Also, it makes it
hard to use those same methods from a C++ context as we cannot
properly set up the arguments outside the JS engine.
Rewriting the Qt object reveals some deficiencies in the old
implementation that we need to fix now:
1. The enums of the Qt type were listed as properties of the Qt object,
which means you could iterate them with a for..in loop in in JavaScript.
This is just wrong. Enums are not properties. This functionality
is deleted and the test adapted to check for each enum value separately.
The commit message for the change that introduced the iterability
already mentioned that the author had failed to find any occurrence of
this in the real world.
2. Parsing time objects from strings was done by parsing the string as a
date/time and then picking the time from that. We still support that for
now, but output a (categorized) warning. Parsing the time directly is
preferred where possible.
3. Previously you could create (invalid) dates and times from various
kinds of QML types, like int and color. This does not work anymore as we
now validate the types before calling the functions.
4. Passing more arguments to a function than the function accepted was
unconditionally ignored before. Now, a Q_CLASSINFO on the surrounding
class can specify that the arguments should be checked, in which case a
JavaScript error is thrown if too many arguments are passed. In order
for this to work correctly we also have to ignore JS undefined values as
trailing arguments for overload resolution. This way, if a method
matching the defined arguments exists, it will be preferred over a
method that matches the full argument count, but possibly cannot accept
undefined as parameter.
Consequently a number of error messages change, which is reflected in
the qqmlqt test.
[ChangeLog][QtQMl][Important Behavior Changes] You can not iterate the
enumerations of the Qt object in JavaScript anymore. This does not work
with any other enumeration type either. You can of course still access
them by name, for example as Qt.LeftButton or similar.
[ChangeLog][QtQMl][Important Behavior Changes] The time formatting
functions of the Qt object in QML now allow you to pass an actual time
string, rather than a date/time string as argument. Passing a date/time
string results in a warning now.
[ChangeLog][QtQml][Important Behavior Changes] Functions in the Qt
object for formatting date and time will now throw a JavaScript error
when presented with a value of an incompatible type, such as int or
color.
[ChangeLog][QtQml][Important Behavior Changes] The Qt.resolvedUrl()
function now returns a URL rather than a string. This follows the
documentation.
[ChangeLog][QtQml][Important Behavior Changes] The GlobalColor enum of
the Qt namespace is not exposed to QML anymore. It did not make any
sense before as the enum values could not be used as colors.
Change-Id: I7fc2f24377eb2fde8f63a1ffac5548d652de7b12
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
As you can extend value types with QML_EXTENDED we may as well allow a
factory function in the extended type. Furthermore, if the original type
allows construction from QJSValue, we may just use that. In turn, we can
get rid of the value type providers now.
Change-Id: I9124ea47537eab6c33d7451080ab2fff942eaa7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
They all did the same thing.
Change-Id: I7661b19ad16c0713d46c4df337899e3897349b2e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was only used for QColor. The string representation of QColor was
funneled through the color provider to get a numerical RGBA value and
that one was passed to storeValueType() which would create a QColor
object. The RGBA value was retrieved by creating a QColor object. We
can just directly create the QColor from the string, and we can use the
generic create() method for that.
Change-Id: If36775830882237e5e36f748872ce23530c3bb71
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
This can be expressed as constructing the variant from a QJSValue.
Change-Id: I3140958469423acdc498e26129e349bcfb601198
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
It can be expressed as a special case of create() with a QJSValue.
Change-Id: I7342026ad694077d2780dd8a852714fa72dd68d0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
This can be expressed in terms of create().
Change-Id: Id1950390bf4a1c9dfd9364ea351b81c75eb7e28f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
This is so that we can replace them with factory functions as a next
step.
Change-Id: Ic8619e4e779bd3e47471642c556601555758697b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
You can now have an extension object on a value type that offers
additional properties. This is how we model the QtQuick value types. It
allows us to retrieve the extension's metaobject without using the
virtual functions in the value type provider.
As before, this mechanism is still rather dangerous and not fit for
public consumption. It relies on the extension object having exactly the
same layout as the original value type, and it hides any properties the
original value type might expose.
Furthermore we enforce now that gadgets should have lowercase names.
The ones that didn't before are split up into an anonymous value type
and a namespace that contains all the addressable bits.
Task-number: QTBUG-82443
Change-Id: Ic93d6764538d6ccc0774b3c5648eee08ba0939c0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
We can create, compare, convert registered types without going through
special virtual value type providers.
Change-Id: I0431256540b8dd6861ff3a945570ea7df45ed98d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
The more adventurous variant/string conversions are luckily unused.
Let's remove them before anyone gets ideas.
Change-Id: I6f95cbdf9ead12ab723cafdbb2b0f02a0ff461fa
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduces an easy way to get a version of a color with transparency
(e.g. Qt.alpha("red", 0.5)).
[ChangeLog][QML][General] Added Qt.alpha for easily modifying a color's alpha value
Task-number: QTBUG-77635
Change-Id: Ic724e5fa503ca2ae5157a99eed1b5c913a39239f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
| |
This is just an alias for QV4::ReturnedValue. We can as well use the
latter.
Change-Id: Ibd2c038a3ca726b39a8f0f05e02922adb9fccbdb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
| |
Task-number: QTBUG-74996
Change-Id: Ibc5de6e79889724850c9cdc16c8ba066a76298d1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the null provider had to be deleted last as it would leave a
dangling pointer in the global static. This meant that we could not
delete any other value providers on shutdown as the deletion order
between different Q_GLOBAL_STATICs is undefined.
Task-number: QTBUG-74348
Change-Id: I12aab6ab9ec4c71b90af69c5f824e0c6686433f5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.
Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).
Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This exposes QGuiApplication::platformName() for qml. It is
required at least for tests that are run on the "offscreen" platform
(armv7 tests on qemu).
[ChangeLog][QtQuick] Added Qt.platform.pluginName property.
Task-number: QTBUG-60268
Change-Id: Ie55a282485d4d76ffe7ed8e77359ad7183f579c2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
Instead use QT_CONFIG(foo). This change actually detected a few
mis-spelled macros and invalid usages.
Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)
Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
| |
After the removeal of the QQmlVMEVariant there is no user left.
Change-Id: I97224127aac57aba9a80827f9292018d03609b85
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
The ValueTypeProvider system allows non-QML modules to add new basic
QML types. It needs to be changed when porting away from QQmlVmeVariant
as underlying type of properties.
Change-Id: I2b52d7e6f578647a39832896c28553404b9a679f
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
While reworking the QQmlValueTypeProvider interface I noticed that this
code isn't used.
Change-Id: I30a279ffabf3a1c70eaa1327e69b774f5e5981f0
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|
|
|
|
|
|
| |
By using QStringLiteral when the argument is a literal.
Change-Id: Ib25042d10f3d9d0aca81af74cde0107aba4f9432
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is more convenient than the alternative hsla() function in many
cases as color pickers in other applications default to the HSV color
space e.g. GIMP, kcolorchooser.
[ChangeLog][QtQml] Added Qt.hsva() function
Change-Id: Id5c1a78173757bf9842b164d90b31682e9a41749
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
|
|
|
|
|
|
|
|
|
| |
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.
Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I0fc94e680b011963e645bdbf51110820751e53aa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
| |
Change-Id: Ic51f9daf17742a421a810d95b2a510caf657e08f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
| |
Change-Id: I6b26a8249175a86c6e15d000b24ba3300e112715
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changed built-in QtQml value types to use gadgets. This is in preparation for
supporting external gadgets.
This replaces the mostly direct inheritance of the concrete value types with
gadgets and "dynamic" inheritance through QQmlValueType being generic. Over
time as some of the value types may become gadgets, we can remove the ones
here. It's important that these "separate" gadgets have the same memory layout
as the actual types (QPointF, etc.).
Also while QQmlValueType remains practically a singleton, it's not required
anymore to be one. Consequently the JS wrappers for value types keep their own
instance of QQmlValueType. This allows eliminating the qobject_cast in various
places that dealt with the singleton nature. This comes at a cost, making the
JS wrappers slightly heavier. However that is meant to be a temporary situation
and finally the value type wrapper should merely store the meta-object in
addition to the data and the type.
Change-Id: I15071ded0a1e54203f29ec1ecf7a9ab646d1168e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
| |
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL
Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
wip/v4
Conflicts:
src/quick/items/context2d/qquickcontext2d.cpp
tests/auto/quick/qquickvisualdatamodel/qquickvisualdatamodel.pro
Change-Id: I36a4fd28b3156839aecd70039a3ba566bf19a0bc
|
| |
| |
| |
| |
| |
| |
| | |
QCoreApplication now provides change notifications.
Change-Id: Icd7e1247426f4b5ad124d6d9b72a2ba99225ee08
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
|
| |
| |
| |
| |
| |
| | |
Change-Id: Ic4a161b59d51e621e13c960f104d1a3be2ee64f8
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
|
|/
|
|
|
|
|
|
|
| |
The handle wraps a V4 Value, so this is the better name for it.
Also added some accessor methods to convert to and from V4
Values.
Change-Id: I327c83feb5bd3be59909001489979e5a3a9d9e67
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This exposes some information to QML which is available on
the QCoreApplication instance.
A future change should make it possible to restrict this for use in scripting
environments (which should not have access to the QCoreApplication). That has
been left out of this change because proper support for such restrictions is
not yet in place.
Change-Id: Ica144fcfb0b42fa6df8d0cb1c7c03eb97282b489
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the QtQuick library is loaded, it runs a global constructor that
installs the QtQuick value providers. But those providers are never
uninstalled when the library is unloaded, resulting in a dangling
pointer stored in QtQml's singly-linked list of value providers.
Since cafb02911a29b98ac2652fde64e95870e70fd547, QLibrary will unload
plugins after inspecting their plugin metadata on Mac and Windows. If
QtQml is trying to load a plugin that links to QtQuick (in particular,
*the* qtquick2plugin plugin), it would cause the value provider to go
stale.
To make matters worse, it's quite likely that the plugin would get
loaded soon after, at the same address in memory, which causes the
valueTypeProvider list to become cyclic.
Change-Id: I6f4db5475ceeaba766d9e9c78f86266c9a65806a
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
|
|
|
|
|
|
| |
Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76
Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
|
|
|
|
|
|
| |
Change-Id: I90f8ec7e6357db7b4038bb1646fe9d3835821556
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Alan Alpert (RIM) <aalpert@rim.com>
|
|
|
|
|
|
| |
Change-Id: I0b0e63b572617a56874e27361479de2690644aa3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
|
|
|
|
|
|
|
| |
Change copyrights and license headers from Nokia to Digia
Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In QtQuick 1.x the "variant" property type was supported, which could
be used to allow value type properties to be defined in QML. In
QtQuick 2.0, we have deprecated the "variant" property, but its
replacement ("var") is not suited for defining lightweight C++ type
values (such as QColor, QFont, QRectF, QVector3D etc).
This commit allows those QML basic types to be used in QML once more,
by supporting them in the property definition syntax.
Note that since some value types are provided by QtQuick and others
are provided by QtQml, if a client imports only QtQml they can define
but not use properties of certain types (eg, font).
Task-number: QTBUG-21034
Task-number: QTBUG-18217
Change-Id: Ia951a8522f223408d27293bb96c276281a710277
Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
|
|
|
|
|
|
|
|
|
|
| |
This operation should be a no-op anyway, since at this point in time,
the fromAscii and toAscii functions simply call their fromLatin1 and
toLatin1 counterparts.
Task-number: QTBUG-21872
Change-Id: I03084595ddc425a988374b8352fd23e9504ffba6
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
|
|
|
|
|
|
|
|
|
| |
Ensure that the logic used when writing to a property having a value
type provided by an external module matches that used for properties
of internal value types.
Change-Id: I925b8b30a211ef813e2a51134411a162b0b146b5
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
|
|
Ensure that users of declarative that have no need for functionality
provided by the Qt Gui module do not have to link against it.
Any use of QtGui functionality is delegated to providers that can
be installed by another library; QtQuick adds default providers
for this functionality when linked against QtQml.
Task-number: QTBUG-24559
Change-Id: I5e6a58a4198732dc2f8f52f71abfa1152b871aa7
Reviewed-by: Martin Jones <martin.jones@nokia.com>
|