Plasma
Plasma::DeclarativeWidget Class Reference
A widget that contains an entire QML context, with its own declarative engine. More...
#include <declarativewidget.h>

Signals | |
| void | finished () |
Public Member Functions | |
| DeclarativeWidget (QGraphicsWidget *parent=0) | |
| ~DeclarativeWidget () | |
| QDeclarativeEngine * | engine () |
| bool | isInitializationDelayed () const |
| QDeclarativeComponent * | mainComponent () const |
| QString | qmlPath () const |
| QObject * | rootObject () const |
| void | setInitializationDelayed (const bool delay) |
| void | setQmlPath (const QString &path) |
Protected Member Functions | |
| void | resizeEvent (QGraphicsSceneResizeEvent *event) |
Properties | |
| bool | initializationDelayed |
| QString | qmlPath |
| QObject | rootObject |
Detailed Description
A widget that contains an entire QML context, with its own declarative engine.
Plasma::DeclarativeWidget provides a class for conveniently use QML based declarative user interfaces inside Plasma widgets. To one DeclarativeWidget corresponds one QML file (that can eventually include others) tere will be its own QDeclarativeEngine with a single root object, described in the QML file.
Definition at line 48 of file declarativewidget.h.
Constructor & Destructor Documentation
| Plasma::DeclarativeWidget::DeclarativeWidget | ( | QGraphicsWidget * | parent = 0 | ) | [explicit] |
Constructs a new DeclarativeWidget.
- Parameters:
-
parent the parent of this widget
Definition at line 164 of file declarativewidget.cpp.
| Plasma::DeclarativeWidget::~DeclarativeWidget | ( | ) |
Definition at line 179 of file declarativewidget.cpp.
Member Function Documentation
| QDeclarativeEngine * Plasma::DeclarativeWidget::engine | ( | ) |
- Returns:
- the declarative engine that runs the qml file assigned to this widget.
Definition at line 205 of file declarativewidget.cpp.
| void Plasma::DeclarativeWidget::finished | ( | ) | [signal] |
Emitted when the parsing and execution of the QML file is terminated.
| bool Plasma::DeclarativeWidget::isInitializationDelayed | ( | ) | const |
- Returns:
- true if the initilization of the QML file will be delayed at the end of the event loop
Definition at line 200 of file declarativewidget.cpp.
| QDeclarativeComponent * Plasma::DeclarativeWidget::mainComponent | ( | ) | const |
- Returns:
- the main QDeclarativeComponent of the engine
Definition at line 215 of file declarativewidget.cpp.
| QString Plasma::DeclarativeWidget::qmlPath | ( | ) | const |
- Returns:
- the absolute path of the current QML file
| void Plasma::DeclarativeWidget::resizeEvent | ( | QGraphicsSceneResizeEvent * | event | ) | [protected] |
Definition at line 220 of file declarativewidget.cpp.
| QObject* Plasma::DeclarativeWidget::rootObject | ( | ) | const |
- Returns:
- the root object of the declarative object tree
| void Plasma::DeclarativeWidget::setInitializationDelayed | ( | const bool | delay | ) |
Sets whether the execution of the QML file has to be delayed later in the event loop.
It has to be called before setQmlPath(). In this case will be possible to assign new objects in the main engine context before the main component gets initialized. So it will be possible to access it immediately from the QML code.
- Parameters:
-
delay if true the initilization of the QML file will be delayed at the end of the event loop
Definition at line 195 of file declarativewidget.cpp.
| void Plasma::DeclarativeWidget::setQmlPath | ( | const QString & | path | ) |
Sets the path of the QML file to parse and execute.
- Parameters:
-
path the absolute path of a QML file
Definition at line 184 of file declarativewidget.cpp.
Property Documentation
bool Plasma::DeclarativeWidget::initializationDelayed [read, write] |
Definition at line 53 of file declarativewidget.h.
QString Plasma::DeclarativeWidget::qmlPath [read, write] |
Definition at line 52 of file declarativewidget.h.
QObject * Plasma::DeclarativeWidget::rootObject [read] |
Definition at line 54 of file declarativewidget.h.
The documentation for this class was generated from the following files:
KDE 4.6 API Reference