QT_QML_SINGLETON_TYPE

Indica che un file QML fornisce un tipo singleton.

Questa proprietà è stata introdotta in Qt 6.2.

Un file ` .qml ` che fornisce un tipo singleton deve avere la proprietà ` QT_QML_SINGLETON_TYPE ` impostata su ` TRUE ` per garantire che il comando singleton venga scritto nel file `qmldir `. Ciò deve essere fatto in aggiunta al file QML contenente l'istruzione ` pragma Singleton `. La proprietà `source` deve essere impostata prima di creare il modulo a cui appartiene il singleton.

Vedere qt_target_qml_sources() per un esempio su come impostare la proprietà QT_QML_SINGLETON_TYPE.

Vedi anche qt_target_qml_sources.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.