[Kst] branches/work/kst/portto4/kst/src/libkstapp
Adam Treat
treat at kde.org
Tue Jun 5 18:01:12 CEST 2007
SVN commit 671846 by treat:
* Fix up the label item so it can move, select,
etc, etc
M +10 -5 labelitem.cpp
--- branches/work/kst/portto4/kst/src/libkstapp/labelitem.cpp #671845:671846
@@ -45,15 +45,20 @@
QFont font;
font.setPointSize(16);
QFontMetrics fm(font);
- painter->translate(QPoint(box.x(), box.y() + fm.ascent() + fm.descent() + 1));
- Label::RenderContext rc(font.family(), 16, painter);
+ painter->translate(QPoint(box.x(), box.y() + fm.height()));
+ Label::RenderContext rc(font.family(), font.pointSize(), painter);
Label::renderLabel(rc, _parsed->chunk);
+
+ // Make sure we have a rect for selection, movement, etc
+ setRect(QRectF(box.x(), box.y(), rc.x, fm.height()));
+
painter->restore();
}
- QBrush b = brush();
- setBrush(Qt::NoBrush);
+
+ QPen p = pen();
+ setPen(Qt::NoPen);
QGraphicsRectItem::paint(painter, option, widget);
- setBrush(b);
+ setPen(p);
}
More information about the Kst
mailing list