Qt5.5.1 transplantation (four): example demonstration

One: Environmental settings

After testing, it will crash after executing the Qt program after using nfs to start the file system, so the local file system is used to start and mount the server shared directory.

To use nfs for a stable connection, just change the nfs parameter to tcp connection.

1. Set the development board ip address and mount path

vi /etc/init.d/rcS

ifconfig eth0 192.168.1.103
mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.1.102:/home/jun/work/nfs/rootfs/mnt /mnt

2. Set up the Qt configuration environment

vi /etc/profile

export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0

export LD_PRELOAD=$TSLIB_ROOT/lib/libts.so
export QT_QPA_FB_TSLIB=1QT_QPA_FB_TSLIB=1

export QT_ROOT=/arm-qt
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/input/event1:edevmouse:/dev/input/event3
export QT_QPA_FONTDIR=/arm-qt/lib/fonts
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
export QT_PLUGIN_PATH=$QT_ROOT/plugins
export LD_LIBRARY_PATH=$QT_ROOT/lib:$QT_ROOT/plugins/platforms

3. Porting the Qt operating environment

Copy the compiled source code "arm-qt" directory in the first chapter of Qt transplantation to the rootfs that does not contain the Qt program.

Two: Qt example program

1. Create a project

 

2. Content design

(1) Double-click to open the ui file

(2) Add buttons and document boxes, and modify objectName and button names

(3) Slot function design

(4) Build execution file

Click the build button in the lower left corner to generate the file

(5) Copy the executable file to the development board and execute it

Guess you like

Origin blog.csdn.net/qq_34968572/article/details/105224943