diff --git a/qad/blockview/blockview.cpp b/qad/blockview/blockview.cpp index 53b1a22..72f124b 100644 --- a/qad/blockview/blockview.cpp +++ b/qad/blockview/blockview.cpp @@ -76,6 +76,8 @@ void BlockView::_init() { connect(&nav_anim, SIGNAL(finished()), this, SLOT(_navFinished())); connect(scene_, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(adjustThumb())); connect(scene_, SIGNAL(selectionChanged()), this, SLOT(sceneSelectionChanged())); + connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(scrolled())); + connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(scrolled())); centerOn(scene_->sceneRect().center()); setCacheMode(CacheBackground); setTransformationAnchor(QGraphicsView::AnchorUnderMouse); @@ -697,6 +699,11 @@ void BlockView::updateNavRect() { } +void BlockView::scrolled() { + updateNavRect(); +} + + void BlockView::mouseMoveEvent(QMouseEvent * event) { if (navigation) { if (event->buttons().testFlag(Qt::MidButton) || event->buttons().testFlag(Qt::RightButton)) { diff --git a/qad/blockview/blockview.h b/qad/blockview/blockview.h index 0c25998..9bfa46f 100644 --- a/qad/blockview/blockview.h +++ b/qad/blockview/blockview.h @@ -112,7 +112,6 @@ public: protected: void _init(); void _updateBack(); - void updateNavRect(); bool event(QEvent * e); bool eventFilter(QObject * o, QEvent * e); void stopTimer(int & tid); @@ -208,6 +207,8 @@ protected slots: void removedBlock(QObject * o); void removeJunk(); void sceneSelectionChanged(); + void updateNavRect(); + void scrolled(); void _setThumb(double v); void _setNav(QRectF v); void _navFinished();