Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. qmllint and Python modules
Forum Updated to NodeBB v4.3 + New Features

qmllint and Python modules

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 431 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vincent B
    wrote on last edited by Vincent B
    #1

    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

    F 1 Reply Last reply
    0
    • V Vincent B

      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

      F Offline
      F Offline
      friedemannkleint
      wrote on last edited by friedemannkleint
      #2

      @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.

      V 1 Reply Last reply
      1
      • F friedemannkleint

        @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.

        V Offline
        V Offline
        Vincent B
        wrote on last edited by
        #3

        @friedemannkleint Thank you for your support, it works.

        1 Reply Last reply
        0
        • SGaistS SGaist has marked this topic as solved on

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved