aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp4
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp
index 07b99f27..0aedb1a0 100644
--- a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp
@@ -30,7 +30,7 @@ PlainTextEditor::PlainTextEditor(QSettings *set, QWidget *parent) : QPlainTextEd
hasChanges = readonly = false;
lastSaveContents.clear();
matchleft = matchright = -1;
- this->setTabStopWidth( 8 * this->fontMetrics().width(" ") ); //8 character spaces per tab (UNIX standard)
+ this->setTabStopDistance( 8 * QFontMetricsF(this->font()).width(' ') ); //8 character spaces per tab (UNIX standard)
//this->setObjectName("PlainTextEditor");
//this->setStyleSheet("QPlainTextEdit#PlainTextEditor{ }");
SYNTAX = new Custom_Syntax(settings, this->document());
@@ -171,7 +171,7 @@ int PlainTextEditor::LNWWidth(){
//qDebug() << "point 1" << this->document()->defaultFont();
while(lines>=10){ chars++; lines/=10; }
QFontMetrics metrics(this->document()->defaultFont());
- return (metrics.width("9")*chars); //make sure to add a tiny bit of padding
+ return (metrics.horizontalAdvance("9")*chars); //make sure to add a tiny bit of padding
}
void PlainTextEditor::paintLNW(QPaintEvent *ev){
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
index 6a3acfed..fa6ed8f4 100644
--- a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
@@ -75,7 +75,7 @@ void SyntaxFile::SetupDocument(QPlainTextEdit* editor){
if(formatObj.contains("tab_width")){
int num = formatObj.value("tab_width").toInt();
if(num<=0){ num = 8; } //UNIX Standard of 8 characters per tab
- editor->setTabStopWidth( num * QFontMetrics(editor->document()->defaultFont()).width(" ") );
+ editor->setTabStopDistance( num * QFontMetricsF(editor->document()->defaultFont() ).width(" ") );
}
}
bgstack15