![]() |
Home · All Classes · All Functions · Overviews |
The GraphicsObjectContainer element allows you to add QGraphicsObjects into Fluid UI elements. More...
While any QObject based class can be exposed to QML, QDeclarativeItem provides a lot of important functionality, including anchors and proper management of child items. GraphicsObjectContainer helps provide these functions to other QGraphicsObjects, so that they can be used unaltered in a QML scene. QGraphicsObjects, which are not QDeclarativeItems, and which are placed in a QML scene outside of a GraphicsObjectContainer, will not appear on screen at all.
A GraphicsObjectContainer can have one element inside it, and it must be a QGraphicsObject or subclass which has been exposed to the QML engine. The graphics object inside the GraphicsObjectContainer can then be used like any other item in QML with the exception of not being reparentable and not having the standard properties of QML items (such as anchors).
As the contained object is positioned relative to the container, anchors affecting the container item will affect the onscreen position of the contained item. If synchronizedResizing is set to true, then anchors affecting the container item's size will also affect the contained item's size.
Example:
import Qt 4.6 import MyApp 2.1 as Widgets Rectangle{ id: rect property alias widgetPropertyThree: widget.myThirdProperty; GraphicsObjectContainer{ synchronizedResizing: true anchors.margins: 10 anchors.fill: parent Widgets.MyWidget{ myProperty: "A Value" myOtherProperty: rect.color } } }
graphicsObject : QGraphicsObject |
The QGraphicsObject associated with this element.
synchronizedResizing : bool |
This property determines whether or not the container and graphics object will synchronize their sizes.
Note: This property only applies when wrapping a QGraphicsWidget.
If synchronizedResizing is enabled, the container and widget will synchronize their sizes as follows.
Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies) | Trademarks | Qt 4.7.0 |