forked from qt-creator/qt-creator
qmljshighlighter: un-templatize setFormats()
This is used excatly once. ReviewedBy: Kai Koehne
This commit is contained in:
@@ -915,8 +915,7 @@ void QmlJSTextEditor::setFontSettings(const TextEditor::FontSettings &fs)
|
||||
<< QLatin1String(TextEditor::Constants::C_VISUAL_WHITESPACE);
|
||||
}
|
||||
|
||||
const QVector<QTextCharFormat> formats = fs.toTextCharFormats(categories);
|
||||
highlighter->setFormats(formats.constBegin(), formats.constEnd());
|
||||
highlighter->setFormats(fs.toTextCharFormats(categories));
|
||||
highlighter->rehighlight();
|
||||
|
||||
m_occurrencesFormat = fs.toTextCharFormat(QLatin1String(TextEditor::Constants::C_OCCURRENCES));
|
||||
|
||||
@@ -82,6 +82,12 @@ static bool checkStartOfBinding(const Token &token)
|
||||
} // end of switch
|
||||
}
|
||||
|
||||
void Highlighter::setFormats(const QVector<QTextCharFormat> &formats)
|
||||
{
|
||||
QTC_ASSERT(formats.size() == NumFormats, return);
|
||||
qCopy(formats.begin(), formats.end(), m_formats);
|
||||
}
|
||||
|
||||
void Highlighter::highlightBlock(const QString &text)
|
||||
{
|
||||
const QList<Token> tokens = m_scanner(text, onBlockStart());
|
||||
|
||||
@@ -63,14 +63,7 @@ public:
|
||||
|
||||
bool isQmlEnabled() const;
|
||||
void setQmlEnabled(bool duiEnabled);
|
||||
|
||||
// MS VC 6 compatible, still.
|
||||
// Set formats from a sequence of type QTextCharFormat
|
||||
template <class InputIterator>
|
||||
void setFormats(InputIterator begin, InputIterator end)
|
||||
{
|
||||
qCopy(begin, end, m_formats);
|
||||
}
|
||||
void setFormats(const QVector<QTextCharFormat> &formats);
|
||||
|
||||
QTextCharFormat labelTextCharFormat() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user