嵌入式裝置(T507)執行qml程式提示module is not installed

yu_chun_de_ren_lei發表於2024-04-11

T507裝置中執行qml編寫的程式,提示module未安裝,如下圖。

這是因為程式執行時未找到QML庫導致的,需要在qtenv.sh檔案或者系統環境變數中匯出QML庫在嵌入式裝置檔案系統中的位置,修改後如下:

1 export QML2_IMPORT_PATH=$QT_ROOT/qml 

qtenv.sh檔案完整內容如下:

 1 export  QTDIR=/usr/local/Qt_5.12.5
 2 if [ -d $QTDIR ];then
 3 
 4     #source /dbusrun.sh
 5     #dbus-uuidgen > /etc/machine-id
 6     #export DBUS_SESSION_BUS_ADDRESS=`cat /tmp/dbusaddr`
 7 
 8     export  QT_ROOT=$QTDIR
 9     export  PATH=$QTDIR/bin:$PATH
10     export  LD_LIBRARY_PATH=$QTDIR/lib:/usr/lib/cedarx/:$LD_LIBRARY_PATH
11 
12     export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
13     export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
14     export QT_QPA_FONTDIR=$QT_ROOT/fonts
15     export QML2_IMPORT_PATH=$QT_ROOT/qml
16 
17     #export LD_PRELOAD=/usr/lib/libts.so
18     #/usr/lib/preloadable_libiconv.so:
19 
20     TouchDevice=ilitek_ts
21     for InputDevices in /sys/class/input/input*
22     do
23         DeviceName=`cat $InputDevices/name`
24         #echo $InputDevices name:$DeviceName
25         if [ $DeviceName == $TouchDevice ];then
26            TouchDeviceNum=${InputDevices##*input}
27            export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event$TouchDeviceNum
28            echo "add "/dev/input/event$TouchDeviceNum "to Qt Application."
29            break
30         fi
31     done
32     if [ ! -n "$TouchDeviceNum" ]; then
33      echo "Error:Input device $TouchDevice can not be found,plz check it!"
34     fi
35 
36     export QT_QPA_PLATFORM=eglfs
37     #export QT_QPA_GENERIC_PLUGINS=tslib
38     export QT_QPA_GENERIC_PLUGINS=evdevtouch
39     export QT_QPA_EGLFS_INTEGRATION=eglfs_mali
40     #export QT_QPA_FB_HIDECURSOR=1
41     #export QT_QPA_EGLFS_HIDECURSOR=1
42     #export QT_QPA_EGLFS_ROTATION=90
43 
44     export QWS_MOUSE_PROTO=
45     export DBUS_SESSION_BUS_ADDRESS=`cat /tmp/dbusaddr`
46     mkdir -p /dev/shm    
47     ulimit -c unlimited
48     FRAMEBUFFER=/dev/fb0 ScreenDemo &
49     #FRAMEBUFFER=/dev/fb0 Launcher &
50     #FRAMEBUFFER=/dev/fb1 MediaUI &
51     echo "find qt5 installed done"                                     
52 fi

相關文章