我在学习qt学习之路第十七章Qt学习之路第17篇 标准对话框 文件对话框,下面链接这节时遇到了这个报错。
error C2143: 语法错误 : 缺少“;”(在“*”的前面) error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
查找很多说是什么头文件重复包含之类的。
http://www.qter.org/thread-638-1-1.html
各种调试尝试后,将mainwindows.cpp中包含的头文件#include<QTextEdit>放到了mainwindows.h中,然后就好了。。。
上代码
///这是mainwindows.cpp
#include "mainwindows.h"
#include<QAction>
#include<QMenuBar>
#include<QToolBar>
//#include<QTextEdit>
#include<QMessageBox>
#include<QFileDialog>
#include<qdebug.h>
mainWindows::mainWindows(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
setWindowTitle(tr("main Window"));
openAction = new QAction(QIcon(":mainWindows/Resources/open.png"),tr("&open..."),this);
openAction -> setShortcuts(QKeySequ