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  ·  Modules  ·  Fonctions  · 

QAxWidget Class

The QAxWidget class is a QWidget that wraps an ActiveX control. More...

 #include <QAxWidget>

Inherits: QWidget and QAxBase.

Public Types

enum PaintDeviceMetric { PdmWidth, PdmHeight, PdmWidthMM, PdmHeightMM, ..., PdmPhysicalDpiY }
typedef PropertyBag

Properties

  • 58 properties inherited from QWidget
  • 1 property inherited from QObject

Public Functions

QAxBase(IUnknown * iface = 0)
QAxWidget(QWidget * parent = 0, Qt::WindowFlags f = 0)
QAxWidget(const QString & c, QWidget * parent = 0, Qt::WindowFlags f = 0)
QAxWidget(IUnknown * iface, QWidget * parent = 0, Qt::WindowFlags f = 0)
virtual ~QAxBase()
~QAxWidget()
virtual ~QPaintDevice()
QVariant asVariant() const
virtual void clear()
int colorCount() const
QString control() const
virtual QAxAggregated * createAggregate()
int depth() const
void disableClassInfo()
void disableEventSink()
void disableMetaObject()
bool doVerb(const QString & verb)
QVariant dynamicCall(const char * function, const QVariant & var1 = QVariant(), const QVariant & var2 = QVariant(), const QVariant & var3 = QVariant(), const QVariant & var4 = QVariant(), const QVariant & var5 = QVariant(), const QVariant & var6 = QVariant(), const QVariant & var7 = QVariant(), const QVariant & var8 = QVariant())
QVariant dynamicCall(const char * function, QList<QVariant> & vars)
QString generateDocumentation()
int height() const
int heightMM() const
bool isNull() const
int logicalDpiX() const
int logicalDpiY() const
virtual QPaintEngine * paintEngine() const = 0
bool paintingActive() const
int physicalDpiX() const
int physicalDpiY() const
PropertyBag propertyBag() const
virtual bool propertyWritable(const char * prop) const
long queryInterface(const QUuid & uuid, void ** iface) const
QAxObject * querySubObject(const char * name, const QVariant & var1 = QVariant(), const QVariant & var2 = QVariant(), const QVariant & var3 = QVariant(), const QVariant & var4 = QVariant(), const QVariant & var5 = QVariant(), const QVariant & var6 = QVariant(), const QVariant & var7 = QVariant(), const QVariant & var8 = QVariant())
QAxObject * querySubObject(const char * name, QList<QVariant> & vars)
bool setControl(const QString &)
void setPropertyBag(const PropertyBag & bag)
virtual void setPropertyWritable(const char * prop, bool ok)
QStringList verbs() const
int width() const
int widthMM() const

Reimplemented Public Functions

virtual void clear()
virtual QSize minimumSizeHint() const
virtual QSize sizeHint() const
  • 215 public functions inherited from QWidget
  • 31 public functions inherited from QObject

Signals

void exception(int code, const QString & source, const QString & desc, const QString & help)
void propertyChanged(const QString & name)
void signal(const QString & name, int argc, void * argv)

Protected Types

class qt_meta_stringdata_QAxBase_t

Protected Functions

QPaintDevice()
virtual bool createHostWindow(bool initialized)
bool createHostWindow(bool initialized, const QByteArray & data)
virtual const QMetaObject * fallbackMetaObject() const = 0
virtual void init(QPainter * painter) const
virtual bool initialize(IUnknown ** ptr)
bool initializeActive(IUnknown ** ptr)
bool initializeFromFile(IUnknown ** ptr)
bool initializeLicensed(IUnknown ** ptr)
bool initializeRemote(IUnknown ** ptr)
virtual int metric(PaintDeviceMetric metric) const
virtual QPaintDevice * redirected(QPoint * offset) const
virtual QPainter * sharedPainter() const
virtual bool translateKeyEvent(int message, int keycode) const

Reimplemented Protected Functions

virtual void changeEvent(QEvent * e)
virtual void connectNotify(const QMetaMethod & signal)
virtual bool initialize(IUnknown ** ptr)
virtual void resizeEvent(QResizeEvent *)
  • 37 protected functions inherited from QWidget
  • 9 protected functions inherited from QObject

Additional Inherited Members

  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject
  • 4 static public members inherited from QWidget
  • 11 static public members inherited from QObject
  • 1 protected slot inherited from QWidget

Detailed Description

The QAxWidget class is a QWidget that wraps an ActiveX control.

A QAxWidget can be instantiated as an empty object, with the name of the ActiveX control it should wrap, or with an existing interface pointer to the ActiveX control. The ActiveX control's properties, methods and events which only use QAxBase supported data types, become available as Qt properties, slots and signals. The base class QAxBase provides an API to access the ActiveX directly through the IUnknown pointer.

QAxWidget is a QWidget and can mostly be used as such, e.g. it can be organized in a widget hierarchy and layouts or act as an event filter. Standard widget properties, e.g. enabled are supported, but it depends on the ActiveX control to implement support for ambient properties like e.g. palette or font. QAxWidget tries to provide the necessary hints.

