forked from qt-creator/qt-creator
Fixed cursor width inconsistency
While it was set to 2 for most editors, some editors, like the .pro file editor, set another document on the BaseTextEditor, which then did not get its cursor width set. Also removed a duplicated line. Reviewed-by: dt
This commit is contained in:
@@ -195,11 +195,9 @@ BaseTextEditor::BaseTextEditor(QWidget *parent)
|
||||
d->m_searchResultOverlay = new TextEditorOverlay(this);
|
||||
d->m_refactorOverlay = new RefactorOverlay(this);
|
||||
|
||||
d->setupDocumentSignals(d->m_document);
|
||||
d->setupDocumentSignals(d->m_document);
|
||||
|
||||
d->m_lastScrollPos = -1;
|
||||
setCursorWidth(2);
|
||||
|
||||
// from RESEARCH
|
||||
|
||||
@@ -1987,8 +1985,9 @@ void BaseTextEditorPrivate::setupDocumentSignals(BaseTextDocument *document)
|
||||
doc->setDocumentLayout(documentLayout);
|
||||
}
|
||||
|
||||
|
||||
q->setDocument(doc);
|
||||
q->setCursorWidth(2); // Applies to the document layout
|
||||
|
||||
QObject::connect(documentLayout, SIGNAL(updateBlock(QTextBlock)), q, SLOT(slotUpdateBlockNotify(QTextBlock)));
|
||||
QObject::connect(q, SIGNAL(requestBlockUpdate(QTextBlock)), documentLayout, SIGNAL(updateBlock(QTextBlock)));
|
||||
QObject::connect(doc, SIGNAL(modificationChanged(bool)), q, SIGNAL(changed()));
|
||||
|
||||
Reference in New Issue
Block a user