回复: Qt学习:GridArrayQt 生成LED屏幕数组
#6 回 jx347638458 的帖子 [yehuohan 04-11 09:21]
jx347638458:..\GridArrayQt\GridArrayQt.cpp:618:2: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]
bool *gp = nullptr;
^
..\GridArrayQt\GridArrayQt.cpp: In member function 'void GridArrayQt::createDrawArea()':
.. .. (2016-04-11 08:41)
vs2013支持c++11,程序里面的nullptrlamda表达式这些都要c++才行,你的mingw 的时候要加一个参数,-std=c++11
#7 回 jx347638458 的帖子 [yehuohan 04-11 09:22]
jx347638458:..\GridArrayQt\GridArrayQt.cpp:618:2: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]
bool *gp = nullptr;
^
..\GridArrayQt\GridArrayQt.cpp: In member function 'void GridArrayQt::createDrawArea()':
.. .. (2016-04-11 08:41)
你用的qtcreator打开的??
#8 回 jx347638458 的帖子 [realfan 04-11 09:40]
jx347638458:刘大师您编译成功了么,我的有很多错误 (2016-04-10 14:27)
稍做修改,就可以了。如果用QtCreator打开,需要在pro中加CONFIG += c++11
要把qtextctrl.h qtextctrl.cpp两个文件加到工程中,加到GridArrayQt.pri文件中也可以
HEADERS += ./GridArrayQt.h \
./QDrawArea.h \
./common.h \
./qtextctrl.h
SOURCES += ./QDrawArea.cpp \
./GridArrayQt.cpp \
./main.cpp \
./qtextctrl.cpp
QDrawArea类的setPointCursor改成如下形式
void setPointCursor(const QPointCursor & pc, const QCursor &c)
QTextCtrl类的第二个构造函数改成
QTextCtrl(const QRect &rect, QWidget *parent = 0)
应该就可以了。
如果有必要,所有代码文件编码改成UTF8
#9 回 realfan 的帖子 [yehuohan 04-11 09:44]
realfan:稍做修改,就可以了。如果用QtCreator打开,需要在pro中加CONFIG += c++11
要把qtextctrl.h qtextctrl.cpp两个文件加到工程中,加到GridArrayQt.pri文件中也可以
HEADERS += ./GridArrayQt.h \
./QDrawArea.h \
....... (2016-04-11 09:40)
win下我用vs+qt的qtcreator没试过
#10 [jx347638458 04-11 09:56]
大神讲的太详细了,感谢感谢