Skip to content
  • 0 Votes
    4 Posts
    532 Views
    aha_1980A

    Hi @magartor,

    thanks for the feedback. So please mark this topic as SOLVED. Thanks!

  • 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
    15 Posts
    19k Views
    danttiD

    @cochise said in Is there a clear way to parse HTML in Qt 5.7:

    https://github.com/cutelyst/html-qt

    This is a bit of an old thread but as @cochise said html-qt is an HTML parser, sadly I didn't finish it yet but it follows WHATWG specification on how to implement an HTML parser as HTML is not XML. It's mostly complete but outputting a DOM tree isn't ready yet, so help is welcome.

  • 0 Votes
    12 Posts
    2k Views
    IMAN4KI

    @Devopia53
    Excellent answer :)

    Not recommended...

    Yeah know it and i make these files local in my project (not include from <private/qcssparser_p.h>):
    qcssscanner.cpp
    qcssparser_p.h
    qcssparser.cpp

    Thank you

  • 0 Votes
    14 Posts
    3k Views
    IMAN4KI

    @raven-worx
    Oh..
    Sorry i think that was qt-bug (getter return invalid) but now it's work

    For last question !
    Could i use qcssparser_p.h for retrieving values for my purpose ? (i'm a lover of parsing :) )
    Thanks.