TextEditor: Set widthFactor from TextMark ctor

The text marks are added to the document from their ctor. The document
then uses the widthFactor to calculate the space needed for them. If the
widthFactor is only set afterwards, the calculated space is wrong.

Change-Id: Ic7d24f99cc78d1bf084b2b1cfdf6b955496072f3
Task-number: QTCREATORBUG-17833
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2017-03-16 10:50:58 +01:00
parent b2e537baaa
commit 883492c135
4 changed files with 5 additions and 7 deletions

View File

@@ -41,14 +41,14 @@ using namespace TextEditor::Internal;
namespace TextEditor {
TextMark::TextMark(const QString &fileName, int lineNumber, Id category)
TextMark::TextMark(const QString &fileName, int lineNumber, Id category, double widthFactor)
: m_baseTextDocument(0),
m_fileName(fileName),
m_lineNumber(lineNumber),
m_priority(NormalPriority),
m_visible(true),
m_category(category),
m_widthFactor(1.0)
m_widthFactor(widthFactor)
{
if (!m_fileName.isEmpty())
TextEditorPlugin::baseTextMarkRegistry()->add(this);