Scroll view to follow cursor
This commit is contained in:
@@ -113,6 +113,7 @@ class LevelOneScene : public QGraphicsScene
|
||||
public:
|
||||
LevelOneScene(QWidget *, QObject *parent = nullptr);
|
||||
void setBorderDimensions(int, int, int, int, int);
|
||||
QGraphicsRectItem *cursorRectItem() const { return m_cursorRectItem; }
|
||||
|
||||
public slots:
|
||||
void updateCursor();
|
||||
|
||||
@@ -925,6 +925,7 @@ void MainWindow::updateCursorPosition()
|
||||
{
|
||||
m_cursorPositionLabel->setText(QString("Row %1 Column %2").arg(m_textWidget->document()->cursorRow()).arg(m_textWidget->document()->cursorColumn()));
|
||||
m_textScene->updateCursor();
|
||||
m_textView->ensureVisible(m_textScene->cursorRectItem(), 16, 24);
|
||||
}
|
||||
|
||||
void MainWindow::updatePageWidgets()
|
||||
|
||||
Reference in New Issue
Block a user