From: Richard Heck Date: Mon, 2 Apr 2018 02:18:37 +0000 (-0400) Subject: Set preamble tab stop to 4 chars. X-Git-Tag: 2.3.1~133^2~7 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d1fa6f10e595643c7a4220654c6eaee9d8920251;p=features.git Set preamble tab stop to 4 chars. --- 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(' ')); }