aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlpropertymap
Commit message (Collapse)AuthorAgeFilesLines
* Fix use of Component.onCompleted scripts in QQmlPropertyMap sub-typesSimon Hausmann2018-07-302-1/+30
| | | | | | | | | | | | | | | | | | | | | | After commit 9333ea8649838d7e0400b0e94c8cbd4fa5d216b0 when looking up properties such as "console" in Component.onComplete handlers of QQmlProperty sub-types, we end up implicitly creating "console" properties, which is not correct. At the same time, there are use-cases (and tests such as tst_QQmlPropertyMap::QTBUG_35233) where a binding expression accesses a property of a property map sub-type and it doesn't exist. Then later that property is added and we must re-evaluate that binding. That works because the implicit property creation when reading it also results in a property capture. Therefore we introduce the HFH (hack from hell): Detect the use of a QQmlPropertyMap sub-type and go back to the old lookup behavior. The path forward should be a deprecation of QQmlPropertyMap and perhaps the ability to define abstract interfaces in QML. Change-Id: Ib87bc1ebae44d7b332be47f1dcb614a19334b559 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* init variables where they are declared when possible (clang-tidy)Shawn Rutledge2018-02-261-4/+3
| | | | | | | | clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-2/+2
| | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-0/+35
|\ | | | | | | | | | | | | | | Conflicts: tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp tests/auto/quick/qquickitem/tst_qquickitem.cpp Change-Id: If261f8eea84dfa5944bb55de999d1f70aba528fd
| * QQmlPropertyMap: Don't spuriously emit valueChanged() signalThomas McGuire2016-07-251-0/+35
| | | | | | | | | | | | | | | | | | | | The valueChanged() signal was emitted when the property was written with the same value. This increased the potential for binding loops in user code. Change-Id: Ifeb8f6f23e2022aa35cb6cac7cf1a3dbc0e8ca2f Task-number: QTBUG-48136 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Updated license headersJani Heikkinen2016-01-201-17/+12
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | 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-11/+11
| | | | | | | | | | | | - 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>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | 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>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - 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>
* QQmlError::toString: improve handling of empty urls.David Faure2014-07-241-1/+1
| | | | | | | | | | | | "file::2:23: ..." is strange to read. Show "<Unknown File>:2:23: ..." instead, by treating empty urls (including "file:") as unknown, and by still showing line and column numbers in such a case. This change makes it possible for QUrl::fromLocalFile("") to return an empty url rather than "file:", which this module was relying upon in the tests. Change-Id: I91918090fd4e0aa9a25dbbb18893a0ce94140e21 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Prefer to use normalised signal/slot signaturesSergio Ahumada2014-03-031-1/+1
| | | | | | Change-Id: I9856c110399c4b6b1ea6aba2d92392cecff04656 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-061-2/+27
|\ | | | | | | Change-Id: If9a205bea219b9aca95d78b1e556ca9bbff58dd0
| * Fix property access to QQmlPropertyMap objects when addressed via idSimon Hausmann2014-01-021-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | Property access to id objects is optimized at compile time, but we cannot do that for QQmlPropertyMap instances (or generally fully dynamic types). This issue was a regression against Qt 5.1 Task-number: QTBUG-35906 Change-Id: I759a1a899f6a3a1f6466282f455b289ad7451086 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-161-0/+81
|\| | | | | | | | | | | | | | | | | Conflicts: src/quick/items/qquickitem.cpp src/quick/items/qquicktext.cpp tests/auto/quick/qquicklistview/tst_qquicklistview.cpp Change-Id: I0bc5786098193c2c40b6fd8905de75d90f6ed0cf
| * Fix dynamic properties in QQmlPropertyMap not always being visible in QMLSimon Hausmann2013-12-051-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQmlPropertyMap is a fully dynamic class that can add properties at any point in time. In order for these properties to be visible inside QML, we must disable the property cache (instead of trying to unsuccessfully re-fresh it). What happened in this particular case is that the QQmlPropertyMap derived type was instantiated and the VME instruction for creating it would also assign the property cache the compiler determined. There's no way for QQmlPropertyMap itself to access this property cache instance (stored in output->types[id].typePropertyCache) or invalidate it, so instead don't use the compiler's property cache when instantiating the type. This patch also disallows the adding properties to QQmlPropertyMap when it is used as base type for a new QML type, as we cannot provide the derived type to the QQmlPropertyMap constructor - this is only possible in C++. Task-number: QTBUG-35233 Change-Id: I7fa9e4a2224ccfdd7ccb3fd9f73919ecd46058a8 Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix autotests expecting a trailing whitespace for qDebug streamKai Koehne2013-12-121-3/+3
|/ | | | | | | | The behavior of QDebug was fixed in qtbase. Update autotests accordingly. Change-Id: I36c442fb772ba35b71b6ab50b5f77a3f9c1463e3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QQmlPropertyCache: check methods before propertiesAlberto Mardegan2013-05-311-2/+30
| | | | | | | | | | | | | | | When creating the QQmlPropertyData, search within the methods list before searching for properties. The reason is that if the meta object is dynamic, looking up a property will always return a result (if the property doesn't exist, it will be created) and therefore all methods will be obscured. By swapping the search order, we eliminate this risk (methods are not dynamically added). Task-number: QTBUG-29836 Change-Id: Ie367f757c37ef4bc834a6c1c009f27bcf344fe76 Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fallback to QMetaObject for properties not in QQmlPropertyCacheAlberto Mardegan2013-05-311-0/+29
| | | | | | | | | | | | QQmlOpenMetaObject does not update the QQmlPropertyCache when new properties are added, meaning that the QQmlPropertyCache might not contain all of the dynamic properties of an object. Therefore, make QQmlPropertyCache fallback to reading the QMetaObject when a property is not found. Task-number: QTBUG-31226 Change-Id: I760aaa155b1952f6f52ab9ce173fb9547f8e34a6 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Quick tests: Introduce QQmlMessageHandler.Friedemann Kleint2012-12-202-14/+5
| | | | | | | | | | Add QQmlMessageHandler class that can be used to record messages into a QStringList. It also makes sure that the old message handler is reinstalled if the test fails. Task-number: QTBUG-28611 Change-Id: I0fff7bc11e188cf47178d9573e5f2eead693bc10 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Autotests: Use qInstallMessageHandlerKai Koehne2012-09-141-4/+4
| | | | | | | qInstallMsgHandler got deprecated in Qt 5. Change-Id: Icb6423c7d9f7e507ba36376b0af5ad183379c494 Reviewed-by: Martin Jones <martin.r.jones@gmail.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>
* Remove default parameter from protected QmlPropertyMap CT.Friedemann Kleint2012-07-301-1/+1
| | | | | | | | | Make public constructor explicit. This fixes QtLocation compilation (declarativeplaces defaulted to the protected CT). Change-Id: I8b32d7624b6ba770f6d646c227a0bfd37e501ee5 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Allow access to signals and slots in QQmlPropertyMap inheritorsMatthew Vogt2012-07-271-0/+43
| | | | | | | | | | | Allow inheritors of QQmlPropertyMap to pass the static meta object information needed to support their signals and slots. If the correct pointer is not provided to the constructor, it is not accessible via the virtual metaObject() function during construction. Task-number: QTBUG-26400 Change-Id: Ide8c6d3568e4abd4c48e0aa60e6fa05a9c2a11cf Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Allow QQmlPropertyMap property updates to be controlledMatthew Vogt2012-07-181-0/+44
| | | | | | | | | | Allow clients to control updates made from QML to types derived from QQmlPropertyMap, by overriding the updateValue() function. Task-number: QTBUG-23183 Change-Id: I0169093779ebfe50dc9349f5aaac08ed85c80a8f Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: abcd <amos.choy@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-242-0/+250
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>