Qt移植到ARM64-v8平台(NXP i.MX8M)笔记
超详细Qt5.9.5移植攻略,拿走不谢
全志a64平台 arm 64位 tslib 和 qt库的小白移植
Qt移植:Ubuntu16.04 交叉编译qt5.9.6详细教程
Linux编译移植Qt5的环境_Xillinx的ZYNQ平台
Qt5.8与触摸Tslib-1.4库ARM-ZYNQ平台的移植(一)
Qt5.9+tslib1.4移植
tslib-1.4的安装与移植
解决TSLIB无法识别触摸屏的问题
Qt下载(多种下载通道+所有版本)
【转】基于Qt, TUIO和TSLIB的嵌入式Linux下的多点触摸设计
交叉编译Qt5.2.1让其支持触摸屏多点触摸
Qt5.2.1交叉编译,带tslib插件
Qt5.3.0的移植安装与测试(交叉编译,用于arm,支持tslib触摸屏)
QT5移植嵌入式触摸屏,点击位置和显示位置不对解决方法
qt多点触控
[转]ARM QT实现多点触摸
Qt源码编译configure配置参数
Enable QT developement for i.MX6UL
zcu102_A_PetaLinux运行Qt程序
IMX6Q-Yocto手工交叉编译QT5
i.MX6 Yocto QT5环境搭建流程
iMX6 yocto平台QT交叉编译环境搭建
iMX6 QT5交叉编译环境搭建for Yocto
QT支持多点触控的办法 [问题点数:50分]
Qt QWidget实现手势缩放和平移(二)
xilinx ug1209
QT5.5移植到ARM全攻略
Qt for Embedded Linux
i.mx6q 移植Qt5.6.1(含opengl)
在Hi3531上运行QT, 并对 mpp/sample/hifb/sample_hifb.c 修改
海思Hi3536移植QT5.9.8教程
海思3536:交叉编译Qt4.8.4
海思3519A 移植 Qt 5.5.1
tslib Github
Qt5.9.8源码下载
libiconv
Qt国内镜像网站,Qt官网登不上的时候选择镜像,清华大学的比较好,Linux不要下载*.zip
格式的源码包,文本格式和unix不兼容。
编译,以zynqmp为例,tslib-1.20,
make clean
./configure --host=aarch64-linux-gnu --prefix=$cur_path/zynqmp-$PETALINUX_VER
make
make install
tslib只支持单点触摸,多点触摸屏需要修改数据上报部分,所以建议电容屏就不使用tslib,免得麻烦,Qt5不在一定需要tslib。
因为Qt5.9.8支持C++11,所以编译器版本需要高于4.8以上,Xilinx Petalinux2015.2.1的GCC版本为4.9,支持,这里可以看到Qt对arm和arm64的支持,但是已经不支持powpc平台,所以T2080需要自己写mkspecs了,QorIQ-SDK-V2.0-20160527-yocto工具链的gcc版本4.9,理论上支持Qt5.9.8,arm的qmake.conf针对工具链修改,aarch64的默认的就是对的,
zc@ubuntu:~/fdk_develop/package/qt-everywhere-opensource-src-5.9.8$ ls -l qtbase/mkspecs/
total 252
...
drwxrwxr-x 2 zc zc 4096 Apr 9 04:52 linux-aarch64-gnu-g++
drwxrwxr-x 2 zc zc 4096 Apr 9 04:52 linux-arm-gnueabi-g++
...
zc@ubuntu:~/fdk_develop/package/qt-everywhere-opensource-src-5.9.8$ ls -l qtbase/mkspecs/linux-arm-gnueabi-g++/
total 8
-rw-rw-r-- 1 zc zc 766 Apr 9 04:52 qmake.conf
-rw-rw-r-- 1 zc zc 1998 Apr 9 04:52 qplatformdefs.h
zc@ubuntu:~/fdk_develop/package/qt-everywhere-opensource-src-5.9.8$ ls -l qtbase/mkspecs/linux-aarch64-gnu-g++/
total 8
-rw-rw-r-- 1 zc zc 766 Apr 9 04:52 qmake.conf
-rw-rw-r-- 1 zc zc 1998 Apr 9 04:52 qplatformdefs.h
编译,关于rpath,参考-L、-rpath和-rpath-link的区别,-mtdev
和-xinput2
选项,在help中可以找到这两个选项。mtdev包含了应用程序对多点触摸协议的支持,xinput2实现了Linux的输入子系统对多点触摸的支持。
make clean
./configure -prefix $cur_path/zynq-$PETALINUX_VER -opensource -release -pch -confirm-license -xplatform linux-arm-gnueabi-g++ -shared -iconv -qt-libpng -qt-libjpeg -no-opengl -no-cups -no-glib -no-dbus -no-rpath -no-sse2 -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 -no-avx -no-openssl
make -j4
make install
若要添加对tslib的支持?
-tslib \
-I tslib_install/include \
-L tslib_install/lib
可能会出现安装失败的情况,这不是错误,直接再编译目录下重新执行命令,可能是编译arm平台的qt有残留,所以编译失败,
$ cd qtmultimedia/
$ make clean && make -j8 && make install
$ cd qtlocation/
$ make clean && make -j8 && make install
$ make install
petalinux2018.2的gcc版本7.2.1,这个版本编译不过,大家还是不要挣扎了,用petalinux2018.3的gcc版本7.3.1
In file included from items/qquickitem_p.h:64:0,
from items/qquickwindow.cpp:45:
items/qquickclipnode_p.h:57:30: error: comdat-local function called by void QQuickWindowIncubationController::incubate() outside its comdat
class Q_QUICK_PRIVATE_EXPORT QQuickDefaultClipNode : public QSGClipNode
^~~~~~~~~~~~~~~~~~~~~
_ZN32QQuickWindowIncubationController28incubatingObjectCountChangedEi.part.85/24483 (virtual void QQuickWindowIncubationController::incubatingObjectCountChanged(int)) @0x1007aba7b0
Type: function definition analyzed
Visibility: comdat_group:_ZN32QQuickWindowIncubationController28incubatingObjectCountChangedEi artificial
Same comdat group as: _ZN32QQuickWindowIncubationController28incubatingObjectCountChangedEi/16405
References:
Referring:
Availability: local
First run: 1
Function flags: body local icf_merged split_part
Called by: _ZN32QQuickWindowIncubationController8incubateEv.part.86/24484 (1.00 per call) _ZN32QQuickWindowIncubationController28incubatingObjectCountChangedEi/16405 (0.24 per call)
Calls: _ZN7QObject10startTimerEiN2Qt9TimerTypeE/23783 (0.37 per call)
items/qquickclipnode_p.h:57:30: internal compiler error: verify_cgraph_node failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.linaro.org> for instructions.
Makefile:67514: recipe for target '.obj/qquickwindow.o' failed
make[3]: *** [.obj/qquickwindow.o] Error 1
make[3]: Leaving directory '/home/qe/program/qt-everywhere-opensource-src-5.9.6/qtdeclarative/src/quick'
Makefile:118: recipe for target 'sub-quick-install_subtargets-ordered' failed
make[2]: *** [sub-quick-install_subtargets-ordered] Error 2
make[2]: Leaving directory '/home/qe/program/qt-everywhere-opensource-src-5.9.6/qtdeclarative/src'
Makefile:59: recipe for target 'sub-src-install_subtargets' failed
make[1]: *** [sub-src-install_subtargets] Error 2
make[1]: Leaving directory '/home/qe/program/qt-everywhere-opensource-src-5.9.6/qtdeclarative'
Makefile:346: recipe for target 'module-qtdeclarative-install_subtargets' failed
make: *** [module-qtdeclarative-install_subtargets] Error 2
海思平台的fb使用需要先初始化mpp框架,首先在load3531.sh
中需要配置显存,
insmod hifb.ko video="hifb:vram0_size:20000,vram1_size:7200,vram2_size:3240,vram3_size:3240,\
vram4_size:7200,vram5_size:128,vram6_size:128" softcursor="off" u32VcmpBufNum=2\
apszLayerMmzNames="mmzname0","mmzname1",,"graphics",,"mmzname0"
参考sample_hifb.c
文件,打开HDMI接口,设置屏幕分辨率、屏幕起始坐标。程序运行后会自动结束,添加如下代码使程序在后台一直运行,然后在后台运行sample_hifb
程序,再运行Qt 程序。
if (pstInfo->ctrlkey == 0)
{
while(1)
sleep(5);
}
hifb叠加可以将qt的GUI与海思的MPI分离,在视频层上叠加上图形层,需要修改linuxfb,再设置QT界面透明显示,
(1) 修改qt-everywhere-opensource-src-5.5.1/qtbase/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
for (int i = 0; i < rects.size(); i++)
{
// -
//mBlitter->drawImage(rects[i], *mScreenImage, rects[i]);
// +
mBlitter->setCompositionMode(QPainter::CompositionMode_Source);
mBlitter->drawImage(rects[i], *mScreenImage, rects[i]);
mBlitter->setCompositionMode(QPainter::CompositionMode_SourceOver);
}
(2) 修改qtbase\src\platformsupport\fbconvenience\qfbscreen.cpp
// -
//mCompositePainter->fillRect(rect, Qt::black);
//+
mCompositePainter->setCompositionMode(QPainter::CompositionMode_Source);
mCompositePainter->fillRect(rect, Qt::transparent);
mCompositePainter->setCompositionMode(QPainter::CompositionMode_SourceOver);
(3) 修改qt程序
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setWindowFlags(Qt::CustomizeWindowHint);
}
海思平台可能会出现安装失败的情况,可能是编译其他平台有残留,
$ cd qtimageformats/src/plugins/imageformats/tiff/
$ make clean && make -j8 && make install
$ cd qtimageformats/src/plugins/imageformats/webp/
$ make clean && make -j8 && make install
$ cd qtmultimedia/
$ make clean && make -j8 && make install
$ cd qtlocation/
$ make clean && make -j8 && make install
$ make install
添加qmake到环境变量,
export QTDIR=$cur_path/zynq-$PETALINUX_VER:$QTEDIR
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
qmake
make
tslib配置,
export TSLIB_ROOT=/home/root/ui/tslib
export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_CONSOLEDEVICE=none
export LD_LIBRARY_PATH=$TSLIB_ROOT/lib:$LD_LIBRARY_PATH
qt配置,
export QTDIR=/home/root/ui/qt
export QT_QPA_FONTDIR=$QTDIR/lib/fonts
export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins/
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0
# qt5 without tslib
export QWS_MOUSE_PROTO=/dev/input/event0
# qt with tslib
export QWS_MOUSE_PROTO=tslib:/dev/input/event0
# or (qt with tslib)
export QT_QPA_GENERIC_PLUGINS=tslib