qmllint and Python modules
-
Using PySide6, I have a Qt Python module that I register to the app using either the qmlRegisterType(...) or the engine.rootContext().setContextProperty(...) syntax.
The application works as expected.
pyside6-qmllint complains about the use of such modules because their slots and signals are unknown (defined in Python).
qmllint message is:
<module> was not found. Did you add all import paths? [import]How can I make qmllint aware of components defined in Python?
Note: I can generate meta object information from Python using pyside6-metaobjectdump but it seems that resulting json file cannot be fed to qmllint.
Vincent
-
Using PySide6, I have a Qt Python module that I register to the app using either the qmlRegisterType(...) or the engine.rootContext().setContextProperty(...) syntax.
The application works as expected.
pyside6-qmllint complains about the use of such modules because their slots and signals are unknown (defined in Python).
qmllint message is:
<module> was not found. Did you add all import paths? [import]How can I make qmllint aware of components defined in Python?
Note: I can generate meta object information from Python using pyside6-metaobjectdump but it seems that resulting json file cannot be fed to qmllint.
Vincent
@Vincent-B We recommend using modern decorators like @QmlElement, see https://doc.qt.io/qtforpython-6/tutorials/qmlintegration/qmlintegration.html , https://doc.qt.io/qtforpython-6/PySide6/QtQml/QmlElement.html . Then, you use pyside6-project, you can use its qmllint command to check.
-
@Vincent-B We recommend using modern decorators like @QmlElement, see https://doc.qt.io/qtforpython-6/tutorials/qmlintegration/qmlintegration.html , https://doc.qt.io/qtforpython-6/PySide6/QtQml/QmlElement.html . Then, you use pyside6-project, you can use its qmllint command to check.
@friedemannkleint Thank you for your support, it works.
-
S SGaist has marked this topic as solved on