aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qquickcanvas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/items/qquickcanvas.cpp')
-rw-r--r--src/declarative/items/qquickcanvas.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/declarative/items/qquickcanvas.cpp b/src/declarative/items/qquickcanvas.cpp
index c6969b5cda..8022af98f4 100644
--- a/src/declarative/items/qquickcanvas.cpp
+++ b/src/declarative/items/qquickcanvas.cpp
@@ -532,6 +532,23 @@ void QQuickCanvasPrivate::init(QQuickCanvas *c)
q->setFormat(context->defaultSurfaceFormat());
}
+QDeclarativeListProperty<QObject> QQuickCanvasPrivate::data()
+{
+ initRootItem();
+ return QQuickItemPrivate::get(rootItem)->data();
+}
+
+void QQuickCanvasPrivate::initRootItem()
+{
+ Q_Q(QQuickCanvas);
+ q->connect(q, SIGNAL(widthChanged(int)),
+ rootItem, SLOT(setWidth(int)));
+ q->connect(q, SIGNAL(heightChanged(int)),
+ rootItem, SLOT(setHeight(int)));
+ rootItem->setWidth(q->width());
+ rootItem->setHeight(q->height());
+}
+
void QQuickCanvasPrivate::transformTouchPoints(QList<QTouchEvent::TouchPoint> &touchPoints, const QTransform &transform)
{
for (int i=0; i<touchPoints.count(); i++) {
@@ -815,6 +832,14 @@ void QQuickCanvasPrivate::cleanup(QSGNode *n)
/*!
+ \qmlclass Window QQuickCanvas
+ \inqmlmodule QtQuick.Window 2
+ \brief The Window object creates a new top-level window.
+
+ The Window object creates a new top-level window for a QtQuick scene. It automatically sets up the
+ window for use with QtQuick 2.0 graphical elements.
+*/
+/*!
\class QQuickCanvas
\since QtQuick 2.0
\brief The QQuickCanvas class provides the canvas for displaying a graphical QML scene
@@ -894,6 +919,14 @@ QQuickItem *QQuickCanvas::mouseGrabberItem() const
}
+/*!
+ \qmlproperty color QtQuick2.Window::Window::color
+
+ The background color for the window.
+
+ Setting this property is more efficient than using a separate Rectangle.
+*/
+
bool QQuickCanvasPrivate::clearHover()
{
if (hoverItems.isEmpty())
@@ -2131,7 +2164,10 @@ QSGTexture *QQuickCanvas::createTextureFromId(uint id, const QSize &size, Create
void QQuickCanvas::setClearColor(const QColor &color)
{
+ if (color == d_func()->clearColor)
+ return;
d_func()->clearColor = color;
+ emit clearColorChanged(color);
}