Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Extending QtCreator's Syntax Highlighting with a Plugin

    QML and Qt Quick
    3
    4
    3942
    Loading More Posts
    • 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.
    • G
      Gary_ last edited by

      Is it possible to extend the Syntax Highlighting and Intellisense in QtCreator to accept QML Extensions through Plugins?

      For example, I create a plugin that registers a new Component Type: Cat. Cat has the property legs.

      @
      Item {
      Cat {
      id: ilean
      legs: 2
      }
      }
      @

      Cat will be underlined in Red showing the IDE developer that Cat is illegal. And intellisense will not pick up legs as an accepted property.

      Is it currently possible to extend the syntax definitions?

      1 Reply Last reply Reply Quote 0
      • M
        mbrasser last edited by

        Hi,

        I believe the information comes from the xml files in the qml-type-descriptions folder (in the creator source tree located at src/share/qtcreator/qml-type-descriptions), which are generated using the qmldump tool (src/tools/qml/qmldump). You could try generating a similar file for your plugin.

        Michael

        1 Reply Last reply Reply Quote 0
        • G
          Gary_ last edited by

          Perfect! Thanks!

          1 Reply Last reply Reply Quote 0
          • T
            tobias.hunger last edited by

            Have you tried using a snapshot of Qt Creator? The QML handling has seen much work, maybe that already works there already (I think it does, but I am not 100% sure).

            1 Reply Last reply Reply Quote 0
            • First post
              Last post