Qt 4.8
Public Functions | List of all members
QAxClass< T > Class Template Reference

#include <qaxfactory.h>

Inheritance diagram for QAxClass< T >:
QAxFactory QObject

Public Functions

QObjectcreateObject (const QString &key)
 Reimplement this function to return a new object for key, or 0 if this factory doesn't support the value of key. More...
 
QStringList featureList () const
 Reimplement this function to return a list of the widgets (class names) supported by this factory. More...
 
const QMetaObjectmetaObject (const QString &) const
 Reimplement this function to return the QMetaObject corresponding to key, or 0 if this factory doesn't support the value of key. More...
 
 QAxClass (const QString &libId, const QString &appId)
 
- Public Functions inherited from QAxFactory
virtual QUuid appID () const
 Reimplement this function to return the ActiveX server's application identifier. More...
 
virtual QUuid classID (const QString &key) const
 Reimplement this function to return the class identifier for each key returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of key. More...
 
virtual bool createObjectWrapper (QObject *object, IDispatch **wrapper)
 Reimplement this function to provide the COM object for object in wrapper. More...
 
virtual QUuid eventsID (const QString &key) const
 Reimplement this function to return the identifier of the event interface for each key returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of key. More...
 
virtual QString exposeToSuperClass (const QString &key) const
 Reimplement this function to return the name of the super class of key up to which methods and properties should be exposed by the ActiveX control. More...
 
virtual bool hasStockEvents (const QString &key) const
 Reimplement this function to return true if the ActiveX control key should support the standard ActiveX events. More...
 
virtual QUuid interfaceID (const QString &key) const
 Reimplement this function to return the interface identifier for each key returned by the featureList() implementation, or an empty QUuid if this factory doesn't support the value of key. More...
 
virtual bool isService () const
 Reimplement this function to return true if the server is running as a persistent service (e.g. More...
 
 QAxFactory (const QUuid &libId, const QUuid &appId)
 Constructs a QAxFactory object that returns libid and appid in the implementation of the respective interface functions. More...
 
virtual void registerClass (const QString &key, QSettings *) const
 Registers additional values for the class key in the system registry using the settings object. More...
 
virtual bool stayTopLevel (const QString &key) const
 Reimplement this function to return true if the ActiveX control key should be a top level window, e.g. More...
 
virtual QUuid typeLibID () const
 Reimplement this function to return the ActiveX server's type library identifier. More...
 
virtual void unregisterClass (const QString &key, QSettings *) const
 Unregisters any additional values for the class key from the system registry using the settings object. More...
 
virtual bool validateLicenseKey (const QString &key, const QString &licenseKey) const
 Reimplement this function to return true if licenseKey is a valid license for the class key, or if the current machine is licensed. More...
 
virtual ~QAxFactory ()
 Destroys the QAxFactory object. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Additional Inherited Members

- Public Types inherited from QAxFactory
enum  ServerType { SingleInstance, MultipleInstances }
 This enum specifies the different types of servers that can be started with startServer. More...
 
- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Functions inherited from QAxFactory
static bool isServer ()
 Returns true if the application has been started (by COM) as an ActiveX server, otherwise returns false. More...
 
static bool registerActiveObject (QObject *object)
 Registers the QObject object with COM as a running object, and returns true if the registration succeeded, otherwise returns false. More...
 
static QString serverDirPath ()
 Returns the directory that contains the server binary. More...
 
static QString serverFilePath ()
 Returns the file path of the server binary. More...
 
static bool startServer (ServerType type=MultipleInstances)
 Starts the COM server with type and returns true if successful, otherwise returns false. More...
 
static bool stopServer ()
 Stops the COM server and returns true if successful, otherwise returns false. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

template<class T>
class QAxClass< T >

Definition at line 188 of file qaxfactory.h.

Constructors and Destructors

◆ QAxClass()

template<class T>
QAxClass< T >::QAxClass ( const QString libId,
const QString appId 
)
inline

Definition at line 191 of file qaxfactory.h.

192  : QAxFactory(libId, appId)
193  {}
QAxFactory(const QUuid &libId, const QUuid &appId)
Constructs a QAxFactory object that returns libid and appid in the implementation of the respective i...
Definition: qaxfactory.cpp:103

Functions

◆ createObject()

template<class T>
QObject* QAxClass< T >::createObject ( const QString key)
inlinevirtual

Reimplement this function to return a new object for key, or 0 if this factory doesn't support the value of key.

If the object returned is a QWidget it will be exposed as an ActiveX control, otherwise the returned object will be exposed as a simple COM object.

Implements QAxFactory.

Definition at line 197 of file qaxfactory.h.

198  {
199  const QMetaObject &mo = T::staticMetaObject;
200  if (key != QLatin1String(mo.className()))
201  return 0;
202  if (!qstrcmp(mo.classInfo(mo.indexOfClassInfo("Creatable")).value(), "no"))
203  return 0;
204  return new T(0);
205  }
The QMetaObject class contains meta-information about Qt objects.
Definition: qobjectdefs.h:304
QMetaClassInfo classInfo(int index) const
Returns the meta-data for the item of class information with the given index.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
const char * className() const
Returns the class name.
Definition: qobjectdefs.h:491
int qstrcmp(const QByteArray &str1, const char *str2)
Definition: qbytearray.cpp:336
int indexOfClassInfo(const char *name) const
Finds class information item name and returns its index; otherwise returns -1.

◆ featureList()

template<class T>
QStringList QAxClass< T >::featureList ( ) const
inlinevirtual

Reimplement this function to return a list of the widgets (class names) supported by this factory.

Implements QAxFactory.

Definition at line 196 of file qaxfactory.h.

196 { return QStringList(QString(T::staticMetaObject.className())); }
The QString class provides a Unicode character string.
Definition: qstring.h:83
const char * className
Definition: qwizard.cpp:137
The QStringList class provides a list of strings.
Definition: qstringlist.h:66

◆ metaObject()

template<class T>
const QMetaObject* QAxClass< T >::metaObject ( const QString key) const
inlinevirtual

Reimplement this function to return the QMetaObject corresponding to key, or 0 if this factory doesn't support the value of key.

Implements QAxFactory.

Definition at line 195 of file qaxfactory.h.

195 { return &T::staticMetaObject; }

The documentation for this class was generated from the following file: