[Kst] branches/work/kst/portto4/kst/src/libkstapp

Adam Treat treat at kde.org
Sat Jun 9 01:23:49 CEST 2007


SVN commit 673087 by treat:

* This seems to work better.



 M  +8 -6      viewitem.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.cpp #673086:673087
@@ -50,17 +50,19 @@
 
 
 void ViewItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
-  QRectF bound = mapToScene(boundingRect()).boundingRect();
-  painter->save();
-  painter->resetTransform();
-//   painter->drawRect(bound);
+  QPainter p(widget);
+  p.setPen(Qt::DotLine);
 
+  QRectF bound = parentView()->mapFromScene(mapToScene(boundingRect())).boundingRect();
+  p.drawRect(bound);
+
 #ifdef DEBUG_GEOMETRY
   QColor semiRed(QColor(255, 0, 0, 50));
-  painter->fillRect(bound, semiRed);
+  p.fillRect(bound, semiRed);
 #endif
+  p.end();
 
-  painter->restore();
+//   painter->restore();
 
   QGraphicsRectItem::paint(painter, option, widget);
 }


More information about the Kst mailing list