我看了VoidRealm教程,他很容易包含QtGui并开始使用它!但我做同样的事情,它对我不起作用!例如我的代码在我包含QLabel之前不知道QWidget!或所有其他Gui元素......
#include <QApplication>
#include <QtGui>
#include <QtCore>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *win = new QWidget;
win->setWindowTitle("MBS");
QGridLayout *gLay = new QGridLayout;
QLabel *label1 = new QLabel("Name: ");
win->show();
return a.exec();
}
Run Code Online (Sandbox Code Playgroud)