Skip to content
QtWS25 Call for Papers
  • 0 Votes
    1 Posts
    201 Views
    No one has replied
  • 1 Votes
    7 Posts
    1k Views
    KH-219DesignK

    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:

    total ban on "qml warnings". (things that qml prints as "warnings" tend to be what I consider fatal bugs). launch the application during automated testing 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.

  • 0 Votes
    7 Posts
    2k Views
    SGaistS

    What kind of text do you have that might be big enough to become a problem for your UI ?

  • 0 Votes
    2 Posts
    1k Views
    D

    I was able to fix the problem by adding this to the qmake.conf file for the device:

    QMAKE_INCDIR_QT += $$[QT_INSTALL_HEADERS]

  • 0 Votes
    4 Posts
    1k Views
    Sh1gsS

    @raven-worx

    Yes, this is exactly what I was looking for. I didn't realize there was an example on it, silly mistake on my part. Thank you very much!

  • 0 Votes
    3 Posts
    1k Views
    M

    @jsulm You're right. I don't know why I didn't think of that

    I filled in a bug report regarding this issue here: https://bugreports.qt.io/browse/QTBUG-51728