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. Is it possible to use any QML Parser Tool?
QtWS25 Last Chance

Is it possible to use any QML Parser Tool?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
parserqmltoolsqt5
7 Posts 6 Posters 1.5k 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.
  • U Offline
    U Offline
    utkuf
    wrote on 28 Mar 2020, 08:10 last edited by
    #1

    Is it possible to use any QML Parser Tool in order to see how we should parse our Qml Application which has also use C++ libraries thanks to qmlRegisterType ???

    1 Reply Last reply
    1
    • J Offline
      J Offline
      joeal
      wrote on 28 Mar 2020, 09:03 last edited by joeal
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • U Offline
        U Offline
        utkuf
        wrote on 28 Mar 2020, 10:48 last edited by
        #3

        I do not tell about qml signall or c++ relationship. I would like to learn are there any qml parser tool which parse/split/divide all qml code with respect to dependencies of qml class/library etc.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 28 Mar 2020, 12:41 last edited by
          #4

          Hi
          I have not seen any such tools but you could roll your own using the parser from Qt
          https://code.woboq.org/qt5/qtdeclarative/src/qml/parser/

          1 Reply Last reply
          1
          • K Offline
            K Offline
            KH-219Design
            wrote on 30 Mar 2020, 16:45 last edited by
            #5

            Are you looking to do error-checking and error-prevention by ensuring (before "shipping" an application) that all your C++ types that should be registered are, indeed, actually properly registered?

            If that is your goal, then I commend you. I am interested in that topic as well.

            So far, I have been able to greatly increase detection of many such issues using a combination of:

            1. total ban on "qml warnings". (things that qml prints as "warnings" tend to be what I consider fatal bugs).
            2. launch the application during automated testing
            3. use automated scripts to scan the output of the launched application for any forbidden output such as "unregistered datatype" and "failed to load component"

            The ban on warnings that I mention in point (1) is achieved by installing (in C++) a Qt custom message handler to spy on all logged messages and abort if any messages are "warnings" emanating from a qml file: https://github.com/219-design/qt-qml-project-template-with-ci/blob/4d81552d77/src/app/qml_message_interceptor.cc#L44

            Launching the application during C.I. on a headless machine is done with Xvfb: https://github.com/219-design/qt-qml-project-template-with-ci/blob/4d81552d772c32b7d62edb4b4f0f678ca92bed4f/run_all_tests.sh#L50

            The warnings-ban could be used on any platform.

            The Xvfb automation, to my knowledge, would be limited to Linux applications. Therefore a parser-based detection system could be a more cross-platform portable solution.

            If you come up with a parsing-based solution, I'm sure that I and many other users that combine C++ with QML would be happy to try out your solution.

            www.219design.com
            Software | Electrical | Mechanical | Product Design

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mark12375
              Banned
              wrote on 4 Jan 2022, 15:59 last edited by mark12375
              #6
              This post is deleted!
              1 Reply Last reply
              0
              • J Offline
                J Offline
                james54515
                Banned
                wrote on 10 Oct 2022, 06:44 last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • K KH-219Design referenced this topic on 13 Nov 2023, 20:43
                • K KH-219Design referenced this topic on 27 Nov 2024, 17:49

                • Login

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