Custom Compilerwarnings in QML



  • Hello Experts,

    Iám working on a big Projekt using QML and QtQuick.
    On other Projects and other Languages, I had the possibillity to throw custom compiler warnings to mark some code for refactoring, depreciated, untested etc. Compiling the code, this warnings appears.
    Is there any possibility to do this also in QML?


  • Moderators

    @xela
    not that i am aware of.
    Also doesn't make much sense, since in general QML is not compiled (to be correct it is compiled when it is needed - JIT)

    You can use console.warning() to throw a runtime message though.



  • In this case, it really do not make sense.
    So I have to stay with my solution. I marked with Comments like "//@Refactoring needed" and have to search the whole qml files for this phrases.
    Not the best but at the moment under this circumstances the best one for me...

    Anyway, thank you"!



  • Qt Creator can show you comments beginning with TODO, FIXME, NOTE, BUG or WARNING in the "To-Do Entries" bottom panel :
    Qt Creator To-Do Entries



  • @GrecKo Exactly what I needed. I hat to activate this ToDo under Help->Plugins.
    This helps me so much, thank you very much and have a great day!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.