ArnLib
4.0.x
Active Registry Network
|
ARN QML. More...
#include <ArnQml.hpp>
Classes | |
struct | UseFlags |
Static Public Member Functions | |
static void | setup (QML_ENGINE *qmlEngine, UseFlags flags=UseFlags::ArnLib) |
Add ArnLib support to a Qml instance. More... | |
static ArnQml & | instance () |
static QString | arnRootPath () |
Gives current ARN root path for all qml instances. More... | |
static void | setArnRootPath (const QString &path) |
Change ARN root path for all qml instances. More... | |
ARN QML.
This class is the central point for ArnQml. It's a singleton that is setup in the application. ArnQml can be used for creating GUI-applications in Qml that has integrated access to the ARN objects and some of the ArnLib funtionality.
For information about available ArnLib components in Qml see:
QmlType | See |
---|---|
Arn | ArnInterface |
ArnItem | ArnItemQml |
ArnMonitor | ArnMonitorQml |
ArnSapi | ArnSapiQml |
XStringMap | XStringMapQml |
If the Qml code must run in both Quick1 (Qt4) and Quick2 (Qt5), following apply: Only Quick1 code will be able to run in both environments. When this code is run in Quick2 its "import QtQuick 1" will be changed internally to "import QtQuick 2". "arn" is now an instantiation of ArnInterface and "Arn" is the type. In qml "arn.quickTypeRun" will give a 1 when running in a QtQuick1 environment and a 2 for QtQuick2.
When the Qml code only is to be run in Quick2 it should use "import QtQuick 2". In this case "Arn" will be a singleton instantiation of ArnInterface. "arn" is then not needed.
ArnBrowser is using this class to run Qml applications in an opaque style, i.e. without specific application support. This resembles somewhat a web browser running a web application.
Note that you must not use any empty folders in QUrl for an ARN path. Example: path "//Qml/test.qml" can be set to the equal path "/@/Qml/test.qml". Also this conversion can be made by Arn::convertPath("//Qml/test.qml", Arn::NameF()).
Example usage
Definition at line 183 of file ArnQml.hpp.
|
static |
Gives current ARN root path for all qml instances.
Definition at line 60 of file ArnQml.cpp.
|
static |
Definition at line 119 of file ArnQml.cpp.
|
static |
Change ARN root path for all qml instances.
This is set once in the application and must be set before any qml instances are setup.
Example: setArnRootPath("/@myHost/"); will map a path "/Test/value" in Qml to an ARN object at path "/@myHost/Test/value".
[in] | path | is the root path |
Definition at line 66 of file ArnQml.cpp.
|
static |
Add ArnLib support to a Qml instance.
ArnLib module is always included.
[in] | qmlEngine | is the qml instance engine |
[in] | flags | gives the modules to include |
Definition at line 82 of file ArnQml.cpp.