aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlvaluetypes
Commit message (Collapse)AuthorAgeFilesLines
* Unregister value types when tearing down QML typesUlf Hermann2021-02-121-3/+3
| | | | | | | | | Move the value type registry into QQmlMetaTypeData. This way we can conveniently drop the relevant entries when unregistering a type. Fixes: QTBUG-86946 Change-Id: Id024a34a8b2b622fd9417fc0e52864b43c66cc01 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-151-17/+0
| | | | | | | | | 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>
* Use QMetaType instead of metatype-id, take 2Fabian Kosmale2020-12-031-3/+3
| | | | | | | | | This time, the ValueTypeFactory gets converted. As a consequence, many callers get touched again. Task-number: QTBUG-88766 Change-Id: I3a8b7d5cfeb7fac85daf1702febba205971d4256 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QV4Engine: Fix conversion of char16_tUlf Hermann2020-11-171-1/+17
| | | | | | | | This is a single char16_t, not an array of them. Pick-to: 5.15 Change-Id: I55d23ebb5f2abebd43cd4160a75d373706392ddf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qtdeclarative: finish fixing compilation with explicit QChar(int)David Faure2020-11-071-1/+1
| | | | | Change-Id: Idb26e2df6d4fe8940db57066a30fa8c243f6d2c9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-061-3/+3
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Adapt to changes in qtbaseUlf Hermann2020-09-151-0/+1
| | | | | | | | | Due to qiterable.h specializing a template declared in qmetatype.h we temporarily need to include it in a few tests so that the iterables work. Change-Id: Ia32392419dead76eaf2b91b2ec4157b726d8de74 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Use OpenType font weightsJonas Karlsson2020-08-281-1/+1
| | | | | | Task-number: QTBUG-42248 Change-Id: Ib26d4945307b630b054e270b3213e1c9ad0d5357 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Unify "variant" and "var" properties in QMLFabian Kosmale2020-08-244-108/+0
| | | | | | | | | | | | | | | | | | | | variant and var properties differ in two important ways: - variant properties trigger "magic" string conversions: variant v1: "red" // contains a QColor var v2: "red" // contains a string - variant properties behave differently for value types: they create copies, instead of references. However, as variant properties were marked as obsolete and this behavior was effetively undocumented, it should be safe to give "variant" "var semantics". With this change, we can also avoid doing magic conversions when storing data in QVariant properties of QObjects/QGadgets Change-Id: I549b1beb98e6af9639c1ee81f316bda513d5ff65 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix test to not depend on internal roundingAllan Sandfeld Jensen2020-05-291-1/+6
| | | | | | Pick-to: 5.15 Change-Id: I3c66cb52b435a891d88a5e1c9d1db155d63e2481 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlValueTypes test: import QtQuick to make font availableUlf Hermann2020-04-281-0/+1
| | | | | | | The test relied on QtQuick being loaded by other tests before. Change-Id: Ide326b4e541b29289e37a27735a1cb47f700b0e2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Update Apple platform defines after rename in qtbaseTor Arne Vestbø2020-03-171-2/+2
| | | | | Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-121-0/+2
|\ | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-301-0/+2
| |\ | | | | | | | | | Change-Id: I1e1d9585d876a8eacd4c24afc894a33075f51a13
| | * Fix tst_qqmlvaluetypes::colorProperty when run standaloneSimon Hausmann2020-01-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The test relied on implicit registration of QQmlProperty in the meta-type system. Change-Id: I21e08a44f8e3d3b1376977cb9c959e0630789ef9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Regenerate qtdeclarativeAlexandru Croitor2020-02-121-5/+2
| | | | | | | | | | | | | | | | | | | | | Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-294-1/+31
|\| | | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
| * | Make Font.weight an integer instead of enumerationEskil Abrahamsen Blomfeldt2020-01-211-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The weight in QFont is an integer, allowing you to request a font of any weight given the predefined scale. In Qt Quick, however, you were limited to the predefined values. This is done in Qt 6 because it breaks conversions from string to weight, as the change in the autotest illustrates. [ChangeLog][Font] Made Font.weight an integer value rather than limit it to a predefined set of weights. As a side effect, conversion from strings to font weights are no longer supported. Fixes: QTBUG-80402 Change-Id: Ifbe9a0e608b63bfa93bb54999b0b3c1851ccfa88 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Add Q_GADGET Wrapper for QQmlPropertyPierre-Yves Siret2020-01-153-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This enable exposing a QQmlProperty as a value type to QML code. Only object and name are exposed as a properties to keep it simple. We might want later to expose the property of a Binding or a Behavior as a property for complex usecases. This permits exposing it as one self contained value instead of a pair of unrelated object and name. Task-number: QTBUG-70964 Task-number: QTBUG-73892 Change-Id: I3a46212446f43f3a7e301943cb49d3a48c377de3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-151-3/+3
| | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate remaining tests to be in syncAlexandru Croitor2019-11-151-9/+2
| | | | | | | | | | | | Change-Id: I200c8f58ad13bc1bc78409a3ce49348584ba5b51 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-143-0/+22
|\| | | | | | | | | | | | | Removed dependencies.yaml because we don't use it yet in wip/cmake. Fixed conflict in qmlcachegen.cpp. Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
| * Add a property "valid" to the color value typeUlf Hermann2019-10-083-0/+11
| | | | | | | | | | | | | | | | | | | | This gives users a more convenient way to determine if a particular color is valid. Before you had to actually compare with an invalid color. Fixes: QTBUG-78325 Change-Id: Id86bc46a48aa11da3e6654d2940d758d2b0e784f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Make QQmlValueTypeFactory::valueType() and isValueType() consistentUlf Hermann2019-09-041-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If isValueType() returns true, we should really return a non-null value from valueType(). Otherwise the assumption that QQmlValueTypeWrapper::valueType is never null breaks. In particular, the unknown type and various primitive types are _not_ value types. We special case the, probably common, UnknownType and check the actual return value of valueType() for anything else. In order to avoid looking up the metaobject each time we request a type that is not a value type, we keep an invalid value type as marker for "not checked yet" and replace that with nullptr once we determine that the type in question is indeed not a value type. Fixes: QTBUG-76866 Change-Id: I797f4cdd4db48ffc1b8fa2d919afc8022f67fa94 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-111-2/+14
|\| | | | | | | Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
| * Fix qqmlvaluetypes autotest for androidJan Arve Sæther2019-08-141-2/+14
| | | | | | | | | | | | | | | | | | The test assumed that QFont::pixelSize always retured -1. QFont::pointSizeF might also be -1. Change-Id: Ia00ecdd897fc15de533bdfb34716d568c5c4c6c2 Task-number: QTBUG-73512 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add QtDeclarative Test CoverageLeander Beernaert2019-08-141-0/+53
|/ | | | | | | | | | | | | | | | | | | | | | All tests compile and run on a developer build. These tests are failing: tst_qqmlsqldatabase Fails due to missing sql driver tst_qqmlsqldatabase Fails in wip/qt6 tst_ququicklayouts Fails in wip/qt6 tst_flickableinterop Fails in wip/qt6 tst_qquickpinchandler Fails in wip/qt6 tst_qquickflickable Fails in wip/qt6 tst_qquickgridview Fails in wip/qt6 tst_qquickimage Fails due to missing jpeg plugin tst_qquicklistview Fails in wip/qt6 tst_qquicktext Fails in wip/qt6 tst_qquickcanvasitem Fails in wip/qt6 tst_scenegraph Fails due to missing jpeg plugin tst_TestFiltering Fails in wip/qt6 Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-181-0/+23
|\ | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlimport.cpp Change-Id: I6add6267297ea50a646d43d212027a168dca8916
| * Merge remote-tracking branch 'origin/5.12' into 5.13v5.13.0-beta3Qt Forward Merge Bot2019-04-151-0/+23
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/masm/assembler/LinkBuffer.h src/qmltest/doc/src/qtquicktest-index.qdoc tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I7d83ad95cf489dda794dd7a0a33bad3ef3b05609
| | * Don't create value types for QImage and QPixmapUlf Hermann2019-04-121-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | Those are "scarce" resources which need to be kept as QVariant. Fixes: QTBUG-74751 Change-Id: I28381e2a754ed4bbf4e409dc275f6288b64416cc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QV4Engine: Unify fromValue and metaTypeToJSRobin Burchell2019-03-211-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Somehow, we ended up with two codepaths doing essentially the same thing: constructing a JS value from a QVariant. metaTypeToJS is invoked from QJSEngine::toScriptValue, whereas fromVariant() is used in various places internally. metaTypeToJS lacks proper handling for a number of cases, such as builtin types like QPointF, which lead to toScriptValue(QPointF) (incorrectly, and uselessly) constructing a VariantObject which couldn't then do anything useful. [ChangeLog][QtQml] QJSEngine::toScriptValue will now return correct JavaScript objects in more cases, for example, for gadget types like QPointF. [ChangeLog][QtQml] QJSEngine::toScriptValue now uses the same behavior as the rest of the engine when building JavaScript values, which will cause the types of some returned JavaScript objects to change. For instance, string lists are now returned as sequence objects, not array objects, and QChar now constructs a JavaScript string. Change-Id: I0290eb7c9c46e7b508d497cc33cd61d9378f3872 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Teach QML that it is possible to treat custom QObjects as QObjectJędrzej Nowacki2018-10-081-0/+8
| | | | | | | | | | | | | | It is always better to treat a QObject child as QObject then a QVariant. Change-Id: I4ac069e85232dd4d1411e325bc5b858bd001f9a6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add support for QSequentialIterable in QMLJędrzej Nowacki2018-10-081-0/+35
|/ | | | | | | | | That means that now QML understand many sequential value types and it is able to convert it to a JS array. Fixes: QTBUG-60338 Change-Id: I46943b7c130296bb64c23008ce2e52a55d7f019d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make sure we call Codegen::defineFunction with proper argumentsLars Knoll2018-05-021-2/+2
| | | | | | | | | | | | | | | So far, when instantiating QML bindings, the node parameter could be the same or a child of the body. This will break badly when we introduce lexical scopeing as that node could be an AST::Block that opens it's own context. Changing this requires some smaller adjustments to our autotests, as error locations will now be slightly different (pointing to the beginning of the binding, not the beginning of the RHS of the binding). Change-Id: I2c536a4fe6d8b549a138cc7967ef034eb2523f3b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tests: add autotest for Q_GADGET derived template classNils Jeisecke2018-03-141-0/+29
| | | | | | | | This tests the effectivity of the qtbase fixes for QTBUG-66744. Task-number: QTBUG-66744 Change-Id: I5bb041082ae4ce6cb91076c3f1279ac7bdcae4f0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-86/+86
| | | | | | | | | | | | | 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>
* tst_qqmlengine::clearComponentCache(): Use QTemporaryDirFriedemann Kleint2017-06-081-1/+1
| | | | | | | | | The test used to create a file temp.qml in the working directory. Put it into a temporary directory. Change-Id: I0720a4b4c652c83656505a5dc979660b94503717 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Get rid of most QT_NO_FOO usagesLars Knoll2016-11-291-2/+2
| | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-11-281-0/+34
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The renderers added in 5.8 had to be adapted to the changed profiling macros from 5.6. Conflicts: src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp src/quick/util/qquickprofiler_p.h tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp Change-Id: Icb370b7c95aab12589ad73881ac6d178759a5c6b
| * Merge remote-tracking branch 'origin/5.6' into 5.75.7Liang Qi2016-11-251-0/+34
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/quick/util/qquickprofiler_p.h Change-Id: I11a89c2a166115d6697adfba09928805643e709e
| | * Fix reading of enum properties from gadgetsSimon Hausmann2016-11-161-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMetaProperty::type() maps an un-registered enum to QMetaType::Int, and so if a property cache is created for a gadget with enum properties, then their type will be int and we'll correctly read enum properties as ints in JavaScript. However if the enum is registered at the time we create the cache, then the property type will be the specific type and not QMetaType::Int. The property reading code in QV4::QObjectWrapper can deal with that, but the property reading code in the gadget value type wrapper code did not. [ChangeLog][Qt][Qml] Fix reading of enum properties from gadgets / value types when the enum was registered with qRegisterMetaType(). Change-Id: I7812b216a276dcc95c36e313507e1a1142250d0b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Expose HSV and HSL color values to QMLNikita Krupenko2016-07-254-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQuick] Added properties to access color values for the HSV and HSL color models to the basic QML color type. Task-number: QTBUG-48723 Change-Id: I45fa52f9f3878553e1b3d0a34b47804ede7794f8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | QML: Unify property reads/writes and use accessorsErik Verbruggen2016-07-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pass property reads/writes through utility functions in QQmlProperty, which in turn will try to use accessors when available (and no interceptors have to be called). Change-Id: I60ecfc202b6024bfe4a33206a46299787b152546 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Fix visibility of properties in value typesSimon Hausmann2016-05-151-0/+21
|/ / | | | | | | | | | | | | | | | | | | | | | | It should be possible to enumerate the properties of value types (gadgets), in order for things like JSON.stringify(Qt.point(10, 20)) to return something sensible. Task-number: QTBUG-43382 Task-number: QTBUG-34878 Change-Id: I3a2c09151ebe97fd97760dfbbf5a4f58e022bc94 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-291-0/+18
|\| | | | | | | Change-Id: Iec1b2de53c275996364c4bab0123ccb3e6e9895e
| * QML: do not wrap property values of type QVariant.Erik Verbruggen2016-01-271-0/+18
| | | | | | | | | | | | | | | | | | | | When reading a propety from a QGadget or a QObject, the values are stored in a QVariant and later unwrapped/converted to the correct JavaScript type. However, if the property value is a QVariant, it does not need to wrap it (again) in a QVariant. Change-Id: I633d3194f82b6032fc15d9994c4dee5e5609fd21 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Leave out most of tst_qqmlvaluetypes::locale() on QT_NO_IMUlf Hermann2016-01-221-0/+2
| | | | | | | | | | | | | | We cannot get an input method from QQmlGuiProvider then. Change-Id: I8d9c2323b8a18a00bc44fc0121ddefb90253228a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-203-51/+36
| | | | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-072-3/+3
|\| | | | | | | Change-Id: Ica75a71062d0613e415f2433c5c22c2e251b37cd
| * Fix test casesLars Knoll2015-12-012-3/+3
| | | | | | | | | | | | | | | | | | This test case changed after change 2e00500b9f32f25a15563a4fd35375ead12c14a7 got merged into qtbase. With that change, colors with alpha components will now be converted correctly to a #AARRGGBB string. Change-Id: I8a1edc846537bf7868ba56d819d7aedae1a10fa1 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>