From 7e07c3980607d8c6e394520ea2e5ea37cb8860b7 Mon Sep 17 00:00:00 2001 From: lbartoletti Date: Tue, 22 Oct 2019 21:07:16 +0200 Subject: fontMetrics().width -> fontMetrics().horizontalAdvance --- src-qt5/experimental/lumina-terminal/TerminalWidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src-qt5/experimental/lumina-terminal/TerminalWidget.cpp') diff --git a/src-qt5/experimental/lumina-terminal/TerminalWidget.cpp b/src-qt5/experimental/lumina-terminal/TerminalWidget.cpp index 9fe4f15e..43523f15 100644 --- a/src-qt5/experimental/lumina-terminal/TerminalWidget.cpp +++ b/src-qt5/experimental/lumina-terminal/TerminalWidget.cpp @@ -29,7 +29,7 @@ TerminalWidget::TerminalWidget(QWidget *parent, QString dir) : QTextEdit(parent) this->setAcceptRichText(false); this->setOverwriteMode(true); this->setFocusPolicy(Qt::StrongFocus); - this->setTabStopWidth( 8 * this->fontMetrics().width(" ") ); //8 character spaces per tab (UNIX standard) + this->setTabStopWidth( 8 * this->fontMetrics().horizontalAdvance(" ") ); //8 character spaces per tab (UNIX standard) this->setTabChangesFocus(false); //this->setWordWrapMode(QTextOption::NoWrap); this->setContextMenuPolicy(Qt::CustomContextMenu); @@ -537,7 +537,7 @@ void TerminalWidget::updateTermSize(){ if(!PROC->isOpen()){ return; } QSize pix = this->size(); //pixels QSize chars; - chars.setWidth( pix.width()/this->fontMetrics().width("W") ); + chars.setWidth( pix.width()/this->fontMetrics().horizontalAdvance("W") ); chars.setHeight( pix.height()/this->fontMetrics().lineSpacing() ); //qDebug() << "Set Terminal Size:" << chars << pix; if(chars.width() <2 || chars.height() <2){ return; } //skip this - cannot go less than 2 characters wide/high -- cgit