MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / lineNumberAreaWidth

Method lineNumberAreaWidth

gui/qt/basiccodeviewerwindow.cpp:47–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47int BasicEditor::lineNumberAreaWidth()
48{
49 int digits = 1;
50 int max = qMax(1, blockCount());
51 while (max >= 10) {
52 max /= 10;
53 ++digits;
54 }
55
56 int singlespace;
57#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
58 singlespace = fontMetrics().horizontalAdvance(QLatin1Char('9'));
59#else
60 singlespace = fontMetrics().width(QLatin1Char('9'));
61#endif
62
63 int space = 3 + singlespace * digits;
64
65 return space;
66}
67
68void BasicEditor::updateLineNumberAreaWidth(int /* newBlockCount */)
69{

Callers 1

sizeHintMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected