⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qaxfactory.3qt

📁 qt专门用于嵌入式的图形开发GUI
💻 3QT
📖 第 1 页 / 共 2 页
字号:
'\" t.TH QAxFactory 3qt "2 September 2005" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQAxFactory \- Defines a factory for the creation of COM components.SH SYNOPSISThis class is part of the \fBQt ActiveQt Extension\fR..PP\fC#include <qaxfactory.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "\fBQAxFactory\fR ( const QUuid & libid, const QUuid & appid )".br.ti -1c.BI "virtual \fB~QAxFactory\fR ()".br.ti -1c.BI "virtual QStringList \fBfeatureList\fR () const = 0".br.ti -1c.BI "virtual QWidget * \fBcreate\fR ( const QString & key, QWidget * parent = 0, const char * name = 0 )".br.ti -1c.BI "virtual QObject * \fBcreateObject\fR ( const QString & key, QObject * parent = 0, const char * name = 0 )".br.ti -1c.BI "virtual QMetaObject * \fBmetaObject\fR ( const QString & key ) const".br.ti -1c.BI "virtual bool \fBcreateObjectWrapper\fR ( QObject * object, IDispatch ** wrapper )".br.ti -1c.BI "virtual QUuid \fBclassID\fR ( const QString & key ) const".br.ti -1c.BI "virtual QUuid \fBinterfaceID\fR ( const QString & key ) const".br.ti -1c.BI "virtual QUuid \fBeventsID\fR ( const QString & key ) const".br.ti -1c.BI "virtual QUuid \fBtypeLibID\fR () const".br.ti -1c.BI "virtual QUuid \fBappID\fR () const".br.ti -1c.BI "virtual void \fBregisterClass\fR ( const QString & key, QSettings * settings ) const".br.ti -1c.BI "virtual void \fBunregisterClass\fR ( const QString & key, QSettings * settings ) const".br.ti -1c.BI "virtual bool \fBvalidateLicenseKey\fR ( const QString & key, const QString & licenseKey ) const".br.ti -1c.BI "virtual QString \fBexposeToSuperClass\fR ( const QString & key ) const".br.ti -1c.BI "virtual bool \fBstayTopLevel\fR ( const QString & key ) const".br.ti -1c.BI "virtual bool \fBhasStockEvents\fR ( const QString & key ) const".br.ti -1c.BI "virtual bool \fBisService\fR () const".br.ti -1c.BI "enum \fBServerType\fR { SingleInstance, MultipleInstances }".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "bool \fBisServer\fR ()".br.ti -1c.BI "QString \fBserverDirPath\fR ()".br.ti -1c.BI "QString \fBserverFilePath\fR ()".br.ti -1c.BI "bool \fBstartServer\fR ( ServerType type = MultipleInstances )".br.ti -1c.BI "bool \fBstopServer\fR ()".br.in -1c.SH DESCRIPTIONThis class is defined in the \fBQt ActiveQt Extension\fR, which can be found in the \fCqt/extensions\fR directory. It is not included in the main Qt API..PPThe QAxFactory class defines a factory for the creation of COM components..PP.PPImplement this factory once in your ActiveX server to provide information about the components the server can create. If your server supports just a single ActiveX control, you can use the default factory implementation instead of implementing the factory yourself. Use the QAXFACTORY_DEFAULT macro in any implementation file (e.g. main.cpp) to instantiate and export the default factory:.PP.nf.br    #include <qapplication.h>.br    #include <qaxfactory.h>.br.br    #include "theactivex.h".br.br    QAXFACTORY_DEFAULT(.br        TheActiveX,                               // widget class.br        "{01234567-89AB-CDEF-0123-456789ABCDEF}", // class ID.br        "{01234567-89AB-CDEF-0123-456789ABCDEF}", // interface ID.br        "{01234567-89AB-CDEF-0123-456789ABCDEF}", // event interface ID.br        "{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID.br        "{01234567-89AB-CDEF-0123-456789ABCDEF}"  // application ID.br        ).br.fi.PPIf you implement your own factory reimplement the pure virtual functions, provide the unique identifiers for the ActiveX controls, and use the QAXFACTORY_EXPORT macro to instantiate and export it:.PP.nf.br    QStringList ActiveQtFactory::featureList() const.br    {.br        QStringList list;.br        list << "ActiveX1";.br        list << "ActiveX2";.br        ....br        return list;.br    }.br.br    QWidget *ActiveQtFactory::create( const QString &key, QWidget *parent, const char *name ).br    {.br        if ( key == "ActiveX1" ).br            return new ActiveX1( parent, name );.br        if ( key == "ActiveX2" ).br            return new ActiveX2( parent, name );.br        ....br        return 0;.br    }.br.br    QUuid ActiveQtFactory::classID( const QString &key ) const.br    {.br        if ( key == "ActiveX1" ).br            return "{01234567-89AB-CDEF-0123-456789ABCDEF}";.br        ....br        return QUuid();.br    }.br.br    QUuid ActiveQtFactory::interfaceID( const QString &key ) const.br    {.br        if ( key == "ActiveX1" ).br            return "{01234567-89AB-CDEF-0123-456789ABCDEF}";.br        ....br        return QUuid();.br    }.br.br    QUuid ActiveQtFactory::eventsID( const QString &key ) const.br    {.br        if ( key == "ActiveX1" ).br            return "{01234567-89AB-CDEF-0123-456789ABCDEF}";.br        ....br        return QUuid();.br    }.br.br    QAXFACTORY_EXPORT(

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -