if [ -c ${TSLIB_TSDEVICE} ]; then
export QWS_MOUSE_PROTO="Tslib:${TSLIB_TSDEVICE}"
if [ -e /etc/pointercal -a ! -s /etc/pointercal ] ; then
rm /etc/pointercal
fi
else
export QWS_MOUSE_PROTO="USB:/dev/input/mice"
>/etc/pointercal
fi
export QWS_KEYBOARD="TTY:/dev/tty1"
#export QWS_DISPLAY="Transformed:mmWidth66:mmHeight114:Rot90:0"
FB_SIZE=$(cat /sys/class/graphics/fb0/virtual_size)
case "$FB_SIZE" in
800,480)
export QWS_DISPLAY="LinuxFb:mmWidth91:mmHeight53:1"
;;
480,272)
export QWS_DISPLAY="LinuxFb:mmWidth76:mmHeight44:1"
;;
*)
#export QWS_DISPLAY="LinuxFb:mmWidth91:mmHeight53:1"
#7.0
#export QWS_DISPLAY="Transformed:Rot270:LinuxFb:mmWidth154:mmHeight86:1"
#3.5
export QWS_DISPLAY="Transformed:Rot270:LinuxFb:mmWidth70:mmHeight53:1"
;;
esac
file_path=`dirname $1`
file_name=`basename $1`
options=${@#$1}
cd $file_path
CMDPATH=`pwd`/
${CMDPATH}$file_name $options
---------------------------这是脚本------------------------
里面有些是外设的设置如:触摸屏,显示屏等,改成你板子相关的就行了,不配置也可以呀,不要这些功能呗。
把脚本拷到bin下去
那你就可以这样运行你的qt程序了(假设脚本名qt4.8.5 程序名 test)
qt4.8.5 test -qws
推荐阅读:
Ubuntu下QT控制台程序无法运行的解决方案以及XTerm的配置方法
Linux下为刚安装好的Qt Creator 创建桌面启动图标
Ubuntu 11.04安装QT Creator 2.5.0