C++ 未定义GUI类型
我有一个很奇怪的问题,我真的想不出来。因此,我在头文件中创建了这个Box对象:C++ 未定义GUI类型,c++,user-interface,C++,User Interface,我有一个很奇怪的问题,我真的想不出来。因此,我在头文件中创建了这个Box对象: #ifndef BOX_H #define BOX_H class Box { public: Box(string newName); ~Box(); //... }; #endif // BOX_H #ifndef BOXTABLE_H #define BOXTABLE_H #include <QTableWidget> #include "box.h
#ifndef BOX_H
#define BOX_H
class Box
{
public:
Box(string newName);
~Box();
//...
};
#endif // BOX_H
#ifndef BOXTABLE_H
#define BOXTABLE_H
#include <QTableWidget>
#include "box.h"
class BoxTable : public QTableWidget
{
Q_OBJECT
public:
BoxTable(QWidget* parent = 0, int rows = 0);
~BoxTable();
void setBox(int row, Box* a); //here
//...
};
#endif // BOXTABLE_H
然后我在另一个头文件中有这个BoxTable类:
#ifndef BOX_H
#define BOX_H
class Box
{
public:
Box(string newName);
~Box();
//...
};
#endif // BOX_H
#ifndef BOXTABLE_H
#define BOXTABLE_H
#include <QTableWidget>
#include "box.h"
class BoxTable : public QTableWidget
{
Q_OBJECT
public:
BoxTable(QWidget* parent = 0, int rows = 0);
~BoxTable();
void setBox(int row, Box* a); //here
//...
};
#endif // BOXTABLE_H
对我来说,这一切都是正确的,但当我编译时,我得到了以下错误:
错误:“框”不是类型
在我在这里评论的那条线上
有人知道我做错了什么吗?
我真的很感激你的帮助。如果您需要更多详细信息,请询问。它不会抱怨上面的那行吗?通过预处理器运行它,看看到底发生了什么。这是一个错误,但它抱怨我现在删除了那行。运行预处理器?这对我来说是新鲜事,我该怎么做?你还在犯错误吗?你能提供你的IDE到底在说什么吗?