Menu

How to disable/ignore Qt/Q_OBJECT related noise

Dan-42
2020-11-10
2021-01-20
  • Dan-42

    Dan-42 - 2020-11-10

    Hi Daniel,

    so I was finally able to introduce cppcheck to my sw-team.

    One thing that is bugging me, is on how can I disable/ignore these Q_OBJECT related noise.
    I do already invoke cppcheck with --library=qt.

    But I also run cppcheck with the compile_comands.json.

    here is the full command:

    cppcheck.exe --library=windows --library=qt --library=opencv2 --library=boost --project=./compile_commands.json --suppress=*:*libs_external* --suppress=*:*Qt* --suppress=*:*\\nsfqt\\com\\* --enable=all -j 32  -D_MSC_VER=1925 -DWIN32 -D_WIN32=1 -D_WIN64=1 -D__amd64 > ./cppcheck-console-output.txt
    

    And here an example of the "noise".
    Every file being a QObject has a Q_OBJECT macro defined, which yields this kind of messages

    widget_image_area_qt.hpp:45:3: note: Function in derived class
      Q_OBJECT
      ^
    widget_image_area_qt.hpp:45:3: style: The function 'qt_metacall' overrides a function in a base class but is not marked with a 'override' specifier. [missingOverride]
      Q_OBJECT
      ^
    
     
  • Daniel Marjamäki

    It's hard to say. I have the feeling that you somehow get internal Qt code in your analysis.

    I do not get such warnings when I check our GUI code and that is based on Qt.

     
  • Dan-42

    Dan-42 - 2020-11-10

    Alright thank you.
    But this might give me already an angle to investigate.

    I'll update this thread if I have any news.

     
  • Dan-42

    Dan-42 - 2021-01-20

    Hi Daniel,

    so I updated to version 2.3 and my issues are gone.
    Without looking into the reason why, I'm very happy :-) thank you

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.