Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to use QT Creator code parser to parse .h or .cpp files?
Forum Updated to NodeBB v4.3 + New Features

How to use QT Creator code parser to parse .h or .cpp files?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 2 Posters 994 Views 1 Watching
  • 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.
  • vlad.vesaV Offline
    vlad.vesaV Offline
    vlad.vesa
    wrote on last edited by
    #1

    Hi,

    I'm trying to build a plugin for qt creator that generates "implementation" for an interface provided by third party.
    Basically there is a collection of .h files that the plugin has to parse and based on the classes defined in those interfaces the plugin should create .cpp files with the classes names and give dummy implementation of the methods specified in that interface.

    I saw that qt creator is using a rock solid code parser in terms of parsing files and determine what symbols (variables, methods ....) are present in a file (.h or .cpp).

    I'm wondering how can I connect to that parser and trigger parsing of a file at a specified path.

    If someone here could give me some help I'll really appreciate it.

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Not a direct answer but you should take a look at Qt Creator's ClangCodeModel plugin, that might give you hints to get started.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • vlad.vesaV Offline
        vlad.vesaV Offline
        vlad.vesa
        wrote on last edited by
        #3

        thanks, will try to see if I can get something out of that plugin. :)

        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