在ubuntu下装了QT 5后打开之前在windows做的工程,编译出错就是下面这句
connect(clientSocket,&QTcpSocket::readyRead,this,&Monitor::clientReadMessage); //ubuntu下这句会报错
百度搜了很多都找不到原因,最后搜关键词qt is protected让我找到了这个
https://stackoverflow.com/questions/30151127/error-qactiontriggered-is-protected-cannot-connect-a-signal
网站加载比较慢,这里是截图,他的问题也是下面这句报错
找到原因就是Qt 4和Qt 5 connect()的语法不同
https://blog.csdn.net/aidansen/article/details/79008359?utm_source=blogxgwz3
改为Qt 4 的SIGAL和SLOT就解决了,不过我查了qt的版本
版本是qt 5,不过为什么用qt 5的调用语法反而会报错
找到原因了,qt 工具->选项,下图构建套件选择的qt版本是qt4, 所以编译时按qt4的语法来
https://blog.csdn.net/libaineu2004/article/details/19245205
在main.cpp里面加入下面语句,解决
#include
QTextCodec *codec = QTextCodec::codecForName("UTF-8");//情况2
QTextCodec::setCodecForTr(codec);
QTextCodec::setCodecForLocale(codec);
QTextCodec::setCodecForCStrings(codec);
https://blog.csdn.net/linda_ds/article/details/70243423
locate libGL.so
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
sudo ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 /usr/lib/libGL.so
https://www.cnblogs.com/findumars/p/4926687.html
cd /opt/qt59/plugins/platforminputcontexts
cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so .
chmod +x libfcitxplatforminputcontextplugin.so
(5)B使用A类的ui成员时,出现如下错误
error: invalid use of incomplete type ‘class
要在A类的头文件包含“ui_A.h”,同时Ui::A *ui 要声明成public
setGeometry: Unable to set geometry 800x800+8+30 on QWidgetWindow/‘MainWindowWindow’. Resulting geometry: 800x750+8+30 (frame: 8, 30, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 12x30, maximum size: 16777215x16777215).
添加下面这行代码解决
setWindowFlags(Qt::WindowCloseButtonHint | Qt::MSWindowsFixedSizeDialogHint);
Qt:Error:No rule to make target ’ … /…/??.png’,needed by ‘debug/qrc_resource.cpp’
https://blog.csdn.net/weixin_38815609/article/details/89401190
https://blog.csdn.net/qinpanke/article/details/8066397
https://blog.csdn.net/qq_23301703/article/details/79647040
选择项目,将项目中的 Show build 选项去除调