diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-02-19 14:29:33 (GMT) |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-02-19 15:09:36 (GMT) |
commit | af9bee69a9d902cffb4b590012cba79328fd2a1b (patch) | |
tree | 22619975d4743bafe8cef35ab7e517adaf86bfae /src | |
parent | 94164f66a6f3272e63b2fe12f63fba91d16ab0f0 (diff) | |
download | Qt-af9bee69a9d902cffb4b590012cba79328fd2a1b.zip Qt-af9bee69a9d902cffb4b590012cba79328fd2a1b.tar.gz Qt-af9bee69a9d902cffb4b590012cba79328fd2a1b.tar.bz2 |
Added QmlExtensionPlugin and QmlExtensionInterface.
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qml.pri | 9 | ||||
-rw-r--r-- | src/declarative/qml/qmlextensioninterface.h | 25 | ||||
-rw-r--r-- | src/declarative/qml/qmlextensionplugin.cpp | 12 | ||||
-rw-r--r-- | src/declarative/qml/qmlextensionplugin.h | 31 |
4 files changed, 75 insertions, 2 deletions
diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index 5e0c3e0..6c74863 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -52,7 +52,9 @@ SOURCES += \ $$PWD/qmlworkerscript.cpp \ $$PWD/qmlimageprovider.cpp \ $$PWD/qmlnetworkaccessmanagerfactory.cpp \ - $$PWD/qmldirparser.cpp + $$PWD/qmldirparser.cpp \ + $$PWD/qmlextensionplugin.cpp + HEADERS += \ $$PWD/qmlparser_p.h \ $$PWD/qmlglobal_p.h \ @@ -121,7 +123,10 @@ HEADERS += \ $$PWD/qmlguard_p.h \ $$PWD/qmlimageprovider.h \ $$PWD/qmlnetworkaccessmanagerfactory.h \ - $$PWD/qmldirparser_p.h + $$PWD/qmldirparser_p.h \ + $$PWD/qmlextensioninterface.h \ + $$PWD/qmlextensionplugin.h + QT += sql include(parser/parser.pri) include(rewriter/rewriter.pri) diff --git a/src/declarative/qml/qmlextensioninterface.h b/src/declarative/qml/qmlextensioninterface.h new file mode 100644 index 0000000..d336e6e --- /dev/null +++ b/src/declarative/qml/qmlextensioninterface.h @@ -0,0 +1,25 @@ +#ifndef QMLEXTENSIONINTERFACE_H +#define QMLEXTENSIONINTERFACE_H + +#include <QtCore/qobject.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlEngine; + +struct Q_DECLARATIVE_EXPORT QmlExtensionInterface +{ + virtual void initialize(QmlEngine *engine) = 0; +}; + +Q_DECLARE_INTERFACE(QmlExtensionInterface, "com.trolltech.Qt.QmlExtensionInterface/1.0") + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMLEXTENSIONINTERFACE_H diff --git a/src/declarative/qml/qmlextensionplugin.cpp b/src/declarative/qml/qmlextensionplugin.cpp new file mode 100644 index 0000000..15ad44e --- /dev/null +++ b/src/declarative/qml/qmlextensionplugin.cpp @@ -0,0 +1,12 @@ + +#include "qmlextensionplugin.h" + +QmlExtensionPlugin::QmlExtensionPlugin(QObject *parent) + : QObject(parent) +{ +} + +QmlExtensionPlugin::~QmlExtensionPlugin() +{ +} + diff --git a/src/declarative/qml/qmlextensionplugin.h b/src/declarative/qml/qmlextensionplugin.h new file mode 100644 index 0000000..8f3194f --- /dev/null +++ b/src/declarative/qml/qmlextensionplugin.h @@ -0,0 +1,31 @@ +#ifndef QMLEXTENSIONPLUGIN_H +#define QMLEXTENSIONPLUGIN_H + +#include <QtCore/qplugin.h> + +#include "qmlextensioninterface.h" + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlEngine; + +class Q_DECLARATIVE_EXPORT QmlExtensionPlugin : public QObject, public QmlExtensionInterface +{ + Q_OBJECT + Q_INTERFACES(QmlExtensionInterface) +public: + explicit QmlExtensionPlugin(QObject *parent = 0); + ~QmlExtensionPlugin(); + + virtual void initialize(QmlEngine *engine) = 0; +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QMLEXTENSIONPLUGIN_H |