return NULL;
}
+QPainterPath AbstractGroupItem::clipGroupSpacerShape(QPointF offset) const
+{
+ return spacerGroupShape(AVWIDGET, offset);
+}
+
QPainterPath AbstractGroupItem::clipGroupShape(QPointF offset) const
{
return groupShape(AVWIDGET, offset);
return path;
}
+QPainterPath AbstractGroupItem::spacerGroupShape(GRAPHICSRECTITEM type, QPointF offset) const
+{
+ QPainterPath path;
+ QList<QGraphicsItem *> children = childItems();
+ for (int i = 0; i < children.count(); i++) {
+ if (children.at(i)->type() == (int)type) {
+ QRectF r(children.at(i)->sceneBoundingRect());
+ r.translate(offset);
+ r.setRight(scene()->width());
+ path.addRect(r);
+ } else if (children.at(i)->type() == GROUPWIDGET) {
+ QList<QGraphicsItem *> subchildren = children.at(i)->childItems();
+ for (int j = 0; j < subchildren.count(); j++) {
+ if (subchildren.at(j)->type() == (int)type) {
+ QRectF r(subchildren.at(j)->sceneBoundingRect());
+ r.translate(offset);
+ r.setRight(scene()->width());
+ path.addRect(r);
+ }
+ }
+ }
+ }
+ return path;
+}
+
void AbstractGroupItem::addItem(QGraphicsItem * item)
{
addToGroup(item);
QColor bgcolor(100, 100, 200, 100);
QRectF bound = option->exposedRect.adjusted(0, 0, 1, 1);
p->setClipRect(bound);
- const QRectF mapped = p->worldTransform().mapRect(option->exposedRect);
- p->setWorldMatrixEnabled(false);
p->setBrush(bgcolor);
QPen pen = p->pen();
pen.setColor(QColor(200, 90, 90));
pen.setStyle(Qt::DashLine);
pen.setWidthF(0.0);
p->setPen(pen);
- p->drawRoundedRect(mapped, 3, 3);
+ p->drawRoundedRect(boundingRect().adjusted(0, 0, -1, 0), 3, 3);
}
//virtual