aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmltyperegistrar/qmltyperegistrar.cpp
Commit message (Collapse)AuthorAgeFilesLines
* qmltyperegistrar: Follow the private includes setting in qmltypesUlf Hermann2020-04-061-8/+10
| | | | | | | | | | | | If the file names need to be prepended with "private/" in order to be usable, that also holds for other tools that want to use them. Therefore, also add the prefix to the qmltypes files. We won't have a chance to figure this out again at a later point. Furthermore, don't add file entries for types we cannot register anyway. Change-Id: If04297db419e364f472b8ec627c599c0cbb4ffd9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltyperegistrar: Record header file names in qmltypes filesUlf Hermann2020-03-301-3/+9
| | | | | | | We will need them to find the types in C++ code. Change-Id: Id00c6d855adbb767a0be8a9469fbe47447ccec8b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qmltyperegistrar: Accept more file extensions as headersUlf Hermann2020-03-301-8/+11
| | | | | | | | Also, even if the file does not appear to be a header, still try to include it. People use strange file names. Change-Id: I2db7bd6aa14007a8b458c3860ba0553bb3b384b7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltyperegistrar: Mark non-QObject types as uncreatableUlf Hermann2020-03-021-6/+15
| | | | | | | | | | qmlplugindump does so, and in fact they are uncreatable. Also, make qmlTypeRegistrationMode() more robust. Each classDef should really either be an object, a gadget, or a namespace. Change-Id: If39bbbf6f9a4fdb269d095ca10d60ad5d87ca62d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Provide a way to statically register namespacesUlf Hermann2020-02-251-8/+30
| | | | | | | | | | | | | | | | | Previously, qmltyperegistrar would stumble over any QML_* macros in namespaces, as the namespaces could not be used as template arguments. However, namespaces are intended to be usable by QML as uncreatable "types". Now, qmltyperegistrar checks the namespace flag that moc records in the JSON output, and if that is given, registers an uncreatable metaobject instead of a type. Therefore you can use QML_ELEMENT and friends to register namespaces, just like you would register classes (except that they're implicitly uncreatable, of course). Task-number: QTBUG-68796 Change-Id: I186d7e9425471c32fb1a1f29c0c0b946afb2a9d2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltyperegistrar: Improve formatting of includesUlf Hermann2020-01-071-2/+6
| | | | | | | | We always need qqml.h and qqmlmoduleregistration.h. Put those in front and sort and deduplicate the module-dependent imports. Change-Id: Idae435939e7a69dd706c928b01b159334c21cff1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmltyperegistrar: Fix command line optionsUlf Hermann2019-12-241-12/+19
| | | | | | | | | | | The descriptions were badly formatted, we assumed plugins.qmltypes even though we can also generate app.qmltypes and lib.qmltypes, and the --generate-qmltypes option specifies a file name, not a directory. Change-Id: Ia611198555c994ac5f5cb1ceb399fb4fc2ed780b Fixes: QTBUG-80895 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Move qmltyperegistrar into srcUlf Hermann2019-11-081-0/+410
We want it to be available early in the build process. qmltyperegistrar will be required to build qml, quick, and various imports. Change-Id: I15b827cd4b322a2bcea2780eeedb8dbe132aa59a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>