[Kst] branches/work/kst/portto4/kst/src/libkstapp
Adam Treat
treat at kde.org
Thu Jun 7 22:31:35 CEST 2007
SVN commit 672672 by treat:
* Better debug and correct calls
M +1 -1 ellipseitem.cpp
M +1 -1 labelitem.cpp
M +1 -1 lineitem.cpp
M +1 -1 pictureitem.cpp
M +1 -1 svgitem.cpp
M +11 -6 viewitem.cpp
M +2 -0 viewitem.h
--- branches/work/kst/portto4/kst/src/libkstapp/ellipseitem.cpp #672671:672672
@@ -31,7 +31,7 @@
painter->drawEllipse(rect().adjusted(w, w, -w, -w));
QPen p = pen();
setPen(Qt::NoPen);
- QGraphicsRectItem::paint(painter, option, widget);
+ ViewItem::paint(painter, option, widget);
setPen(p);
}
--- branches/work/kst/portto4/kst/src/libkstapp/labelitem.cpp #672671:672672
@@ -56,7 +56,7 @@
QPen p = pen();
setPen(Qt::NoPen);
- QGraphicsRectItem::paint(painter, option, widget);
+ ViewItem::paint(painter, option, widget);
setPen(p);
}
--- branches/work/kst/portto4/kst/src/libkstapp/lineitem.cpp #672671:672672
@@ -31,7 +31,7 @@
painter->drawLine(_line);
QPen p = pen();
setPen(Qt::NoPen);
- QGraphicsRectItem::paint(painter, option, widget);
+ ViewItem::paint(painter, option, widget);
setPen(p);
}
--- branches/work/kst/portto4/kst/src/libkstapp/pictureitem.cpp #672671:672672
@@ -36,7 +36,7 @@
QPen p = pen();
setPen(Qt::NoPen);
- QGraphicsRectItem::paint(painter, option, widget);
+ ViewItem::paint(painter, option, widget);
setPen(p);
}
--- branches/work/kst/portto4/kst/src/libkstapp/svgitem.cpp #672671:672672
@@ -36,7 +36,7 @@
QPen p = pen();
setPen(Qt::NoPen);
- QGraphicsRectItem::paint(painter, option, widget);
+ ViewItem::paint(painter, option, widget);
setPen(p);
}
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.cpp #672671:672672
@@ -24,12 +24,6 @@
: QObject(parent) {
setAcceptsHoverEvents(true);
setFlags(ItemIsMovable | ItemIsSelectable | ItemIsFocusable);
-#ifdef DEBUG_GEOMETRY
- QColor semiRed(QColor(255, 0, 0, 50));
- setPen(semiRed);
- setBrush(semiRed);
-#endif
-
connect(parent, SIGNAL(mouseModeChanged()), this, SLOT(mouseModeChanged()));
}
@@ -43,6 +37,17 @@
}
+void ViewItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
+
+#ifdef DEBUG_GEOMETRY
+ QColor semiRed(QColor(255, 0, 0, 50));
+ painter->fillRect(boundingRect(), semiRed);
+#endif
+
+ QGraphicsRectItem::paint(painter, option, widget);
+}
+
+
void ViewItem::removeItem() {
RemoveCommand *remove = new RemoveCommand(this);
remove->redo();
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.h #672671:672672
@@ -32,6 +32,8 @@
View *parentView() const;
+ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+
Q_SIGNALS:
void creationComplete();
More information about the Kst
mailing list