QT 5.6转 QT 4.8问题总结

1.

/root/Desktop/hero/MyTCPServer-build-desktop/../MyTCPServer/ui_tcpserverwindow.h:13: error: QtWidgets/QAction: No such file or directory

将QtWidgets换成QtGui

2.

/root/Desktop/ hero/MyTCPServer-build-desktop/../MyTCPServer/tcpserverwindow.cpp:96: error: ‘class QHeaderView’ has no member named ‘setSectionResizeMode’

TableView之中的问题:
QT5.x之后将setResizeMode改成了 setSectionResizeMode所以讲Section去掉即可

3.

/root/Desktop/hero/MyTCPServer-build-desktop/../MyTCPServer/tcpserverwindow.cpp:146: error: ‘itoa’ was not declared in this scope

itoa并非标准类库,将其换成sprintf(tmp,”%d”,i+1); 用sprintf即可

4.

/root/Desktop/hero/MyTCPServer-build-desktop/../MyTCPServer/ui_tcpserverwindow.h:57: error: ‘QStringLiteral’ was not declared in this scope

问题出在TCPServerWindow->setObjectName(QStringLiteral(“TCPServerWindow”));这句话
QT 4.8 setObjectName 没有QStringLiteral这个 形参是QSTring 所以去掉这个QStringLiteral即可

5.

/root/Desktop/hero/MyTCPServer-build-desktop/../MyTCPServer/mytcpsocket.cpp:19: error: ‘Qt_5_6’ is not a member of ‘QDataStream’

当然Qt4.8怎么会有5.6 改成4.8以下即可

5.之前怎样配置的的编译环境尽量与之前一样。要不会出现与错误提示不和的错误。
比如说出现了如下的空指针异常,其实只是编译环境不同找不到文件。
Signal received
The inferior stopped because it received a signal from the Operating System.
Signal name : SIGSEGV
Signal meaning : Segmentation fault
这是错误说明程序中有空指针,断点以下很容易找出错误所在!!!!

你可能感兴趣的:(QT,笔记,Linux,笔记)