Problem estimating Qt Slot as Error in Cppcheck Analysis

283 Views Asked by At

While performing static analysis with Cppcheck, the corresponding error message was printed in the slots part, but I don't know how to solve this part. Can you help me?

err_msg : There is an unknown macro here somewhere. Configuration is required. If slots is a macro then please configure it.

#ifndef A_H
#define A_H

#include "BasePopup.hpp"

namespace Ui {
class A;
}

class A: public BasePopup
{
    Q_OBJECT

public:
    A();
    ~A();
    ...
protected:
    ...

private:
    ...

signals:
    ...

private slots: // err_msg
    ...
};

#endif // A_H

Compilation and build work well without any problems, but only considered errors in Cppcheck static analysis.

  • For your information, I'm working on "visual studio code".
1

There are 1 best solutions below

0
273K On BEST ANSWER

If you run cppcheck command line tool, run it with the command line parameter

--library=qt

If you run cppcheck in Qt Creator, no extra actions are needed.