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  · 

QAbstractValueSpaceLayer Class Reference

The QAbstractValueSpaceLayer class provides support for adding new logical data layers to the Qt Value Space. More...

    #include <QAbstractValueSpaceLayer>

Inherits QObject.


Public Types

typedef Handle
enum Properties { Publish }
enum Type { Server, Client }

Public Functions

virtual void addWatch ( QValueSpacePublisher * creator, Handle handle ) = 0
virtual QSet<QString> children ( Handle handle ) = 0
virtual QUuid id () = 0
virtual Handle item ( Handle parent, const QString & subPath ) = 0
virtual QValueSpace::LayerOptions layerOptions () const = 0
virtual QString name () = 0
virtual bool notifyInterest ( Handle handle, bool interested ) = 0
virtual unsigned int order () = 0
virtual void removeHandle ( Handle handle ) = 0
virtual bool removeSubTree ( QValueSpacePublisher * creator, Handle handle ) = 0
virtual bool removeValue ( QValueSpacePublisher * creator, Handle handle, const QString & subPath ) = 0
virtual void removeWatches ( QValueSpacePublisher * creator, Handle parent ) = 0
virtual void setProperty ( Handle handle, Properties property ) = 0
virtual bool setValue ( QValueSpacePublisher * creator, Handle handle, const QString & subPath, const QVariant & value ) = 0
virtual bool startup ( Type type ) = 0
virtual bool supportsInterestNotification () const = 0
virtual void sync () = 0
virtual bool value ( Handle handle, QVariant * data ) = 0
virtual bool value ( Handle handle, const QString & subPath, QVariant * data ) = 0
  • 29 public functions inherited from QObject

Signals

void handleChanged ( quintptr handle )

Protected Functions

void emitInterestChanged ( QValueSpacePublisher * publisher, const QString & path, bool interested )
  • 7 protected functions inherited from QObject

Macros

QVALUESPACE_AUTO_INSTALL_LAYER ( className )

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QAbstractValueSpaceLayer class provides support for adding new logical data layers to the Qt Value Space.

To create a new layer in the Value Space subclass this class and reimplement all of the virtual functions. The new layer is installed by either calling QValueSpace::installLayer() or by adding the QVALUESPACE_AUTO_INSTALL_LAYER() macro in your implementation file.


Member Type Documentation

typedef QAbstractValueSpaceLayer::Handle

The Handle type is an opaque, pointer sized contextual handle used to represent paths within Value Space layers. Handles are only ever created by QAbstractValueSpaceLayer::item() and are always released by calls to QAbstractValueSpaceLayer::removeHandle(). The special value, InvalidHandle is reserved to represent an invalid handle.

enum QAbstractValueSpaceLayer::Properties

To allow for efficient layer implementations, expensive handle operations, currently only monitoring for changes, are enabled and disabled as needed on a per-handle basis. The Properties enumeration is a bitmask representing the different properties that can exist on a handle.

ConstantValueDescription
QAbstractValueSpaceLayer::Publish0x00000001Enable change notification for the handle. When set, the layer should emit QAbstractValueSpaceLayer::handleChanged() signals when appropriate for the handle.

enum QAbstractValueSpaceLayer::Type

Value Space layers are initialized in either a "Server" or a "Client" context. There is only a single server in the Value Space architecture, and its layers are always initialized before any clients. This distinction allows layers to implement Client/Server architecture if required. If not, layers are free to treat Server and Client contexts identically.

ConstantValueDescription
QAbstractValueSpaceLayer::Server0The layer is being initialized in the "server" context.
QAbstractValueSpaceLayer::Client1The layer is being initialized in the "client" context.


Member Function Documentation

void QAbstractValueSpaceLayer::addWatch ( QValueSpacePublisher * creator, Handle handle )   [pure virtual]

Registers creator for change notifications to values under handle.

See also removeWatches().

QSet<QString> QAbstractValueSpaceLayer::children ( Handle handle )   [pure virtual]

Returns the set of children of handle. For example, in a layer providing the following items:

    /Device/Configuration/Applications/FocusedApplication
    /Device/Configuration/Buttons/PrimaryInput
    /Device/Configuration/Name

a request for children of "/Device/Configuration" will return { "Applications", "Buttons", "Name" }.

void QAbstractValueSpaceLayer::emitInterestChanged ( QValueSpacePublisher * publisher, const QString & path, bool interested )   [protected]

Emits the QValueSpacePublisher::interestChanged() signal on publisher with path and interested.

void QAbstractValueSpaceLayer::handleChanged ( quintptr handle )   [signal]

Emitted whenever the handle's value, or any sub value, changes.

