Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Extending QtCreator's Syntax Highlighting with a Plugin
Forum Update on Monday, May 27th 2025

Extending QtCreator's Syntax Highlighting with a Plugin

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 4.2k 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.
  • G Offline
    G Offline
    Gary_
    wrote on last edited by
    #1

    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
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      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
      0
      • G Offline
        G Offline
        Gary_
        wrote on last edited by
        #3

        Perfect! Thanks!

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tobias.hunger
          wrote on last edited by
          #4

          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
          0

          • Login

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