Qt FAQ

From FriendlyARM WiKi
Revision as of 08:38, 28 July 2015 by Tzs (Talk | contribs) (Created page with "===如何开机自动运行Qt4程序?=== 以要开机自动运行HelloQt4程序为例,修改 /etc/init.d/rcS文件: <syntaxhighlight lang="bash"> vi /etc/init.d/rcS </synt...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

如何开机自动运行Qt4程序?

以要开机自动运行HelloQt4程序为例,修改 /etc/init.d/rcS文件:

vi /etc/init.d/rcS

把文件中的:

/bin/qtopia &

改成:

. setqt4env
HelloQt4 –qws&

然后重启开发板即可。

如何开机自动运行Qtopia2.2.0中的单个程序?

以要开机自动运行mycalc程序为例,先为mycalc程序编写一个运行脚本,我们复制qtopia脚本来改一下就行了:

cp /bin/qtopia /bin/auto_run_mycalc
vi /bin/auto_run_mycalc

在vi编辑器中,将auto_run_mycalc文件中的最后一行内容:

exec $QPEDIR/bin/qpe

更改成:

exec $QPEDIR/bin/mycalc -qws

再修改 /etc/init.d/rcS文件:

vi /etc/init.d/rcS

把文件中的:

/bin/qtopia &

改成:

/bin/auto_run_mycalc &

然后重启开发板即可。