aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
Commit message (Collapse)AuthorAgeFilesLines
* QtQuick.Shapes: Declare dependency on QtQuickUlf Hermann2021-02-241-0/+2
| | | | | | | | | | Otherwise qmllint and other tools won't know what QQuickItem is in this context. Change-Id: I68da08cf2c41f17a2623f30303ac8f66b7b9329a Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 1a4b0929de72d533c56dd38a9eaf49d21f16e197)
* qmllint: Check for existence of property typesUlf Hermann2021-02-242-0/+2
| | | | | | | | | | | | | | | | For each binding there should be a property and that property should have a type we recognize. Enums can be property types in C++. We support this by adding child scopes for such enums. The child scopes are then referenced by the QQmlJSMetaEnums and derive from int. The test then reveals that we were missing a few properties in QtQuick.tooling. Add those. Change-Id: I1deef94393ee0e17d34c2dc5980ebfbf25417f36 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 08c8e8ac3ba8eb23ae5c158990f5d029ac9988ed)
* Layouts: Depend on QtQuickUlf Hermann2021-02-191-0/+2
| | | | | | | | | | | If we don't declare the dependency our tools won't figure out where QQuickItem comes from when analyzing the dependency hierarchy of layouts. Change-Id: I389c9e513a3a65143aa6b6fbf508eee584970181 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit fe7318a6cf4398802f919766f2ac585bd844cf48)
* Drop JavaScript root object members from builtins.qmltypesUlf Hermann2021-02-011-1593/+7
| | | | | | | | | | | | | | | | | | Those are not actually accessible from C++, and the description we had was incomplete and misleading. There was no way to know that the "Math" type, for example, was the type of a member of the global object called "Math", but the "float" type was not. Furthermore the types given for parameters and return values were only approximations. JavaScript's type coercion allows us to use a number of other types, too. There certainly is a place for a proper description of the global object, but such a description should be generated from the actual JavaScript root object as found in an actual QJSEngine. Furthermore, we do need better syntax to describe it. Change-Id: Ia573436df04ca967381e1e13dbd42a70bcc60979 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use QDateTime as internal name for the builtin date typeUlf Hermann2021-02-011-17/+21
| | | | | | | | | | | | | | | | | | | | | The internal name serves as hint to the C++ class. This is the same as the internal name of url, for example. The internal name is not exposed to QML. So, from a language perspective, we can choose any name there. All the JavaScript methods of the Date prototype are not actually available on QDateTime. Due to the magic conversions the QML engine does in the background, much of them work in practice. Yet, when generating C++ code, we would need another conversion step to make them available. In order to express part of this, we introduce a second type for the JavaScript Date object. In the future we might link them via some "converts to" property. Then tools could know that creating a QJSManagedValue from a QDateTime (or QUrl etc) results in a richer API with additional methods. Change-Id: I13f66a37d985dbd3581d8bb84937adbbc31286fd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Expose getter and setter names of C++ classes in qmltypes filesFabian Kosmale2021-01-291-0/+2
| | | | | | | | | | | This simply exports the name which are already available in the json files generated by moc. We do not consider whether the methods are non-private for now. MEMBER is not supported either, but might be added if the need actually arises. Fixes: QTBUG-90711 Change-Id: If3ee18c8ce60499676a7ee22df569cba0912e22f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Qt.labs.sharedimage: Mark as non optionalMaximilian Goldstein2021-01-261-1/+0
| | | | | | | | | | This plugin cannot be implemented in an optional way until we create a better way of handling image providers. Task-number: QTBUG-84639 Change-Id: I1eafaa08187bbd566a9da14f39836ea70a1776f9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Make a bunch of plugin headers privateMaximilian Goldstein2021-01-251-1/+1
| | | | | | | | This avoids a bunch of warnings and as these headers weren't exposed before they might as well be kept private. Change-Id: I42417516921ae6d498d1ed07728bdad654067b3d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Qt.labs.sharedimage: Make plugin optionalMaximilian Goldstein2021-01-256-578/+5
| | | | | | | | | This moves the sharedimage types into a new library and is meant to make them availabe to the QML compiler at some point in the future. Task-number: QTBUG-90487 Change-Id: If79425a43cb8c1831422631791d35c1f329c7e80 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* builtins: Don't export Math, JSON, StringUlf Hermann2021-01-251-8/+0
| | | | | | | | | Those are properties of the JS global object. You cannot use them as normal types. Change-Id: I1f80e1be8f598cb102109fa2f685cd2b55ad6950 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Qt.labs.qmlmodels: Make plugin optionalMaximilian Goldstein2021-01-228-2188/+3
| | | | | | | | | This moves the qmlmodels types into a new library and is meant to make them availabe to the QML compiler at some point in the future. Task-number: QTBUG-90487 Change-Id: Ib76d1f0b592cc52f6396864fb4be3bb41c4df27b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Qt.labs.wavefrontmesh: Make plugin optionalMaximilian Goldstein2021-01-222-8/+2
| | | | | | | | | This moves the wavefrontmesh types into a new library and is meant to make them availabe to the QML compiler at some point in the future. Task-number: QTBUG-90487 Change-Id: I9ab9dfc62ef9c205ce4649df33a6c1e2ac0ca639 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Qt.labs.animation: Make plugin optionalMaximilian Goldstein2021-01-214-727/+3
| | | | | | | | | This moves the animation types into a new library and is meant to make them availabe to the QML compiler at some point in the future. Task-number: QTBUG-90487 Change-Id: I19bd864253941931706933f7e517bb31938e9cc2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Qt.labs.folderlistmodel: Make plugin optionalMaximilian Goldstein2021-01-217-1729/+4
| | | | | | | | | This moves the folderlistmodel types into a new library and is meant to make them availabe to the QML compiler at some point in the future. Task-number: QTBUG-90487 Change-Id: Iee84a4804a241aa1dee5f896a02ccc9f0ecc0d8d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Qt.labs.settings: Make plugin optionalMaximilian Goldstein2021-01-204-643/+3
| | | | | | | | | This moves the settings types into a new library and is meant to make them availabe to the QML compiler at some point in the future. Task-number: QTBUG-90487 Change-Id: I986615b08ea8c1a7312b9d9c6ae0b13c03fb5497 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQuick.LocalStorage: Make plugin optionalMaximilian Goldstein2021-01-204-878/+4
| | | | | | | | | This moves the LocalStorage types into a new library and is meant to make them availabe to the QML compiler at some point in the future. Task-number: QTBUG-90487 Change-Id: I57ae8dc45a9ef3d5221520f656a2475bca2eb453 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add support for extended types to qmltyperegistrarUlf Hermann2021-01-181-0/+1
| | | | | | | | | | | | | | | We generate the extensions as separate types. This also covers the case of value types being extended by "themselves". We can properly express this now, so we don't need the hackery of generating the local members of a type with QML_FOREIGN into the foreign type anymore. This also fixes interfaces from local types being written for foreign types. Fixes: QTBUG-89501 Change-Id: Ic76acd7eef09a92c1e36bd7a649c7a2deb24597b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Quick.Layouts: Make plugin optionalFabian Kosmale2021-01-1812-3842/+6
| | | | | | | | | This moves the Layouts types into a new library and is meant to make them availabe to the QML compiler at some point in the future. Change-Id: I9b2b31a78b0e9ca8b6c0db1fc9272d9941c61814 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-1518-307/+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>
* Remove qmldir files in src/importsFabian Kosmale2021-01-1516-85/+0
| | | | | | | | Those files are automatically generated by CMake nowadays, and not necessary since the removal of the qmake build system. Change-Id: I74ba10a58fb17bb28cbfeff49947c962687ad4e0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QuickLayouts: fix crash when layout width depends on parent widthIvan Solovev2021-01-151-2/+2
| | | | | | | | | | | | | | | | | Some tricky cases of setting layout width based on parent layout width were leading to infinite recursive loop of layout size calculation (see the attached example in the related Jira task). Initially the QQuickGridLayoutBase::rearrange() method already had a recurse check, but it seemed to happen too late, so that the recursive calls kept happening from the ensureLayoutItemsUpdated() calls. This commit moves the recursion check up, so that it's actually executed before we have a chance to get to the next level of recursion. Pick-to: 5.15 6.0 Fixes: QTBUG-87253 Change-Id: I473ee219e7b5b13547e33ebbd3a6d884de2c7d45 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Merge the QtTest and Qt.test.qtestroot QML modulesUlf Hermann2021-01-1211-936/+12
| | | | | | | | | | There is no point in having them separate and this way the plugin can be optional. Fixes: QTBUG-89804 Change-Id: Ic7de35f6ee7abde4840841e17d21c2b709f6db7d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* CMake: Regenerate projects using pro2cmake one last timeAlexandru Croitor2020-12-101-3/+1
| | | | | | | | | And fix up some incorrect qmake project files Pick-to: 6.0 Change-Id: Ia6d27ac68195635021fe7c4a5f06386a60f3f323 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Mark url as builtin typeUlf Hermann2020-12-021-0/+6
| | | | | | | | | Also, allow conversion from UrlObject and String. We allow the string conversion because we treat string and url as interchangeable in various places. Change-Id: Ib229c6d190e1c5d849ea18798925965b8dbeef7e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* builtins.qmltypes: Rename varargs to QQmlV4FunctionUlf Hermann2020-12-011-9/+12
| | | | | | | This is how we express varargs in other places. Change-Id: I66c8aafa152e6c9880074d9c36a88f6ed9168633 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Adjust builtins.qmltypesUlf Hermann2020-12-011-1/+1
| | | | | | | | Math is not a singleton but a member of the JS global object. NumberPrototype is a value type. Change-Id: I03cba0864af91594690b577c74ad164767083d2a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Fix language according to clang-formatJerome Pasion2020-11-264-32/+29
| | | | | | | | | -clang-format complains after commits and this is the fixed version Task-number: QTBUG-88010 Change-Id: I6a1f0f79b528fd7acc2a52d928f4648867b422b9 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Remove version numbers for import statementJerome Pasion2020-11-267-13/+13
| | | | | | | | | | | -recommend using the import statement without versions for Qt 6.0 -update use of \qml snippet without \QtMinorVersion -some language change to be neutral about versions Task-number: QTBUG-87155 Pick-to: 6.0 6.0.0 Change-Id: I3ac44f93aab3086c1a49de79ecc677beb4ef9180 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Remove version numbers for import statementJerome Pasion2020-11-2410-20/+20
| | | | | | | | | | -recommend using the import statement without versions for Qt 6.0 -update use of \qml Task-number: QTBUG-87155 Pick-to: 6.0 6.0.0 Change-Id: I555d582a13006c5abb6dc1e0266d2987ba79c6d8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmltyperegistrar: Expose interface informationMaximilian Goldstein2020-11-231-0/+1
| | | | | Change-Id: Ica3f5c6696542921bc8d399cd46d901ba06f6d83 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* qmllint: Check qmltypes files in import path for validityUlf Hermann2020-11-221-0/+1
| | | | | | | | Now that we have a module describing the qmltypes format, we can run qmllint on qmltypes files. Change-Id: I23339e52b5081ecb6a2c3b127078389a2b8faab0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QmlCompiler: Fix resolution of method and property typesUlf Hermann2020-11-181-1/+6
| | | | | | | | | | | | | | | | We need to resolve the types for QML elements in two passes because only after finishing the parsing we have the QML-declared methods and properties available. We already need the base type before, though. Also, there can be multiple methods of the same name. We need API to access them. It also turns out that the internal name of the "var" type has to be QVariant in order to match reality. "var" properties and unnamed arguments to JS functions are implemented as QVariant. Change-Id: I541f11e96db72d832f4e4443d3a5d31079a56575 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add past major version 1 to QtQuick.tooling and 6 to its componentsUlf Hermann2020-11-162-1/+11
| | | | | | Change-Id: I09e29b85949eac270c6cee711408b8a09dea79a8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* Don't copy or assign QEvent instances in testsVolker Hilsheimer2020-11-161-11/+20
| | | | | | | | | | | | | | | Copying/assigning polymorphic types is a code smell, use separate instances instead in the tests. Those should perhaps be rewritten to use a data driven testing approach, there's a lot of code repetition. In the test API implementation, first evaluate the parameters for the event, then construct the event once with the correct values. Change-Id: I2572772698cb0204f5ff950741b9fe3805fae15d Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tooling: List the actual QML files in the qmake projectUlf Hermann2020-11-131-3/+8
| | | | | | Fixes: QTBUG-88471 Change-Id: Ifc023fdc82b728931ff88c0c634ad71e2b2995a2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add a module describing the qmltypes formatUlf Hermann2020-11-1213-1/+428
| | | | | | | | | | It's turtles all the way down. And now we can verify builtins.qmltypes using qmllint. Change-Id: I10c98ff8837c04838c3fd9803ef4ea0fd5d7bd0e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Change Quick.Window into a pure Qml moduleAlexandru Croitor2020-11-123-0/+53
| | | | | | | | | | | This fixes apps using Qt.Window with static Qt builds when deployed to a machine that doesn't have Qt installed. This will need a counterpart fix in qmake land. Change-Id: Ife11f9d1f1826e1188ef3dc3933af2f243860b6f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Change internal name of "var" type to QJSValueUlf Hermann2020-11-111-16/+17
| | | | | | | This is in line with what it's called in other qmltypes files. Change-Id: Ic2266cf5253c488cf93509548b4f2f26f2aae661 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use "QString" as internal name for string type in builtinsUlf Hermann2020-11-111-60/+60
| | | | | | | This fits the terminology in other qmltypes files. Change-Id: I4cce9c1f388eba79790d07dfee44a04600fda667 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* testlib: Don't misuse the Qt object for storing test resultsUlf Hermann2020-11-111-17/+15
| | | | | | | | | I'm pretty sure ".pragma library" works as intended by now. That comment was from 2011. Task-number: QTBUG-88372 Change-Id: I1f5baed221f7eebe62bb4b12940725d565b67793 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlListProperty: Use qsizetype rather than int for sizesUlf Hermann2020-11-094-13/+14
| | | | | | | | | | [ChangeLog][QtQml] The QQmlListProperty callback functions use qsizetype now as type for the size of a list. This is in line with the containers that you might use to back the list. Fixes: QTBUG-88269 Change-Id: Ia38403cb32f241e6c70e1a580dbeff1d6d694331 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Fix documentation warnings for QML Models and Test modulesTopi Reinio2020-11-052-2/+2
| | | | | | Fixes: QTBUG-88156 Change-Id: Ie9723f1bb612f4603d15455a0320cc01b27ff181 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Formalize declaration of varargs in builtins.qmltypesUlf Hermann2020-10-281-43/+19
| | | | | | | varargs are a special non-exported type. Change-Id: I2cd00d197ee5b4976e683cfe91dc0561a7186541 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Run builtins.qmltypes through qmlformatUlf Hermann2020-10-281-261/+1042
| | | | | Change-Id: I3ee4904cd3d492f71edee5f3b2bc9507df9810d4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Mark basic types as value types in builtins.qmltypesUlf Hermann2020-10-281-0/+5
| | | | | Change-Id: Ibb8c40a3d8af405926769b776807c9e2d47f061e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* builtins.qmltypes: Change real's internal name to "double"Ulf Hermann2020-10-281-79/+84
| | | | | | | | | It's called "double" everywhere else. We also have a "float" type in some places. Add that one. "double" still has an export called "real" as that is what you write in QML files. Change-Id: I4107e28c3441b9f829aca9abcbcbb8c5e3f8d327 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove duplicate property assignment from builtins.qmltypesUlf Hermann2020-10-271-1/+1
| | | | | | Change-Id: I0b96cc346ebf6580399f5379882f674073a89c21 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qml: Move more types into builtins.qmltypesMaximilian Goldstein2020-10-261-0/+36
| | | | | Change-Id: Id2795f16af99870f32266f81228890a9d12c86a7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix qdoc warning: document parameters correctlyVolker Hilsheimer2020-10-221-3/+3
| | | | | Change-Id: I04a2376908369df9cef5d1751797db39034668d3 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Compile with Clang11Lars Knoll2020-10-211-2/+2
| | | | | Change-Id: I9f3a4a6b6c7a2fbfca0a572209f398a23c26b37b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>