qcop tool
|
Command | Description |
---|---|
qcop send channel message [parameters] | Send message on channel with the specified parameters. |
qcop service send name message [parameters] | Send message to the application that implements the service name with the specified parameters. |
qcop watch channel [channel ...] | Watch all messages on channel and print them to standard output. If channel has the form QPE/Application/foo, this will watch all messages to the application foo. |
qcop service watch name [name ...] | Same as above, but watches the application associated with the service name instead. |
qcop wait channel message | Waits for message to appear on channel and then prints the message arguments to standard output. |
qcop service wait name message | Same as above, but waits on the application channel for the application associated with the service. This can be used to wait for someone to send a message to the service. |
qcop query channel | Query all messages that the application on channel can respond to. The application needs to handle the special message __query_qcop_messages(QString) for this to work correctly. The easiest method is to use the QtopiaIpcAdaptor or QtopiaAbstractService classes to implement your service. These classes will automatically respond to the query message. The argument to the message is the name of the channel to respond on. The qcop query command has a default timeout of 1 second unless overridden by the timeout flag. |
qcop service query name | Same as above, but for the service called name. |
qcop list | List all services and the Qt Extended IPC channels that they map to. |
The following flags can be specified before a command to modify its behavior:
Flag | Description |
---|---|
hex | Print the contents of QByteArray parameters in hexadecimal (default). |
nohex | Print the contents of QByteArray parameters as Latin-1 strings. |
timeout msecs | Set the timeout for the command to msecs milliseconds. |
notimeout | Disable the timeout for the command. This is the default for most commands, except qcop query which has a default timeout of 1 second. |
enum name | Recognise name as an enumerated type in message names. |
The following example will watch for all Qt Extended IPC messages on the QPE/System channel:
qcop watch QPE/System
The channel name for qcop watch can include wildcards. For example, the following will watch all network-related channels:
qcop watch 'QPE/Network*'
It is usually necessary to quote channel names when they include wildcards, especially when using qcop watch '*'.
The following example sends a Time::editTime() message to the Time service:
qcop service send Time 'editTime()'
Multiple commands can be separated by -- on the command line. The following example sends the dial() message to the QPE/pppd channel and then waits for up to 30 seconds for a dialResult(bool) message on the same channel.
qcop send QPE/pppd 'dial()' -- timeout 30000 wait QPE/pppd 'dialResult(bool)'
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt qtextended4.4 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com