diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/activeqt/container/qaxobject.h | 6 | ||||
-rw-r--r-- | src/activeqt/container/qaxscript.h | 2 | ||||
-rw-r--r-- | src/activeqt/container/qaxwidget.h | 18 | ||||
-rw-r--r-- | src/activeqt/control/qaxfactory.h | 61 | ||||
-rw-r--r-- | src/activeqt/doc/src/qtaxserver.qdoc | 8 |
5 files changed, 67 insertions, 28 deletions
diff --git a/src/activeqt/container/qaxobject.h b/src/activeqt/container/qaxobject.h index fd18c98..5ce5835 100644 --- a/src/activeqt/container/qaxobject.h +++ b/src/activeqt/container/qaxobject.h @@ -61,11 +61,11 @@ public: bool doVerb(const QString &verb); protected: - void connectNotify(const QMetaMethod &signal); - const QMetaObject *fallbackMetaObject() const; + void connectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE; + const QMetaObject *fallbackMetaObject() const Q_DECL_OVERRIDE; private: - const QMetaObject *parentMetaObject() const; + const QMetaObject *parentMetaObject() const Q_DECL_OVERRIDE; }; template <> inline QAxObject *qobject_cast<QAxObject*>(const QObject *o) diff --git a/src/activeqt/container/qaxscript.h b/src/activeqt/container/qaxscript.h index 8abd72a..ef2ae0a 100644 --- a/src/activeqt/container/qaxscript.h +++ b/src/activeqt/container/qaxscript.h @@ -82,7 +82,7 @@ public: long queryInterface(const QUuid &, void**) const; protected: - bool initialize(IUnknown** ptr); + bool initialize(IUnknown** ptr) Q_DECL_OVERRIDE; private: QAxScript *script_code; diff --git a/src/activeqt/container/qaxwidget.h b/src/activeqt/container/qaxwidget.h index 4792d0e..421933d 100644 --- a/src/activeqt/container/qaxwidget.h +++ b/src/activeqt/container/qaxwidget.h @@ -56,19 +56,19 @@ class QAxWidget : public QWidget, public QAxBase { Q_OBJECT_FAKE public: - QObject* qObject() const { return (QWidget*)this; } - const char *className() const; + QObject* qObject() const Q_DECL_OVERRIDE { return (QWidget*)this; } + const char *className() const Q_DECL_OVERRIDE; 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); ~QAxWidget(); - void clear(); + void clear() Q_DECL_OVERRIDE; bool doVerb(const QString &verb); - QSize sizeHint() const; - QSize minimumSizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; + QSize minimumSizeHint() const Q_DECL_OVERRIDE; virtual QAxAggregated *createAggregate(); @@ -77,13 +77,13 @@ protected: virtual bool createHostWindow(bool); bool createHostWindow(bool, const QByteArray&); - void changeEvent(QEvent *e); - void resizeEvent(QResizeEvent *); + void changeEvent(QEvent *e) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; virtual bool translateKeyEvent(int message, int keycode) const; - void connectNotify(const QMetaMethod &signal); - const QMetaObject *fallbackMetaObject() const; + void connectNotify(const QMetaMethod &signal) Q_DECL_OVERRIDE; + const QMetaObject *fallbackMetaObject() const Q_DECL_OVERRIDE; private: friend class QAxClientSite; QAxClientSite *container; diff --git a/src/activeqt/control/qaxfactory.h b/src/activeqt/control/qaxfactory.h index 0ae6cd4..e5745f8 100644 --- a/src/activeqt/control/qaxfactory.h +++ b/src/activeqt/control/qaxfactory.h @@ -46,6 +46,7 @@ #include <QtCore/qfactoryinterface.h> #include <QtCore/qmetaobject.h> #include <QtCore/qstringlist.h> +#include <QtCore/qsettings.h> struct IUnknown; struct IDispatch; @@ -188,9 +189,9 @@ public: : QAxFactory(libId, appId) {} - const QMetaObject *metaObject(const QString &) const { return &T::staticMetaObject; } - QStringList featureList() const { return QStringList(QLatin1String(T::staticMetaObject.className())); } - QObject *createObject(const QString &key) + const QMetaObject *metaObject(const QString &) const Q_DECL_OVERRIDE { return &T::staticMetaObject; } + QStringList featureList() const Q_DECL_OVERRIDE { return QStringList(QLatin1String(T::staticMetaObject.className())); } + QObject *createObject(const QString &key) Q_DECL_OVERRIDE { const QMetaObject &mo = T::staticMetaObject; if (key != QLatin1String(mo.className())) @@ -199,6 +200,36 @@ public: return 0; return new T(0); } + + void registerClass(const QString &key, QSettings *settings) const Q_DECL_OVERRIDE + { + const QStringList categories = getImplementedCategories(); + + for (QStringList::const_iterator it = categories.begin(), end = categories.end(); it != end; ++it) { + settings->setValue(QLatin1String("/CLSID/") + classID(key).toString() + + QLatin1String("/Implemented Categories/") + *it + QLatin1String("/."), + QString()); + } + } + + void unregisterClass(const QString &key, QSettings *settings) const Q_DECL_OVERRIDE + { + const QStringList categories = getImplementedCategories(); + + for (QStringList::const_iterator it = categories.begin(), end = categories.end(); it != end; ++it) { + settings->remove(QLatin1String("/CLSID/") + classID(key).toString() + + QLatin1String("/Implemented Categories/") + *it + QLatin1String("/.")); + } + } + +private: + /*! Retrieve list of comma-separated "Implemented Categories" Q_CLASSINFO UUIDs from T. */ + static QStringList getImplementedCategories() + { + const QMetaObject &mo = T::staticMetaObject; + QString catids = mo.classInfo(mo.indexOfClassInfo("Implemented Categories")).value(); + return catids.split(QLatin1Char(',')); + } }; #define QAXFACTORY_BEGIN(IDTypeLib, IDApp) \ @@ -238,47 +269,47 @@ public: #define QAXFACTORY_END() \ } \ - ~QAxFactoryList() { qDeleteAll(factories); } \ - QStringList featureList() const { return factoryKeys; } \ - const QMetaObject *metaObject(const QString&key) const { \ + ~QAxFactoryList() Q_DECL_OVERRIDE { qDeleteAll(factories); } \ + QStringList featureList() const Q_DECL_OVERRIDE { return factoryKeys; } \ + const QMetaObject *metaObject(const QString&key) const Q_DECL_OVERRIDE { \ QAxFactory *f = factories[key]; \ return f ? f->metaObject(key) : 0; \ } \ - QObject *createObject(const QString &key) { \ + QObject *createObject(const QString &key) Q_DECL_OVERRIDE { \ if (!creatable.value(key)) \ return 0; \ QAxFactory *f = factories[key]; \ return f ? f->createObject(key) : 0; \ } \ - QUuid classID(const QString &key) { \ + QUuid classID(const QString &key) const Q_DECL_OVERRIDE { \ QAxFactory *f = factories.value(key); \ return f ? f->classID(key) : QUuid(); \ } \ - QUuid interfaceID(const QString &key) { \ + QUuid interfaceID(const QString &key) const Q_DECL_OVERRIDE { \ QAxFactory *f = factories.value(key); \ return f ? f->interfaceID(key) : QUuid(); \ } \ - QUuid eventsID(const QString &key) { \ + QUuid eventsID(const QString &key) const Q_DECL_OVERRIDE { \ QAxFactory *f = factories.value(key); \ return f ? f->eventsID(key) : QUuid(); \ } \ - void registerClass(const QString &key, QSettings *s) const { \ + void registerClass(const QString &key, QSettings *s) const Q_DECL_OVERRIDE { \ QAxFactory *f = factories.value(key); \ if (f) f->registerClass(key, s); \ } \ - void unregisterClass(const QString &key, QSettings *s) const { \ + void unregisterClass(const QString &key, QSettings *s) const Q_DECL_OVERRIDE { \ QAxFactory *f = factories.value(key); \ if (f) f->unregisterClass(key, s); \ } \ - QString exposeToSuperClass(const QString &key) const { \ + QString exposeToSuperClass(const QString &key) const Q_DECL_OVERRIDE { \ QAxFactory *f = factories.value(key); \ return f ? f->exposeToSuperClass(key) : QString(); \ } \ - bool stayTopLevel(const QString &key) const { \ + bool stayTopLevel(const QString &key) const Q_DECL_OVERRIDE { \ QAxFactory *f = factories.value(key); \ return f ? f->stayTopLevel(key) : false; \ } \ - bool hasStockEvents(const QString &key) const { \ + bool hasStockEvents(const QString &key) const Q_DECL_OVERRIDE { \ QAxFactory *f = factories.value(key); \ return f ? f->hasStockEvents(key) : false; \ } \ diff --git a/src/activeqt/doc/src/qtaxserver.qdoc b/src/activeqt/doc/src/qtaxserver.qdoc index 4aca87c..7e39ccb 100644 --- a/src/activeqt/doc/src/qtaxserver.qdoc +++ b/src/activeqt/doc/src/qtaxserver.qdoc @@ -816,6 +816,14 @@ \li The classname used in the generated IDL and in the registry. This is esp. useful for C++ classes that live in a namespace - by default, ActiveQt just removes the "::" to make the IDL compile. + \row + \li Implemented Categories + \li List of comma-separated Category ID (CATID) UUIDs. Generic mechanism + for specifying additional container capabilities, in addition to + "control", "insertable" etc. Typical CATIDs include + \c CATID_InternetAware ("{0DE86A58-2BAA-11CF-A229-00AA003D7352}"), + \c CATID_SafeForScripting ("{7DD95801-9882-11CF-9FA9-00AA006C42C4}") as + well as user-defined CATID values. \endtable Note that both keys and values are case sensitive. |