QAxBindable(3qt)

NAME
QAxBindable - Interface between a QWidget and an ActiveX client

SYNOPSIS
This class is part of the Qt ActiveQt Extension.

#include <qaxbindable.h>

  Public Members
QAxBindable ()
virtual ~QAxBindable ()
virtual QAxAggregated * createAggregate ()

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

  Protected Members
bool requestPropertyChange ( const char * property )
void propertyChanged ( const char * property )
IUnknown * clientSite () const

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().

SEE ALSO
http://doc.trolltech.com/qaxbindable.html http://www.trolltech.com/faq/tech.html

COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR
Generated automatically from the source code.

BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you.

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qaxbindable.3qt) and the Qt version (3.2.1).