FEATURE: access to the QScriptEngine
This commit is contained in:
parent
256532e240
commit
fb2db78521
@ -24,6 +24,7 @@
|
|||||||
#include <QtDeclarative/QDeclarativeItem>
|
#include <QtDeclarative/QDeclarativeItem>
|
||||||
#include <QtDeclarative/QDeclarativeEngine>
|
#include <QtDeclarative/QDeclarativeEngine>
|
||||||
#include <QtDeclarative/QDeclarativeContext>
|
#include <QtDeclarative/QDeclarativeContext>
|
||||||
|
#include <QScriptEngine>
|
||||||
#include <QGraphicsLinearLayout>
|
#include <QGraphicsLinearLayout>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@ -64,6 +65,7 @@ public:
|
|||||||
|
|
||||||
QString qmlPath;
|
QString qmlPath;
|
||||||
QDeclarativeEngine* engine;
|
QDeclarativeEngine* engine;
|
||||||
|
QScriptEngine *scriptEngine;
|
||||||
QDeclarativeComponent* component;
|
QDeclarativeComponent* component;
|
||||||
QObject *root;
|
QObject *root;
|
||||||
bool delay : 1;
|
bool delay : 1;
|
||||||
@ -96,6 +98,7 @@ void DeclarativeWidgetPrivate::execute(const QString &fileName)
|
|||||||
kdeclarative.initialize();
|
kdeclarative.initialize();
|
||||||
//binds things like kconfig and icons
|
//binds things like kconfig and icons
|
||||||
kdeclarative.setupBindings();
|
kdeclarative.setupBindings();
|
||||||
|
scriptEngine = kdeclarative.scriptEngine();
|
||||||
|
|
||||||
if (delay) {
|
if (delay) {
|
||||||
QTimer::singleShot(0, q, SLOT(scheduleExecutionEnd()));
|
QTimer::singleShot(0, q, SLOT(scheduleExecutionEnd()));
|
||||||
@ -213,6 +216,11 @@ QDeclarativeEngine* DeclarativeWidget::engine()
|
|||||||
return d->engine;
|
return d->engine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QScriptEngine *DeclarativeWidget::scriptEngine() const
|
||||||
|
{
|
||||||
|
return d->scriptEngine;
|
||||||
|
}
|
||||||
|
|
||||||
QObject *DeclarativeWidget::rootObject() const
|
QObject *DeclarativeWidget::rootObject() const
|
||||||
{
|
{
|
||||||
return d->root;
|
return d->root;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
class QDeclarativeEngine;
|
class QDeclarativeEngine;
|
||||||
class QDeclarativeComponent;
|
class QDeclarativeComponent;
|
||||||
|
class QScriptEngine;
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
@ -97,6 +98,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
QDeclarativeEngine* engine();
|
QDeclarativeEngine* engine();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the script engine used by the declarative engine
|
||||||
|
* @since 4.7
|
||||||
|
*/
|
||||||
|
QScriptEngine *scriptEngine() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the root object of the declarative object tree
|
* @return the root object of the declarative object tree
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user