We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c361732 commit aa3008cCopy full SHA for aa3008c
src/MainWindow.cpp
@@ -19,7 +19,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
19
editor = new CodeEditor(this);
20
syntax = new Syntax(editor->document());
21
22
- createMenuBar();
+ QFontMetrics metrics(editor->font());
23
+ int spaceWidth = metrics.horizontalAdvance(" ");
24
+ editor->setTabStopDistance(spaceWidth * 4);
25
26
QSplitter *splitter = new QSplitter(Qt::Horizontal, this);
27
setCentralWidget(splitter);
@@ -31,6 +33,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
31
33
splitter->setSizes(QList<int>() << 20 << 950);
32
34
splitter->addWidget(editor);
35
36
+ createMenuBar();
37
showMaximized();
38
}
39
0 commit comments