LHY666999 发表于 2024-8-28 17:51:10

QT程序开机自启动后无法使用触摸功能

试图将示例QT文件开机自启动:./LoongMui -platform linuxfb。


cd /home/root/QTTEST
echo "Starting touchscreen calibration..."
ts_calibrate
if [ $? -ne 0 ]; then
    echo "Touchscreen calibration failed"
    exit 1
else
    echo "Touchscreen calibration successful"
fi
./LoongMui -platform linuxfb
sleep 5
if ! pgrep -x "LoongMui" > /dev/null; then
    echo "Qt application failed to start"
    exit 1
fi



Description=Run Qt Application at Startup
After=network.target display-manager.service
After=graphical.target
BindsTo=getty.target


Type=simple
Environment="LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH"
# AmbientCapabilities=CAPABILITY_SETGID CAPABILITY_SETUID
ExecStartPre=/bin/sleep 10
ExecStart=/home/lamanstart.sh
Restart=no


WantedBy=graphical.target

执行service后开机可以启动QT,QT程序上的时钟也可以正常运行,但是无法使用触摸功能(并非卡死。)
程序在命令行执行也没出现问题
页: [1]
查看完整版本: QT程序开机自启动后无法使用触摸功能