[gegl-qt] NodeViewGraphicsWidget: Also use child QGraphicsItem



commit 06099c9e92e8a6018499b6166579740832f0fa0b
Author: Jon Nordby <jononor gmail com>
Date:   Sat Sep 24 21:36:57 2011 +0200

    NodeViewGraphicsWidget: Also use child QGraphicsItem

 gegl-qt/nodeviewgraphicswidget.cpp |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/gegl-qt/nodeviewgraphicswidget.cpp b/gegl-qt/nodeviewgraphicswidget.cpp
index 0d64686..1efeb02 100644
--- a/gegl-qt/nodeviewgraphicswidget.cpp
+++ b/gegl-qt/nodeviewgraphicswidget.cpp
@@ -23,10 +23,10 @@ using namespace GeglQt;
 
 NodeViewGraphicsWidget::NodeViewGraphicsWidget(QGraphicsItem * parent)
     : QGraphicsWidget(parent)
-    , priv(new NodeViewImplementation())
+    , priv(new NodeViewImplementation(NodeViewImplementation::DrawModeChildGraphicsItem))
 {
-    connect(priv, SIGNAL(viewAreaChanged(QRectF)),
-            this, SLOT(invalidate(QRectF)));
+    priv->childItem()->setParentItem(static_cast<QGraphicsItem *>(this));
+
     connect(priv, SIGNAL(viewportSizeRequest(QSizeF)),
             this, SLOT(viewportSizeChangeRequested(QSizeF)));
 
@@ -61,11 +61,8 @@ NodeViewGraphicsWidget::options() const
 void
 NodeViewGraphicsWidget::invalidate(QRectF rect)
 {
-    if (rect.isValid()) {
-        update(rect);
-    } else {
-        update(boundingRect());
-    }
+    // Handled by implementation
+    Q_UNUSED(rect);
 }
 
 void
@@ -79,8 +76,10 @@ NodeViewGraphicsWidget::paint(QPainter *painter,
                                 const QStyleOptionGraphicsItem *option,
                                 QWidget *widget)
 {
+    // Handled by implementation
     Q_UNUSED(widget);
-    priv->paint(painter, option->exposedRect);
+    Q_UNUSED(option);
+    Q_UNUSED(painter);
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]