Fix QGIVP boundingRect

This commit is contained in:
wandererfan
2018-08-06 11:57:20 -04:00
committed by wmayer
parent c0c36138d7
commit 20247dd88f
3 changed files with 7 additions and 4 deletions

View File

@@ -409,12 +409,13 @@ void QGIView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q
QStyleOptionGraphicsItem myOption(*option);
myOption.state &= ~QStyle::State_Selected;
//painter->drawRect(boundingRect()); //good for debugging
// painter->drawRect(boundingRect()); //good for debugging
QGraphicsItemGroup::paint(painter, &myOption, widget);
}
QRectF QGIView::customChildrenBoundingRect() {
QRectF QGIView::customChildrenBoundingRect() const
{
QList<QGraphicsItem*> children = childItems();
int dimItemType = QGraphicsItem::UserType + 106; // TODO: Magic number warning.
int borderItemType = QGraphicsItem::UserType + 136; // TODO: Magic number warning

View File

@@ -109,7 +109,7 @@ protected:
// Preselection events:
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
virtual QRectF customChildrenBoundingRect(void);
virtual QRectF customChildrenBoundingRect(void) const;
void dumpRect(char* text, QRectF r);
QString getPrefFont(void);

View File

@@ -984,7 +984,9 @@ void QGIViewPart::dumpPath(const char* text,QPainterPath path)
QRectF QGIViewPart::boundingRect() const
{
return childrenBoundingRect();
// return childrenBoundingRect();
// return customChildrenBoundingRect();
return QGIView::boundingRect();
}
//QGIViewPart derived classes do not need a rotate view method as rotation is handled on App side.