From d1fa6f10e595643c7a4220654c6eaee9d8920251 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sun, 1 Apr 2018 22:18:37 -0400 Subject: [PATCH] Set preamble tab stop to 4 chars. --- src/frontends/qt4/GuiDocument.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index f5af06ede0..0ff70a897c 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -473,6 +473,10 @@ PreambleModule::PreambleModule(QWidget * parent) connect(findButtonPB, SIGNAL(clicked()), this, SLOT(findText())); connect(findLE, SIGNAL(returnPressed()), this, SLOT(findText())); checkFindButton(); + // https://stackoverflow.com/questions/13027091/how-to-override-tab-width-in-qt + const int tabStop = 4; + QFontMetrics metrics(preambleTE->currentFont()); + preambleTE->setTabStopWidth(tabStop * metrics.width(' ')); }