mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-06 14:29:54 +08:00
bug-fix: move to the end of document after inserting title when creating a new note
This commit is contained in:
parent
07e8f27776
commit
ed4044061f
@ -321,9 +321,9 @@ void VFileList::newFile()
|
|||||||
QWidget *wid = QApplication::focusWidget();
|
QWidget *wid = QApplication::focusWidget();
|
||||||
VMdEdit *edit = dynamic_cast<VMdEdit *>(wid);
|
VMdEdit *edit = dynamic_cast<VMdEdit *>(wid);
|
||||||
if (edit && edit->getFile() == file) {
|
if (edit && edit->getFile() == file) {
|
||||||
QKeyEvent *downEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Down,
|
QTextCursor cursor = edit->textCursor();
|
||||||
Qt::NoModifier);
|
cursor.movePosition(QTextCursor::End);
|
||||||
QCoreApplication::postEvent(edit, downEvent);
|
edit->setTextCursor(cursor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user