======== 这一段是在赋予各种全局变量 ======================
export TSLIB_PLUGINDIR=/usr/local/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export LD_LIBRARY_PATH=/usr/local/lib
export PATH=/bin:/sbin:/usr/bin/:/usr/sbin:/usr/local/bin
export QWS_DISPLAY=:1
TS_INFO_FILE=/sys/devices/virtual/input/input0/uevent
================== 如果$TS_INFO_FILE存在,并且过滤TouchScreen有值=========
if [ -e $TS_INFO_FILE -a "/bin/grep -q TouchScreen <$TS_INFO_FILE" ]then
================ 就赋予另外一个全局变量 ==================================
export QWS_MOUSE_PROTO="Tslib:$TSLIB_TSDEVICE MouseMan:/dev/input/mice"
===========如果/etc/pointercal文件为空文件,就删除,并且执行ts_calibrate=======
if [ ! -s /etc/pointercal ] then
rm /etc/pointercal
/usr/local/bin/ts_calibrate
fi
==============这个else 是根据上面那个if来的,赋值变量====================
else
export QWS_MOUSE_PROTO="MouseMan:/dev/input/mice"
fi
===============删除TS_INFO_FILE变量===================
unset TS_INFO_FILE
==============赋值全局变量===========================
export QWS_KEYBOARD=TTY:/dev/tty1
有个这类 QProcess
QProcess p(0)QString command = ""
QStringList args
QString strTemp = ""
QStringList tmpList
/**
* 调用 hostname 命令 获取机器名
================================================================ */
QString hostname = ""
command = "hostname"
args.clear()
p.start( command,args )
p.waitForFinished()
strTemp = QString::fromLocal8Bit( p.readAllStandardOutput() )
hostname = strTemp.replace( "\n","").trimmed()
qDebug()<<"hostname:"<< hostname
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)