add basic support to show refactor markers

See BaseTextEditor::setRefactorMarkers(...). The markers support
a clicked signal via BaseTextEditor and tooltips. They feature
a cursor, but are always positioned at the end of the line (not block!).

As special gimmick they do extend the document width when they
are positioned outside the document area.
This commit is contained in:
mae
2010-07-02 13:47:14 +02:00
parent 038d943f9a
commit 6ef602d121
10 changed files with 230 additions and 16 deletions

View File

@@ -512,4 +512,22 @@ void BaseTextDocumentLayout::doFoldOrUnfold(const QTextBlock& block, bool unfold
setFolded(block, !unfold);
}
void BaseTextDocumentLayout::setRequiredWidth(int width)
{
int oldw = m_requiredWidth;
m_requiredWidth = width;
int dw = QPlainTextDocumentLayout::documentSize().width();
if (oldw > dw || width > dw)
emitDocumentSizeChanged();
}
QSizeF BaseTextDocumentLayout::documentSize() const
{
QSizeF size = QPlainTextDocumentLayout::documentSize();
size.setWidth(qMax((qreal)m_requiredWidth, size.width()));
return size;
}