bug-fix: move to the end of document after inserting title when creating a new note

This commit is contained in:
Le Tan 2017-09-11 19:49:00 +08:00
parent 07e8f27776
commit ed4044061f

View File

@ -321,9 +321,9 @@ void VFileList::newFile()
QWidget *wid = QApplication::focusWidget();
VMdEdit *edit = dynamic_cast<VMdEdit *>(wid);
if (edit && edit->getFile() == file) {
QKeyEvent *downEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Down,
Qt::NoModifier);
QCoreApplication::postEvent(edit, downEvent);
QTextCursor cursor = edit->textCursor();
cursor.movePosition(QTextCursor::End);
edit->setTextCursor(cursor);
}
}
}