Update documentation for connections editor

We added a new tab called backends.
I also updated all the screenshot, so they
contain the new tab.

Change-Id: Ib66ffbd3a48383f621a482241cde12caef9ca7b4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Thomas Hartmann
2016-10-18 16:35:50 +02:00
committed by Thomas Hartmann
parent 2c8087d9ba
commit 69663871fc
6 changed files with 54 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -41,6 +41,8 @@
\li Create bindings between the properties of two objects. \li Create bindings between the properties of two objects.
\li Manage backend QObjects.
\endlist \endlist
For examples of adding connections, see For examples of adding connections, see
@@ -125,4 +127,53 @@
\endlist \endlist
\section1 Managing C++ Backend Objects
Many applications provide QObject objects implemented in C++ that work as a
bridge between QML and C++. Such objects are typically registered with
qmlRegisterType or qmlRegisterSingletonType and then used by QML to
communicate with the C++ backend. Another example of such objects are the
state machines created by the \l {Using the Qt SCXML Compiler (qscxmlc)}
{Qt SCXML Compiler}.
Backend objects in a QML file are accessible if the QML file contains the
required imports. In addition, for a non-singleton QObject, a dynamic
property that contains the QObject must be specified.
A \e local QObject is instantiated in the current \e .qml file, as follows:
\badcode
property MyType myType: MyType {}.
\endcode
Otherwise the property is just defined, as follows:
\badcode
property MyType myType
\endcode
To manage backend objects:
\list 1
\li Select the \uicontrol Backends tab to view accessible backend
objects.
\image qmldesigner-backends.png
\li Select the \inlineimage plus.png
(\uicontrol Add) button to add a backend object in the
\uicontrol {Add New C++ Backend} dialog.
\li In the \uicontrol Type field, select the type of the backend QObject
to add.
\li Select the \uicontrol {Define object locally} check box if the
QObject is not registered as a singleton.
\li Select \uicontrol OK to add the required import and to create the
property for a non-singleton object.
\endlist
*/ */

View File

@@ -52,6 +52,9 @@
is available, and therefore, you must explicitly generate type information is available, and therefore, you must explicitly generate type information
for QML modules with plugins before distributing them. for QML modules with plugins before distributing them.
Classes registered with \c qmlRegisterType() can be used as backend objects
in the \QMLD. For more information, see \l {Adding Connections}.
Ideally, QML modules have a \c{plugins.qmltypes} file in the same directory Ideally, QML modules have a \c{plugins.qmltypes} file in the same directory
as the \c qmldir file. The \c qmltypes file contains a description of the as the \c qmldir file. The \c qmltypes file contains a description of the
types exported by the module's plugins and is loaded by \QC when the types exported by the module's plugins and is loaded by \QC when the