However, you cannot reimplement Qt-specific event handlers like mousePressEvent or keyPressEvent and expect them to be called reliably. The embedded control covers the QAxWidget completely, and usually handles the user interface itself. Use control-specific APIs (i.e. listen to the signals of the control), or use standard COM techniques like window procedure subclassing.

QAxWidget also inherits most of its ActiveX-related functionality from QAxBase, notably dynamicCall() and querySubObject().

Warning: You can subclass QAxWidget, but you cannot use the Q_OBJECT macro in the subclass (the generated moc-file will not compile), so you cannot add further signals, slots or properties. This limitation is due to the metaobject information generated in runtime. To work around this problem, aggregate the QAxWidget as a member of the QObject subclass.

See also QAxBase, QAxObject, QAxScript, and ActiveQt Framework.

Member Function Documentation

QAxWidget::QAxWidget(QWidget * parent = 0, Qt::WindowFlags f = 0)

Creates an empty QAxWidget widget and propagates parent and f to the QWidget constructor. To initialize a control, call setControl().

QAxWidget::QAxWidget(const QString & c, QWidget * parent = 0, Qt::WindowFlags f = 0)

Creates an QAxWidget widget and initializes the ActiveX control c. parent and f are propagated to the QWidget contructor.

See also setControl().

QAxWidget::QAxWidget(IUnknown * iface, QWidget * parent = 0, Qt::WindowFlags f = 0)

Creates a QAxWidget that wraps the COM object referenced by iface. parent and f are propagated to the QWidget contructor.

QAxWidget::~QAxWidget()

Shuts down the ActiveX control and destroys the QAxWidget widget, cleaning up all allocated resources.

See also clear().

void QAxWidget::changeEvent(QEvent * e) [virtual protected]

Reimplemented from QWidget::changeEvent().

void QAxWidget::clear() [virtual]

Reimplemented from QAxBase::clear().

Shuts down the ActiveX control.

void QAxWidget::connectNotify(const QMetaMethod & signal) [virtual protected]

Reimplemented from QObject::connectNotify().

QAxAggregated * QAxWidget::createAggregate() [virtual]

Reimplement this function when you want to implement additional COM interfaces for the client site of 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.

bool QAxWidget::createHostWindow(bool initialized) [virtual protected]

Creates the client site for the ActiveX control, and returns true if the control could be embedded successfully, otherwise returns false. If initialized is true the control has already been initialized.

This function is called by initialize(). If you reimplement initialize to customize the actual control instantiation, call this function in your reimplementation to have the control embedded by the default client side. Creates the client site for the ActiveX control, and returns true if the control could be embedded successfully, otherwise returns false.

bool QAxWidget::createHostWindow(bool initialized, const QByteArray & data) [protected]

Creates the client site for the ActiveX control, and returns true if the control could be embedded successfully, otherwise returns false. If initialized is false the control will be initialized using the data. The control will be initialized through either IPersistStreamInit or IPersistStorage interface.

If the control needs to be initialized using custom data, call this function in your reimplementation of initialize(). This function is not called by the default implementation of initialize().

This function was introduced in Qt 4.4.

bool QAxWidget::doVerb(const QString & verb)

Requests the ActiveX control to perform the action verb. The possible verbs are returned by verbs().

The function returns true if the object could perform the action, otherwise returns false.

This function was introduced in Qt 4.1.

bool QAxWidget::initialize(IUnknown ** ptr) [virtual protected]

Reimplemented from QAxBase::initialize().

Calls QAxBase::initialize(ptr), and embeds the control in this widget by calling createHostWindow(false) if successful.

To initialize the control before it is activated, reimplement this function and add your initialization code before you call createHostWindow(true).

This function was introduced in Qt 4.2.

QSize QAxWidget::minimumSizeHint() const [virtual]

Reimplemented from QWidget::minimumSizeHint().

void QAxWidget::resizeEvent(QResizeEvent *) [virtual protected]

Reimplemented from QWidget::resizeEvent().

QSize QAxWidget::sizeHint() const [virtual]

Reimplemented from QWidget::sizeHint().

bool QAxWidget::translateKeyEvent(int message, int keycode) const [virtual protected]

Reimplement this function to pass certain key events to the ActiveX control. message is the Window message identifier specifying the message type (ie. WM_KEYDOWN), and keycode is the virtual keycode (ie. VK_TAB).

If the function returns true the key event is passed on to the ActiveX control, which then either processes the event or passes the event on to Qt.

If the function returns false the processing of the key event is ignored by ActiveQt, ie. the ActiveX control might handle it or not.

The default implementation returns true for the following cases:

WM_SYSKEYDOWNWM_SYSKEYUPWM_KEYDOWN
All keycodesVK_MENUVK_TAB, VK_DELETE and all non-arrow-keys in combination with VK_SHIFT, VK_CONTROL or VK_MENU

This table is the result of experimenting with popular ActiveX controls, ie. Internet Explorer and Microsoft Office applications, but for some controls it might require modification.

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 5.0-snapshot
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