diff options
author | hjk <hjk@qt.io> | 2021-12-06 05:11:04 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2021-12-06 17:10:49 +0000 |
commit | 104ea4accc8bf7d2e317c10638a299c3af267ede (patch) | |
tree | 8ab53d49a45cb72372a5294d272a7e43c815d661 /src/plugins/texteditor/tabsettings.h | |
parent | 8cb5c3cfdd07f98449d3df0a676c5026c33f6b7a (diff) |
Make some qHash and comparison operators overloads hidden friends
Restricts lookup scope more to necessary bits.
Change-Id: Ia42c95aaa70534843b7f6a90bfc56d2a1202c612
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/texteditor/tabsettings.h')
-rw-r--r-- | src/plugins/texteditor/tabsettings.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/texteditor/tabsettings.h b/src/plugins/texteditor/tabsettings.h index 731dd75caf..274dd44576 100644 --- a/src/plugins/texteditor/tabsettings.h +++ b/src/plugins/texteditor/tabsettings.h @@ -81,6 +81,9 @@ public: bool isIndentationClean(const QTextBlock &block, const int indent) const; bool guessSpacesForTabs(const QTextBlock &block) const; + friend bool operator==(const TabSettings &t1, const TabSettings &t2) { return t1.equals(t2); } + friend bool operator!=(const TabSettings &t1, const TabSettings &t2) { return !t1.equals(t2); } + static int firstNonSpace(const QString &text); static inline bool onlySpace(const QString &text) { return firstNonSpace(text) == text.length(); } static int spacesLeftFromPosition(const QString &text, int position); @@ -96,9 +99,6 @@ public: bool equals(const TabSettings &ts) const; }; -inline bool operator==(const TabSettings &t1, const TabSettings &t2) { return t1.equals(t2); } -inline bool operator!=(const TabSettings &t1, const TabSettings &t2) { return !t1.equals(t2); } - } // namespace TextEditor Q_DECLARE_METATYPE(TextEditor::TabSettings) |