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  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Fonctions  · 

QAxBindable Class Reference
[QAxServer module]

The QAxBindable class provides an interface between a QWidget and an ActiveX client. More...

This class is part of the Qt ActiveQt Extension.

#include <qaxbindable.h>

List of all member functions.

Public Members

Static Public Members

  • void reportError ( int code, const QString & src, const QString & desc, const QString & context = QString::null )

Protected Members


Detailed Description

This class is defined in the Qt ActiveQt Extension, which can be found in the qt/extensions directory. It is not included in the main Qt API.

The QAxBindable class provides an interface between a QWidget and an ActiveX client.

The functions provided by this class allow an ActiveX control to communicate property changes to a client application. Inherit your control class from both QWidget (directly or indirectly) and this class to get access to this class's functions. The meta object compiler requires you to inherit from QWidget first.

    class MyActiveX : public QWidget, public QAxBindable
    {
        Q_OBJECT
        Q_PROPERTY( int value READ value WRITE setValue )
    public:
        MyActiveX( QWidget *parent = 0, const char *name = 0 );
        ...

        int value() const;
        void setValue( int );
    };
    

When implementing the property write function, use requestPropertyChange() to get permission from the ActiveX client application to change this property. When the property changes, call propertyChanged() to notify the ActiveX client application about the change. If a fatal error occurs in the control, use the static reportError() function to notify the client.

Use the interface returned by clientSite() to call the ActiveX client. To implement additional COM interfaces in your ActiveX control, reimplement createAggregate() to return a new object of a QAxAggregated subclass.


Member Function Documentation

QAxBindable::QAxBindable ()

Constructs an empty QAxBindable object.

QAxBindable::~QAxBindable () [virtual]

Destroys the QAxBindable object.

IUnknown * QAxBindable::clientSite () const [protected]

Returns a pointer to the client site interface for this ActiveX object, or null if no client site has been set.

Call QueryInterface() on the returned interface to get the interface you want to call.

QAxAggregated * QAxBindable::createAggregate () [virtual]

Reimplement this function when you want to implement additional COM interfaces in the ActiveX control, or when you want to provide alternative implementations of COM interfaces. Return a new object of a QAxAggregated subclass.

The default implementation returns the null pointer.

void QAxBindable::propertyChanged ( const char * property ) [protected]

Call this function to notify the client that is hosting this ActiveX control that the property property has been changed.

This function is usually called at the end of the property's write function.

See also requestPropertyChange().

void QAxBindable::reportError ( int code, const QString & src, const QString & desc, const QString & context = QString::null ) [static]

Reports an error to the client application. code is a control-defined error code. desc is a human-readable description of the error intended for the application user. src is the name of the source for the error, typically the ActiveX server name. context can be the location of a help file with more information about the error. If context ends with a number in brackets, e.g. [12], this number will be interpreted as the context ID in the help file.

bool QAxBindable::requestPropertyChange ( const char * property ) [protected]

Call this function to request permission to change the property property from the client that is hosting this ActiveX control. Returns TRUE if the client allows the change; otherwise returns FALSE.

This function is usually called first in the write function for property, and writing is abandoned if the function returns FALSE.

    void MyActiveQt::setText( const QString &text )
    {
        if ( !requestPropertyChange( "text" ) )
            return;

        // update property

        propertyChanged( "text" );
    }
    

See also propertyChanged().


This file is part of the Qt toolkit. Copyright © 1995-2005 Trolltech. All Rights Reserved.

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 53
  2. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  3. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  4. 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
  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. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Quarterly au hasard

Logo

XQuery et la météo

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. 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 3.3
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