git-svn-id: svn://db.shs.com.ru/libs@314 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -1000,6 +1000,15 @@ void BlockView::fitInView(const QGraphicsItem * item, Qt::AspectRatioMode aspect
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BlockView::fitInView() {
|
||||||
|
QRectF r = _nav();
|
||||||
|
QGraphicsView::fitInView(itemsBoundingRect(), Qt::KeepAspectRatio);
|
||||||
|
QRectF t = _nav();
|
||||||
|
QGraphicsView::fitInView(r, Qt::KeepAspectRatio);
|
||||||
|
animateNav(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QRectF BlockView::itemsBoundingRect() const {
|
QRectF BlockView::itemsBoundingRect() const {
|
||||||
QList<QGraphicsItem*> gi = scene_->items();
|
QList<QGraphicsItem*> gi = scene_->items();
|
||||||
if (gi.isEmpty()) return QRectF();
|
if (gi.isEmpty()) return QRectF();
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ public:
|
|||||||
void fitInView(const QRectF & rect, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
|
void fitInView(const QRectF & rect, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
|
||||||
void fitInView(qreal x, qreal y, qreal w, qreal h, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
|
void fitInView(qreal x, qreal y, qreal w, qreal h, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
|
||||||
void fitInView(const QGraphicsItem * item, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
|
void fitInView(const QGraphicsItem * item, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
|
||||||
|
void fitInView();
|
||||||
|
|
||||||
QRectF itemsBoundingRect() const;
|
QRectF itemsBoundingRect() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user