如何在qt中使用静态变量?
我试过了:
#ifndef TEST_H
#define TEST_H
#include <QObject>
class Test : public QObject
{
Q_OBJECT
public:
explicit Test(QObject *parent = 0);
static int a;
signals:
public slots:
};
#endif // TEST_H
但我无法读取数据。
int b = Test::a;