📄 qaxfactory.3qt
字号:
.br MyFactory, // factory class.br "{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID.br "{01234567-89AB-CDEF-0123-456789ABCDEF}" // application ID.br ).br.fi.PPIf you use the \fCQ_CLASSINFO\fR macro to provide the unique identifiers or other attributes for your class you can use the QAXFACTORY_BEGIN, QAXCLASS and QAXFACTORY_END macros to expose one or more classes as COM objects..PP.nf.br QAXFACTORY_BEGIN(.br "{01234567-89AB-CDEF-0123-456789ABCDEF}", // type library ID.br "{01234567-89AB-CDEF-0123-456789ABCDEF}" // application ID.br ).br QAXCLASS(Class1).br QAXCLASS(Class2).br QAXFACTORY_END().br.fi.PPOnly one QAxFactory implementation may be instantiated and exported by an ActiveX server application. This instance is accessible through the global qAxFactory() function..PPA factory can also reimplement the registerClass() and unregisterClass() functions to set additional flags for an ActiveX control in the registry. To limit the number of methods or properties a widget class exposes from its parent classes reimplement exposeToSuperClass()..SS "Member Type Documentation".SH "QAxFactory::ServerType"This enum specifies the different types of servers that can be started with startServer..TP\fCQAxFactory::SingleInstance\fR - The server can create only one instance of each supplied class..TP\fCQAxFactory::MultipleInstances\fR - The server can create multiple instances of each supplied class..SH MEMBER FUNCTION DOCUMENTATION.SH "QAxFactory::QAxFactory ( const QUuid & libid, const QUuid & appid )"Constructs a QAxFactory object that returns \fIlibid\fR and \fIappid\fR in the implementation of the respective interface functions..SH "QAxFactory::~QAxFactory ()\fC [virtual]\fR"Destroys the QAxFactory object..SH "QUuid QAxFactory::appID () const\fC [virtual]\fR"Reimplement this function to return the ActiveX server's application identifier..SH "QUuid QAxFactory::classID ( const QString & key ) const\fC [virtual]\fR"Reimplement this function to return the class identifier for each \fIkey\fR returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of \fIkey\fR..PPThe default implementation interprets \fIkey\fR as the class name, and returns the value of the Q_CLASSINFO entry "ClassID"..SH "QWidget * QAxFactory::create ( const QString & key, QWidget * parent = 0, const char * name = 0 )\fC [virtual]\fR"Reimplement this function to return a new widget for \fIkey\fR. Propagate \fIparent\fR and \fIname\fR to the QWidget constructor. Return 0 if this factory doesn't support the value of \fIkey\fR..PPThe returned widget will be exposed as an ActiveX control, e.g. a COM object that can be embedded as a control into applications..PPThe default implementation returns 0..SH "QObject * QAxFactory::createObject ( const QString & key, QObject * parent = 0, const char * name = 0 )\fC [virtual]\fR"Reimplement this function to return a new object for \fIkey\fR. Propagate \fIparent\fR and \fIname\fR to the QWidget constructor. Return 0 if this factory doesn't support the value of \fIkey\fR..PPIf the object returned is a QWidget it will be exposed as an ActiveX control, otherwise the returned object will be exposed as a COM object..PPThe default implementation returns the result QAxFactory::create() if \fIparent\fR is 0 or a widget, otherwise returns 0..SH "bool QAxFactory::createObjectWrapper ( QObject * object, IDispatch ** wrapper )\fC [virtual]\fR"Reimplement this function to provide the COM object for \fIobject\fR in \fIwrapper\fR. Return TRUE if the function was successfull, otherwise return FALSE..PPThe default implementation creates a generic automation wrapper based on the meta object information of \fIobject\fR..SH "QUuid QAxFactory::eventsID ( const QString & key ) const\fC [virtual]\fR"Reimplement this function to return the identifier of the event interface for each \fIkey\fR returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of \fIkey\fR..PPThe default implementation interprets \fIkey\fR as the class name, and returns the value of the Q_CLASSINFO entry "EventsID"..SH "QString QAxFactory::exposeToSuperClass ( const QString & key ) const\fC [virtual]\fR"Reimplement this function to return the name of the super class of \fIkey\fR up to which methods and properties should be exposed by the ActiveX control..PPThe default implementation interprets \fIkey\fR as the class name, and returns the value of the Q_CLASSINFO entry "ToSuperClass". If no such value is set the null-string is returned, and the functions and properties of all the super classes including QWidget will be exposed..PPTo only expose the functions and properties of the class itself, reimplement this function to return \fIkey\fR..SH "QStringList QAxFactory::featureList () const\fC [pure virtual]\fR"Reimplement this function to return a list of the widgets (class names) supported by this factory..SH "bool QAxFactory::hasStockEvents ( const QString & key ) const\fC [virtual]\fR"Reimplement this function to return TRUE if the ActiveX control \fIkey\fR should support the standard ActiveX events.TPClick.TPDblClick.TPKeyDown.TPKeyPress.TPKeyUp.TPMouseDown.TPMouseUp.TPMouseMove.PPThe default implementation interprets \fIkey\fR as the class name, and returns TRUE if the value of the Q_CLASSINFO entry "StockEvents" is "yes". Otherwise this function returns FALSE..SH "QUuid QAxFactory::interfaceID ( const QString & key ) const\fC [virtual]\fR"Reimplement this function to return the interface identifier for each \fIkey\fR returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of \fIkey\fR..PPThe default implementation interprets \fIkey\fR as the class name, and returns the value of the Q_CLASSINFO entry "InterfaceID"..SH "bool QAxFactory::isServer ()\fC [static]\fR"Returns TRUE if the application has been started (by COM) as an ActiveX server, otherwise returns FALSE..PP.nf.br int main( int argc, char**argv ).br {.br QApplication app( argc, argv );.br.br if ( !QAxFactory::isServer() ) {.br // initialize for stand-alone execution.br }.br.br return app.exec() // standard event processing.br }.br.fi.SH "bool QAxFactory::isService () const\fC [virtual]\fR"Reimplement this function to return TRUE if the server is running as a persistent service (e.g. an NT service) and should not terminate even when all objects provided have been released..PPThe default implementation returns FALSE..SH "QMetaObject * QAxFactory::metaObject ( const QString & key ) const\fC [virtual]\fR"Reimplement this function to return the QMetaObject corresponding to \fIkey\fR, or 0 if this factory doesn't support the value of \fIkey\fR..PPThe default implementation returns the QMetaObject for the class \fIkey\fR..SH "void QAxFactory::registerClass ( const QString & key, QSettings * settings ) const\fC [virtual]\fR"Registers additional values for the class \fIkey\fR in the system registry using the \fIsettings\fR object. The standard values have already been registed by the framework, but additional values, e.g. implemented categories, can be added in an implementation of this function..PP.nf.br settings->writeEntry( "/CLSID/" + classID(key) + "/Implemented Categories/{00000000-0000-0000-000000000000}/.", QString::null );.br.fi.PPIf you reimplement this function you must also reimplement unregisterClass() to remove the additional registry values..PPSee also QSettings..SH "QString QAxFactory::serverDirPath ()\fC [static]\fR"Returns the directory that contains the server binary..PPFor out-of-process servers this is the same as QApplication::applicationDirPath(). For in-process servers that function returns the directory that contains the hosting application..SH "QString QAxFactory::serverFilePath ()\fC [static]\fR"Returns the file path of the server binary..PPFor out-of-process servers this is the same as QApplication::applicationFilePath(). For in-process servers that function returns the file path of the hosting application..SH "bool QAxFactory::startServer ( ServerType type = MultipleInstances )\fC [static]\fR"Starts the COM server with \fItype\fR and returns TRUE if successful, otherwise returns FALSE..PPCalling this function if the server is already running (or for an in-process server) does nothing and returns TRUE..PPThe server is started automatically with \fItype\fR set to MultipleUse if the server executable has been started with the \fC-activex\fR command line parameter..SH "bool QAxFactory::stayTopLevel ( const QString & key ) const\fC [virtual]\fR"Reimplement this function to return TRUE if the ActiveX control \fIkey\fR should be a top level window, e.g. a dialog. The default implementation returns FALSE..SH "bool QAxFactory::stopServer ()\fC [static]\fR"Stops the COM server and returns TRUE if successful, otherwise returns FALSE..PPCalling this function if the server is not running (or for an in-process server) does nothing and returns TRUE..PPStopping the server will not invalidate existing objects, but no new objects can be created from the existing server process. Usually COM will start a new server process if additional objects are requested..PPThe server is stopped automatically when the main() function returns..SH "QUuid QAxFactory::typeLibID () const\fC [virtual]\fR"Reimplement this function to return the ActiveX server's type library identifier..SH "void QAxFactory::unregisterClass ( const QString & key, QSettings * settings ) const\fC [virtual]\fR"Unregisters any additional values for the class \fIkey\fR from the system registry using the \fIsettings\fR object..PP.nf.br settings->removeEntry( "/CLSID/" + classID(key) + "/Implemented Categories/{00000000-0000-0000-000000000000}/." );.br.fi.PPSee also registerClass() and QSettings..SH "bool QAxFactory::validateLicenseKey ( const QString & key, const QString & licenseKey ) const\fC [virtual]\fR"Reimplement this function to return TRUE if \fIlicenseKey\fR is a valid license for the class \fIkey\fR, or if the current machine is licensed..PPThe default implementation returns TRUE if the class \fIkey\fR is notlicensed (ie. no Q_CLASSINFO attribute "LicenseKey"), or if \fIlicenseKey\fR matches the value of the "LicenseKey" attribute, orif the machine is licensed through a .LIC file with the same filenameas this COM server..SH "SEE ALSO".BR http://doc.trolltech.com/qaxfactory.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qaxfactory.3qt) and the Qtversion (3.3.5).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -