forked from qt-creator/qt-creator
texteditor: simplify basetextmark architecture
ITextMark is not abstract anymore and has an icon and a priority. This means separate breakpoint and location marker classes that are only "plain" marks with icons and priorities are not needed. BaseTextMark directly inherits from ITextMark, instead of owning an ITextMark derived InternalMark. Also, there is now ITextMark::paint() to make it a bit more flexible then icon()[->paint()]
This commit is contained in:
@@ -39,6 +39,40 @@
|
||||
|
||||
using namespace TextEditor;
|
||||
|
||||
void ITextMark::paint(QPainter *painter, const QRect &rect) const
|
||||
{
|
||||
m_icon.paint(painter, rect, Qt::AlignCenter);
|
||||
}
|
||||
|
||||
void ITextMark::updateLineNumber(int lineNumber)
|
||||
{
|
||||
Q_UNUSED(lineNumber)
|
||||
}
|
||||
|
||||
void ITextMark::updateBlock(const QTextBlock &)
|
||||
{}
|
||||
|
||||
void ITextMark::removedFromEditor()
|
||||
{}
|
||||
|
||||
void ITextMark::documentClosing()
|
||||
{}
|
||||
|
||||
void ITextMark::setIcon(const QIcon &icon)
|
||||
{
|
||||
m_icon = icon;
|
||||
}
|
||||
|
||||
void ITextMark::setPriority(Priority priority)
|
||||
{
|
||||
m_priority = priority;
|
||||
}
|
||||
|
||||
ITextMark::Priority ITextMark::priority() const
|
||||
{
|
||||
return m_priority;
|
||||
}
|
||||
|
||||
QMap<QString, QString> ITextEditor::openedTextEditorsContents()
|
||||
{
|
||||
QMap<QString, QString> workingCopy;
|
||||
|
||||
Reference in New Issue
Block a user