Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QtopiaChannel Class Reference
[QtBaseModule]

The QtopiaChannel class provides communication capabilities between clients. More...

    #include <QtopiaChannel>

Inherits QObject.

Public Functions

  • 29 public functions inherited from QObject

Signals

  • void received ( const QString & message, const QByteArray & data )

Static Public Members

  • bool flush ()
  • bool isRegistered ( const QString & channel )
  • bool send ( const QString & channel, const QString & msg )
  • bool send ( const QString & channel, const QString & msg, const QByteArray & data )
  • 4 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QtopiaChannel class provides communication capabilities between clients.

QtopiaChannel provides a many-to-many (broadcast) inter-process communication protocol. The messages transferred are identified by channel, message and message signature. A channel is identified by a name, and anyone who wants to can listen to it, restricted by an active security framework, if any. The QtopiaChannel protocol allows clients to communicate both within the same address space and between different processes.

There are currently two implementations for QtopiaChannel, one layered over the Qt QCop mechanism, and another one for DBus. QCop mechanism is currently only available on Qt for Embedded Linux.

Typically, QtopiaChannel is either used to send messages to a channel using the provided static functions, or to listen to the traffic on a channel by deriving from the class to take advantage of the provided functionality for receiving messages.

QtopiaChannel provides a couple of static functions which are usable without an object: The send() function, which sends the given message and data on the specified channel, and the isRegistered() function which queries the server for the existence of the given channel.

In addition, the QtopiaChannel class provides the channel() function which returns the name of the object's channel, and the received() signal which is emitted with the given message and data when a QtopiaChannel receives a message from its channel.

See also QtopiaAbstractService.


Member Function Documentation

QtopiaChannel::QtopiaChannel ( const QString & channel, QObject * parent = 0 )

Constructs a QtopiaChannel with the given parent, and starts to listen on channel name.

See also isRegistered() and channel().

QtopiaChannel::~QtopiaChannel ()   [virtual]

Destroys this QtopiaChannel instance.

QString QtopiaChannel::channel () const

Returns the name of the channel this object is listening on.

bool QtopiaChannel::flush ()   [static]

Flushes all pending messages destined from this channel, causing them to be sent immediately. Returns true if the flush succeeded; otherwise returns false.

bool QtopiaChannel::isRegistered ( const QString & channel )   [static]

Returns true if the channel is registered. In the QCop implementation, this function requires a round-trip to the QWS server, which may impact system performance.

void QtopiaChannel::received ( const QString & message, const QByteArray & data )   [signal]

This signal is emitted with the given message and data whenever the channel receives a message on the channel being listened on.

See also send().

bool QtopiaChannel::send ( const QString & channel, const QString & msg )   [static]

Sends a message msg with no parameters on channel. Returns true if able to send the message; otherwise returns false.

See also received().

bool QtopiaChannel::send ( const QString & channel, const QString & msg, const QByteArray & data )   [static]

This is an overloaded member function, provided for convenience.

Sends a message msg on channel channel with the parameter data given by data. Returns true if able to send the message; otherwise returns false.

See also received().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. Microsoft ouvre aux autres compilateurs C++ AMP, la spécification pour la conception d'applications parallèles C++ utilisant le GPU 22
  2. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 27
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. RIM : « 13 % des développeurs ont gagné plus de 100 000 $ sur l'AppWord », Qt et open-source au menu du BlackBerry DevCon Europe 0
  5. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
Page suivante

Le blog Digia au hasard

Logo

Créer des applications avec un style Metro avec Qt, exemples en QML et C++, un article de Digia Qt traduit par Thibaut Cuvelier

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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 !
 
 
 
 
Partenaires

Hébergement Web