QUuid QAbstractValueSpaceLayer::id ()   [pure virtual]

Returns a globally unique identifier for the layer. This id is used to break ordering ties.

Handle QAbstractValueSpaceLayer::item ( Handle parent, const QString & subPath )   [pure virtual]

Returns a new opaque handle for the requested subPath of parent. If parent is an InvalidHandle, subPath is interpreted as an absolute path.

The caller should call removeHandle() to free resources used by the handle when it is no longer required.

QValueSpace::LayerOptions QAbstractValueSpaceLayer::layerOptions () const   [pure virtual]

Returns the QValueSpace::LayerOptions describing this layer.

See also QValueSpace::LayerOption.

QString QAbstractValueSpaceLayer::name ()   [pure virtual]

Returns the name of the Value Space layer. This name is only used for diagnostics purposes.

bool QAbstractValueSpaceLayer::notifyInterest ( Handle handle, bool interested )   [pure virtual]

Registers or unregisters that the caller is interested in handle and any subpaths under it. If interested is true interest in handle is registered; otherwise it is unregistered.

The caller should ensure that all calls to this function with interested set to true have a matching call with interested set to false.

Returns true if the notification was successfully sent; otherwise returns false.

unsigned int QAbstractValueSpaceLayer::order ()   [pure virtual]

Return the position in the Value Space layer stack that this layer should reside. Higher numbers mean the layer has a higher precedence and its values will "shadow" those below it. If two layers specify the same ordering, the id() value is used to break the tie.

void QAbstractValueSpaceLayer::removeHandle ( Handle handle )   [pure virtual]

Releases a handle previously returned from QAbstractValueSpaceLayer::item().

bool QAbstractValueSpaceLayer::removeSubTree ( QValueSpacePublisher * creator, Handle handle )   [pure virtual]

Process calls to QValueSpacePublisher::~QValueSpacePublisher() by removing the entire sub tree created by creator under handle.

Returns true on success; otherwise returns false.

bool QAbstractValueSpaceLayer::removeValue ( QValueSpacePublisher * creator, Handle handle, const QString & subPath )   [pure virtual]

Process calls to QValueSpacePublisher::resetValue() by removing the Value Space item identified by handle and subPath and created by creator.

Returns true on success; otherwise returns false.

void QAbstractValueSpaceLayer::removeWatches ( QValueSpacePublisher * creator, Handle parent )   [pure virtual]

Removes all registered change notifications for creator under parent.

See also addWatch().

void QAbstractValueSpaceLayer::setProperty ( Handle handle, Properties property )   [pure virtual]

Apply the specified property mask to handle.

bool QAbstractValueSpaceLayer::setValue ( QValueSpacePublisher * creator, Handle handle, const QString & subPath, const QVariant & value )   [pure virtual]

Process calls to QValueSpacePublisher::setValue() by setting the value specified by the subPath under handle to value. Ownership of the Value Space item is assigned to creator.

Returns true on success; otherwise returns false.

See also value().

bool QAbstractValueSpaceLayer::startup ( Type type )   [pure virtual]

Called by the Value Space system to initialize each layer. The type parameter will be set accordingly, and layer implementors can use this to implement a client/server architecture if desired.

Returns true upon success; otherwise returns false.

bool QAbstractValueSpaceLayer::supportsInterestNotification () const   [pure virtual]

Returns true if the layer supports interest notifications; otherwise returns false.

void QAbstractValueSpaceLayer::sync ()   [pure virtual]

Flushes all pending changes made by calls to setValue(), removeValue() and removeSubTree().

bool QAbstractValueSpaceLayer::value ( Handle handle, QVariant * data )   [pure virtual]

Returns the value for a particular handle. If a value is available, the layer will set data and return true. If no value is available, false is returned.

See also setValue().

bool QAbstractValueSpaceLayer::value ( Handle handle, const QString & subPath, QVariant * data )   [pure virtual]

Returns the value for a particular subPath of handle. If a value is available, the layer will set data and return true. If no value is available, false is returned.


Macro Documentation

QVALUESPACE_AUTO_INSTALL_LAYER ( className )

This macro installs new Value Space layer. className is the name of the class implementing the new layer.

The method className *className::instance() must exist and return a pointer to an instance of the layer to install. This method will only be invoked after QApplication has been constructed, making it safe to use any Qt class in your layer's constructor.

This macro can only be used once for any given class and it should be used where the implementation is written rather than in a header file.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 42
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 8
Page suivante

Le Qt Labs au hasard

Logo

Utiliser OpenCL avec Qt

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. 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 qtmobility-1.0-tp
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