aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlvaluetypes
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | 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>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-09-062-0/+60
|\| | | | | | | Change-Id: Id27c36e55fcc68cc1140b0d9bec00b8ae6b52ed0
| * Merge remote-tracking branch 'origin/5.5' into 5.6Simon Hausmann2015-09-022-0/+60
| |\ | | | | | | | | | Change-Id: Ibc7a47f7ce6d15dff79fdc59f8ded297d1b8d50d
| | * Don't consider QLocale a value type.Mitch Curtis2015-09-022-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a regression where all of the properties of Qt.inputMethod.locale were undefined. Change-Id: Id33890a78296709baad6aeda96d74ca8cb39c61d Task-number: QTBUG-47916 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | Remove CONFIG += parallel_test.Friedemann Kleint2015-09-051-2/+0
| | | | | | | | | | | | | | | | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: I699f2881e291cce02a6a608a8710638886e38daa Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | | Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-031-1/+0
|/ / | | | | | | | | Change-Id: I691b8ddff60b5f16f06d32b379c76e87f44f84a9 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* / tests/qml: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-291-5/+5
|/ | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: I8cc97fd9b48fc789a849e9527c292c4e05accd97 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Add left, right, top and bottom properties to basic QML rect type.Mitch Curtis2015-06-035-8/+16
| | | | | | | Task-number: QTBUG-45528 Task-number: QTBUG-45530 Change-Id: I83c4056b4bde37ef2dc4424ffddd823c1654d92e Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-123-21/+21
| | | | | | | | | 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>
* QQmlValueTypeWrapper: Use QVariant to QString conversion if possibleGabriel de Dietrich2015-01-201-0/+30
| | | | | | | | | | | This makes it easier to customize displaying Q_GADGETs that don't have a toString() function defined. Instead of having to define a wrapper Q_GADGET class, it's more straightforward to register a meta-type converter. Finally, it ensures consistent value displays between QML and the rest. Change-Id: I76f93ee0bafabd74f311130972b49c572b38f43f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix property access and method invocation on value types that use inheritanceSimon Hausmann2015-01-072-0/+57
| | | | | | | | | | For gadgets/value types we use moc's static_metacall, which doesn't call the parent class implementation. Therefore before placing a static metacall we must resolve the indicies and find the right meta-object. Change-Id: I258e3d9ecfc704498c68772dc42b16134a3bfd83 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Enable gadget wrapping for custom value typesSimon Hausmann2015-01-023-0/+94
| | | | | | | | | | | | | | | | | | [ChangeLog][QtQml] Custom C++ value types annotated with Q_GADGET are now fully accessible in the QML and QJSEngine JavaScript environment. QJSEngine::toScriptValue can be used for injection and fromScriptValue to extraction. The QML "built-in" gadget wrappers for QPoint and the gui types are not exposed this way, toScriptValue(point) will still return an opaque QVariant wrapper. We could expose the core types right away, but then we would be lacking an API to enable use of the Gui types that are registered in QtQuick. It would be better to make the core types in qtbase gadgets and thus enable them without the need for hooks and init functions to be called by the user. Task-number: QTBUG-29769 Change-Id: I8179cd599bdc1209ff61cfdbdda419cb400296bb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Initial work on gadget supportSimon Hausmann2014-12-221-21/+0
| | | | | | | | | | | | | | | | | | | | | | 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>
* Simplify QFont value type wrapper in preparation for gadgetsSimon Hausmann2014-12-131-1/+0
| | | | | | | | | | | | | | | The value type wrapper for QFont tries to keep track whether pixel or point sizes were set and warns the programmer accordingly if both were set. This is implemented using separate boolean variables, but this can also be done using QFont's resolve mask. This move is motivated by the ability of the value type wrappers to operate only on the type they wrap in the future, without requiring additional helper variables. Change-Id: Ia05093b5dcc950281ef89b2bb6fe96c18329cdfa Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Update license headers and add new licensesJani Heikkinen2014-08-253-57/+33
| | | | | | | | | - 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>
* Fix MSVC-warnings about double to float truncation in QML-tests.Friedemann Kleint2014-01-242-16/+16
| | | | | Change-Id: Ie58585ca3555f0f7808b59221a00763cc702863a Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* fix whitespaceOswald Buddenhagen2014-01-223-3/+3
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix autotests expecting a trailing whitespace for qDebug streamKai Koehne2013-12-121-2/+2
| | | | | | | | The behavior of QDebug was fixed in qtbase. Update autotests accordingly. Change-Id: I36c442fb772ba35b71b6ab50b5f77a3f9c1463e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix all autotests related to value typesLars Knoll2013-05-301-2/+2
| | | | | | | | Fix 3 bugs in the new implementation, and adjust two expected error messages in the auto test. Change-Id: Ic3c08e54f9babc7e4779d67829e36f3ff805e127 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix compilation with built-in v4vm JS engineSimon Hausmann2013-04-151-1/+1
| | | | | Change-Id: Ieda9267e296acf6392a5461f4cfb9233a7a409a0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-103-3/+3
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-233-73/+73
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Allow invokable functions of value-type classes to be calledChris Adams2012-08-095-2/+136
| | | | | | | | | | | | Previously, invokable functions of value-type classes were returned as properties. This commit fixes that bug by allowing such functions to be invoked normally. It also improves copy-value type handling. This commit also ensures that QMatrix4x4 value types are constructed with qreal values as this is the storage type used internally. Change-Id: Iab0fe4c522ed53d60154e8a8d46dda925fb9f4de Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I6988c2360e9d88916311374a0c910bfc5b607439 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix value-type semantics in variant propertiesChris Adams2012-07-243-0/+87
| | | | | | | | | | | Previously, variant properties storing value-type values would be treated as value-type-copy values rather than value-type-reference values. This caused inconsistency in behaviour with value-type subproperty assignment. Task-number: QTBUG-26562 Change-Id: I524ee06ab8e02bf9582c1a88f3317278199225e0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix test for value type interceptors.Glenn Watson2012-07-111-2/+14
| | | | | | | | | In release mode, floating point inaccuracies can cause this test to fail. Use a fuzzy compare since it doesn't affect what the test is actually trying to check for. Change-Id: I5e3d073614090450216c33fcc561a7454cf44ac3 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Make Behaviors work correctly with value types.Glenn Watson2012-07-046-0/+127
| | | | | | | | | | | | | | When a value type is referenced by sub-component a grouped property is built. This code path did not handle behaviors being declared on the entire value type. Add support for value interceptors in this code path. Also issue an additional write to the value type property before calling the interceptor on components that are not being intercepted, so that the other sub-components don't get stale values during write back. Task-number: QTBUG-22625 Change-Id: I3365f422dfa1ab2e536e19575efcceceffb85e10 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Ensure external value types are initialized before writeMatthew Vogt2012-04-302-0/+39
| | | | | | | | | 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>
* Migrate gui dependencies from QtQml to QtQuick.Matthew Vogt2012-03-202-9/+9
| | | | | | | | | | | | | 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>
* Merge master into api_changesKent Hansen2012-03-191-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qqmlenginedebugservice.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/quick/util/qquickimageprovider.cpp tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp Change-Id: Ie78ba2fabd32f4812bcae9dbdd66ed289dc11dcb