HOME        PACKAGES        SCRIPTS

Communicating with Qtopia

Qcop provides a means for applications, scripts, and the user to communicate with Qtopia. Qcop is a basic built in command for all ROMs which are based on Qtopia. However, the qcop shipped with Sharp's 2.38 ROM does not accept command line input, and that problem can be rectified by upgrading to qcop2. If you just want to see example qcop commands, you can skip to examples of using qcop.

If you have a Qtopia-based ROM on an sl5500, many scripts utilize qcop commands and may not work properly unless you upgrade qcop to qcop2. It is very small, only about 9k, and can be found at:

http://tbox.jpn.org/wiki/linuzau/wiki.cgi?qcop2
 
http://tbox.jpn.org/misc/dl.cgi?file=qcop2_0.1.0-1_arm.ipk
 
http://tbox.jpn.org/misc/dl.cgi?file=qcop2_0.0.1.tar.gz
 
http://quickening.zapto.org/ZaurusFeed/qcop2_0.1.0-1_arm.ipk

My sl6000 running the original Sharp ROM 1.12 has a different version of qcop. I do not know the version number, it might be Version 1 because it only works with command line input some of the time, but I have put a tar gzip copy of the binary online for you to try if qcop2 does not work on your ROM. On my Tosa, it is located at /usr/QtPalmtop.rom/bin/qcop, and is symlinked from /home/QtPalmtop/bin/qcop.

http://sdjf.esmartdesign.com/files/qcop.tar.gz

If you are running a non-Qtopia-based ROM or another model, check the feeds for your ROM.

If you want examples of using qcop, there are some further down below. But for detailed, official technical information about Qtopia, the best places to go are:

http://qt.nokia.com/ (formerly http://www.trolltech.com)
 
http://doc.trolltech.com
 
http://developer.qt.nokia.com/faq (formerly http://www.trolltech.com/developer/faqs).

For my layman's understanding of what Qtopia is and does, and a discussion of how Qtopia uses qcop to send messages to applications and devices, read my Wordpress page entitled Qtopia on the Zaurus.

Sample Qcop Commands

Here are some examples of qcop requests you can put in scripts or issue from the command line. If you do not already know how to use qcop, also read my page about Qcoptest, which is an essential tool for helping you find the correct channel and syntax for your qcop commands if the following examples do not meet your "how to do it" needs.

If you have installed qcop2, you will need to use the term qcop2 instead of qcop in the examples later in this section, or create an appropriate symlink so you system will call qcop2 when you say qcop. You could try issuing the following permanent symlink if your qcop2 is in /home/QtPalmtop/bin/.

ln -s /home/QtPalmtop/bin/qcop2 /home/QtPalmtop/bin/qcop

The following command sends a message to the taskbar channel to sound the built in alarm.

qcop QPE/TaskBar 'soundAlarm()'

The following command sends a message to the system channel to start or raise the built in clock application.

qcop QPE/Application/clock 'raise()'

The following command used in a script sends a message to the system channel to raise an application which was backgrounded. Notice it uses a variable ($PARENT) whose value must be set before the command will work properly.

qcop QPE/Application/$PARENT 'raise()'

The following command which can be used in a script sends a message to the taskbar channel, to be displayed to the user.

qcop QPE/TaskBar "message(QString)" "This is a sample taskbar message"

The following command used in a script sends output from a system command as a message to the taskbar channel, to be displayed in the taskbar.

qcop QPE/TaskBar "message(QString)" "`grep Buffer /proc/meminfo`"

Again, if you are going to write your own qcop commands, I strongly recommend installing Qcoptest, which will enable you to see whether your qcop messages themselves are working (the commands may fail for other reasons), and monitor qcop channels. You can learn more about Qcoptest at http://sdjf.esmartdesign.com/ipks/qcoptest.html.

Revised October 7, 2011