QT在头文件定义结构体,在cpp文件报错was not declared in this scope
头文件
class MainWindow : public QMainWindow
{
Q_OBJECT
typedef struct _UserInfo
//struct UserInfo
{
QString id;
QString name;
} UserInfo;
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
cpp文件中:
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
bool dbOK = false;
UserInfo userInfo;
最后一行UserInfo userInfo处报错:error: 'useInfo' was not declared in this scope
请教各位