[Kst] branches/work/kst/viewpaint/kst/kst
George Staikos
staikos at kde.org
Sun Jan 29 21:21:04 CET 2006
SVN commit 503658 by staikos:
fix plot groups
M +8 -12 kstplotgroup.cpp
M +1 -1 kstplotgroup.h
--- branches/work/kst/viewpaint/kst/kst/kstplotgroup.cpp #503657:503658
@@ -43,11 +43,13 @@
setBorderColor(Qt::blue);
_container = false; // plot group is a container that doesn't behave like one
setTransparent(true);
+ setBorderWidth(0);
}
KstPlotGroup::KstPlotGroup(const QDomElement& e)
: KstMetaPlot(e) {
+ setBorderWidth(0);
QDomNode n = e.firstChild();
while (!n.isNull()) {
QDomElement el = n.toElement();
@@ -141,27 +143,21 @@
}
-void KstPlotGroup::paint(KstPainter& p, const QRegion& bounds) {
- setBorderWidth(0);
-
+void KstPlotGroup::paintSelf(KstPainter& p, const QRegion& bounds) {
if (!transparent()) {
+ p.save();
// fill non-children areas with color
- QRegion clipRegion(geometry());
+ QRegion clipRegion(contentsRect());
QBrush brush(_backgroundColor);
- bool hadClipping = p.hasClipping();
- QRegion oldRegion = p.clipRegion();
for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
clipRegion -= (*i)->clipRegion();
}
p.setClipRegion(clipRegion);
- p.fillRect(geometry(), brush);
-
- p.setClipRegion(oldRegion);
- p.setClipping(hadClipping);
+ p.fillRect(contentsRect(), brush);
+ p.restore();
}
- KstMetaPlot::paint(p, bounds);
- p.setClipping(false);
+ KstMetaPlot::paintSelf(p, bounds);
}
--- branches/work/kst/viewpaint/kst/kst/kstplotgroup.h #503657:503658
@@ -42,7 +42,7 @@
QMap<QString, QVariant> widgetHints(const QString& propertyName) const;
- void paint(KstPainter& p, const QRegion& bounds);
+ void paintSelf(KstPainter& p, const QRegion& bounds);
public slots:
void copyObject();
void copyObjectQuietly(KstViewObject& parent, const QString& name = QString::null) const;
More information about the Kst
mailing list