diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2017-07-17 12:41:37 +0200 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2017-07-20 12:35:10 +0000 |
commit | c8a543b949bd86540ccd6e05d421ee90735211fb (patch) | |
tree | 3b5bb007dc30af2a7768c7dc83f874204512fb8b /src/plugins/texteditor/autocompleter.h | |
parent | f77dfd64d5052d783d5a43e171eeba91998f1148 (diff) |
TextEditor: Make TabSettings accessible for AutoCompleters
Change-Id: I3591ad94ca98979c2d47585d33800a489d87eeda
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/texteditor/autocompleter.h')
-rw-r--r-- | src/plugins/texteditor/autocompleter.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/texteditor/autocompleter.h b/src/plugins/texteditor/autocompleter.h index 91d5f98dc4..5d12b63b83 100644 --- a/src/plugins/texteditor/autocompleter.h +++ b/src/plugins/texteditor/autocompleter.h @@ -26,6 +26,7 @@ #pragma once #include "texteditor_global.h" +#include "tabsettings.h" #include <QString> @@ -35,8 +36,6 @@ QT_END_NAMESPACE namespace TextEditor { -class TabSettings; - class TEXTEDITOR_EXPORT AutoCompleter { public: @@ -53,6 +52,9 @@ public: void setSurroundWithQuotesEnabled(bool b) { m_surroundWithQuotes = b; } bool isSurroundWithQuotesEnabled() const { return m_surroundWithQuotes; } + void setTabSettings(const TabSettings &tabSettings) { m_tabSettings = tabSettings; } + const TabSettings &tabSettings() const { return m_tabSettings; } + // Returns the text to complete at the cursor position, or an empty string virtual QString autoComplete(QTextCursor &cursor, const QString &text, bool skipChars) const; @@ -60,8 +62,7 @@ public: virtual bool autoBackspace(QTextCursor &cursor); // Hook to insert special characters on enter. Returns the number of extra blocks inserted. - virtual int paragraphSeparatorAboutToBeInserted(QTextCursor &cursor, - const TabSettings &tabSettings); + virtual int paragraphSeparatorAboutToBeInserted(QTextCursor &cursor); virtual bool contextAllowsAutoBrackets(const QTextCursor &cursor, const QString &textToInsert = QString()) const; @@ -94,6 +95,7 @@ private: QString replaceSelection(QTextCursor &cursor, const QString &textToInsert) const; private: + TabSettings m_tabSettings; mutable bool m_allowSkippingOfBlockEnd; bool m_autoInsertBrackets; bool m_surroundWithBrackets; |