move cursor to end when create new note with title (#1408)

* disable qtquickcompiler

* move cursor to end when create new note with title
This commit is contained in:
tootal 2020-06-06 11:08:36 +08:00 committed by GitHub
parent 8f62f9902d
commit 8a549ea323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -14,6 +14,8 @@ DEFINES += QT_MESSAGELOGCONTEXT
TARGET = VNote TARGET = VNote
TEMPLATE = app TEMPLATE = app
CONFIG -= qtquickcompiler
RC_ICONS = resources/icons/vnote.ico RC_ICONS = resources/icons/vnote.ico
ICON = resources/icons/vnote.icns ICON = resources/icons/vnote.icns
@ -316,8 +318,6 @@ HEADERS += vmainwindow.h \
RESOURCES += \ RESOURCES += \
vnote.qrc \ vnote.qrc \
translations.qrc translations.qrc
QTQUICK_COMPILER_SKIPPED_RESOURCES += vnote.qrc
macx { macx {
LIBS += -L/usr/local/lib LIBS += -L/usr/local/lib

View File

@ -431,8 +431,10 @@ void VFileList::newFile()
// Move cursor down if content has been inserted. // Move cursor down if content has been inserted.
if (moveCursorEnd) { if (moveCursorEnd) {
const VMdTab *tab = dynamic_cast<VMdTab *>(editArea->getCurrentTab()); VMdTab *tab = dynamic_cast<VMdTab *>(editArea->getCurrentTab());
if (tab) { if (tab) {
// It will init markdown editor (within 50 ms)
// See VMdTab::VMdTab --> QTimer::singleShot(50, ...
VMdEditor *edit = tab->getEditor(); VMdEditor *edit = tab->getEditor();
if (edit && edit->getFile() == file) { if (edit && edit->getFile() == file) {
QTextCursor cursor = edit->textCursor(); QTextCursor cursor = edit->textCursor();

View File

@ -71,6 +71,9 @@ public:
void clearSearchedWordHighlight() Q_DECL_OVERRIDE; void clearSearchedWordHighlight() Q_DECL_OVERRIDE;
VWebView *getWebViewer() const; VWebView *getWebViewer() const;
// Get the markdown editor. If not init yet, init and return it.
VMdEditor *getEditor();
VMdEditor *getEditor() const; VMdEditor *getEditor() const;
@ -226,9 +229,6 @@ private:
// Focus the proper child widget. // Focus the proper child widget.
void focusChild() Q_DECL_OVERRIDE; void focusChild() Q_DECL_OVERRIDE;
// Get the markdown editor. If not init yet, init and return it.
VMdEditor *getEditor();
// Restore from @p_fino. // Restore from @p_fino.
// Return true if succeed. // Return true if succeed.
bool restoreFromTabInfo(const VEditTabInfo &p_info) Q_DECL_OVERRIDE; bool restoreFromTabInfo(const VEditTabInfo &p_info) Q_DECL_OVERRIDE;