forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user