aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlmoduleplugin/invalidStrictModule/invalidStrictModule.pro
Commit message (Collapse)AuthorAgeFilesLines
* Lift restriction for type registrations in QML module pluginsSimon Hausmann2018-02-021-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During the registerTypes() callback in a QML module plugin we only allow types to be registered that match the module URI specified in the qmldir. We can observe in QtQuickControls 2 that sometimes we need to register types outside of the namespace of the module itself. QQC2 is in QtQuick.Controls but the module has internal types that are in QtQuick.Controls.impl. Types are intended to be registered once in the virtual registerTypes() function. However as we don't allow for the registration of .impl to happen in registerTypes(), QQC2 works around this by registering the types in initializeEngine(), during which the namespace restriction is not in place. This workaround means that every time an application creates a QQuickView (and thus new QML engine) and loads a QML file that imports QQC2, we end up calling initializeEngine(), as opposed to registerTypes() that is called only one single time in the application process. As a consequence each time this happens we and up calling qmlRegisterTypes() with the same times and leak memory this way, as qmlRegisterType*() is supposed to register a new type and return a new type id that can be passed to qmlUnregisterType. To solve this this patch lifts the restriction on namespaces for registered types during registerTypes(). The real world case of QQC2 shows that the restriction is limiting and also easy to work around. With the restriction lifted QQC2 can now register all types once in registerTypes() instead. [ChangeLog][QtQml][Important Behavior Changes] QML module plugins used to be limited to type registrations in the primary module namespace in the virtual registerTypes() function. Module authors worked around this limitation by placing necessary internal type registrations into initializeEngine() that may cause memory leaks. Therefore this restriction has been moved and types in any (non-protected) namespaces can be registered in the registerTypes() function. Change-Id: I5baf9718a0b0a591f6eb6d7e2dc83e13b204800d Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* 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: replace nokia with qtproject in tst_qqmlmodulepluginLiang Qi2013-10-311-1/+1
| | | | | Change-Id: I674da7f77dde380fb0772d5077da84de875b6ce8 Reviewed-by: Alan Alpert <aalpert@blackberry.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>
* Implement strict mode for qmldir modulesMatthew Vogt2012-07-311-0/+12
Allow a module's qmldir to contain a module directive, which when present specifies 'strict mode' import processing. In strict mode, type registrations are only permitted into the namespace identified in the qmldir file's module directive. In addition, any type registrations to that namespace originating from other modules are treated as error conditions. Task-number: QTBUG-26551 Change-Id: I081bde2d3b83d3f28524440177fb2cd1ccee34ad Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>