2 #include <QLineNumberArea>
3 #include <QSyntaxStyle>
12 #include <QAbstractTextDocumentLayout>
17 m_codeEditParent(parent)
26 return QWidget::sizeHint();
37 #if QT_VERSION >= 0x050B00
38 int space = 13 +
m_codeEditParent->fontMetrics().horizontalAdvance(QLatin1Char(
'9')) * digits;
40 int space = 13 +
m_codeEditParent->fontMetrics().width(QLatin1Char(
'9')) * digits;
58 QPainter painter(
this);
76 while (
block.isValid() &&
top <=
event->rect().bottom())
78 if (
block.isVisible() && bottom >=
event->rect().top())
80 QString number = QString::number(blockNumber + 1);
82 auto isCurrentLine =
m_codeEditParent->textCursor().blockNumber() == blockNumber;
83 painter.setPen(isCurrentLine ? currentLine : otherLines);