qt 错误记录

1. No tool chain set from kit “Desktop”.

打开qtcreator时出现上述错误,原因是qtcreator的编译器配置项没有找到可用的编译器,查看是否下载了可用的g++,如果下载了也detected不到,那就手动添加,添加完成后就行了。

2. make: arm-none-linux-gnueabi-g++: Command not found
/usr/local/Qt5.6-arm/bin/uic ../../PZJBY/MainWindow.ui -o ui_MainWindow.h
arm-none-linux-gnueabi-g++ -c -pipe -g -std=gnu++0x -Wall -W -D_REENTRANT -fPIC -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../PZJBY -I. -I/usr/local/Qt5.6-arm/include -I/usr/local/Qt5.6-arm/include/QtWidgets -I/usr/local/Qt5.6-arm/include/QtGui -I/usr/local/Qt5.6-arm/include/QtCore -I. -I. -I/home/anzyelay/Desktop/arm/tslib/mybuild/include -I/usr/local/Qt5.6-arm/mkspecs/linux-arm-gnueabi-g++ -o main.o ../../PZJBY/main.cpp
make: arm-none-linux-gnueabi-g++: Command not found
make: *** [main.o] Error 127
15:51:58: 进程"/usr/bin/make"退出,退出代码 2 。
Error while building/deploying project PZJBY (kit: nanopi)
When executing step "Make"

qmake 用到的mkspecs配置文件qmake.conf有问题,如果仅仅是编译器名字不对可以直接修改,不同平台编译时除了要指定相应的qmake,还要设置好QMAKESPEC宏,例如

针对arm-linux平台: export
QMAKESPEC=/usr/lib/qt4/mkspecs/qws/linux-arm-g++
针对x86-linux平台 export
QMAKESPEC=/usr/lib/qt4/mkspecs/qws/linux-g++-32

或者如下图直接指定配置文件
QMAKESPEC配置

3.QPainter::setPen: Painter not active

在画图设置画笔时显示如上错误,原因是QPainter对象还未激活,使用begin方法激活就可以了。帮助文档中有说明如下:

The isActive() function indicates whether the painter is active. A painter is activated by the begin() function and the constructor that takes a QPaintDevice argument. The end() function, and the destructor, deactivates it.

要么用begin()方法,要么在构造函数时赋一个绘图设备参数给QPainter才能active它。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值