Qt5: 'void Q[Plain]TextEdit::setTabStopWidth(int)' is deprecated [-Wdeprecated-declarations]

This commit is contained in:
wmayer
2020-06-11 22:37:39 +02:00
committed by wwmayer
parent 0ca65a5095
commit 6d0a136aad
4 changed files with 16 additions and 0 deletions

View File

@@ -451,7 +451,11 @@ void TextEditor::OnChange(Base::Subject<const char*> &rCaller,const char* sReaso
int tabWidth = hPrefGrp->GetInt("TabSize", 4);
QFontMetrics metric(font());
int fontSize = QtTools::horizontalAdvance(metric, QLatin1Char('0'));
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
setTabStopWidth(tabWidth * fontSize);
#else
setTabStopDistance(tabWidth * fontSize);
#endif
}
// Enables/Disables Line number in the Macro Editor from Edit->Preferences->Editor menu.