]> git.lyx.org Git - features.git/commitdiff
Set preamble tab stop to 4 chars.
authorRichard Heck <rgheck@lyx.org>
Mon, 2 Apr 2018 02:18:37 +0000 (22:18 -0400)
committerRichard Heck <rgheck@lyx.org>
Mon, 2 Apr 2018 02:20:57 +0000 (22:20 -0400)
src/frontends/qt4/GuiDocument.cpp

index f5af06ede017ab6338081636ca8b6b74f52fe2ec..0ff70a897cf549a7530c1196a38265d408258a2a 100644 (file)
@@ -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(' '));
 }