是不是哪里错了,痛苦至极,贴上代码,麻烦神鉴!
#include <QMainWindow>
//#include <QStandardItemModel>//最终都是指向同一个头文件
#include <QStandardItem>
class QStandardItemModel;
class QStandardItem;
-----------------------------
QStandardItemModel *projectModel = new QStandardItemModel();
projectModel->setHorizontalHeaderItem(0,new QStandardItem("项目名称"));
QStandardItem *default = new QStandardItem("南昌城管");
projectModel->setItem(0,0,default);
-----------------------------
mainwindow.cpp:47: error: expected unqualified-id before 'default'
mainwindow.cpp:47: error: expected initializer before 'default'
mainwindow.cpp:49: error: expected primary-expression before 'default'
mainwindow.cpp:75: error: expected primary-expression before 'default'
------解决方案--------------------
//#include <QStandardItemModel>//最终都是指向同一个头文件
去掉注释符号