diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-06-01 15:52:21 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-01 16:06:58 +0200 |
commit | 48fca54118b65d6399ece5f258426144bdc2b03b (patch) | |
tree | ef6ea77e48e8fd24c75a8b4905c383ff027cbb8d /src/scripttools/debugging/qscriptedit.cpp | |
parent | 0a4e802f182e6e4b3c54cafa141c8d07ec7621f6 (diff) | |
download | qtscript-48fca54118b65d6399ece5f258426144bdc2b03b.tar.gz |
Fix scripttools compilation when some features are disabled
Task-number: QTBUG-20378
Change-Id: Ia1dc574824cb1d58c237d60675d1b8a5f8f44c43
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src/scripttools/debugging/qscriptedit.cpp')
-rw-r--r-- | src/scripttools/debugging/qscriptedit.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/scripttools/debugging/qscriptedit.cpp b/src/scripttools/debugging/qscriptedit.cpp index 0406b34..5a70ce2 100644 --- a/src/scripttools/debugging/qscriptedit.cpp +++ b/src/scripttools/debugging/qscriptedit.cpp @@ -173,12 +173,16 @@ int QScriptEdit::currentLineNumber() const void QScriptEdit::gotoLine(int lineNumber) { +#ifndef QT_NO_SYNTAXHIGHLIGHTER int blockNumber = lineNumber - m_baseLineNumber; const QTextBlock &block = document()->findBlockByNumber(blockNumber); if (block.isValid()) { setTextCursor(QTextCursor(block)); centerCursor(); } +#else + Q_UNUSED(lineNumber); +#endif } void QScriptEdit::setBreakpoint(int lineNumber) @@ -259,8 +263,10 @@ void QScriptEdit::updateExtraSelections() lineColor = QColor(Qt::green).lighter(160); selection.format.setBackground(lineColor); selection.format.setProperty(QTextFormat::FullWidthSelection, true); +#ifndef QT_NO_SYNTAXHIGHLIGHTER int blockNumber = m_executionLineNumber - m_baseLineNumber; selection.cursor = QTextCursor(document()->findBlockByNumber(blockNumber)); +#endif selection.cursor.clearSelection(); extraSelections.append(selection); } @@ -318,6 +324,7 @@ void QScriptEdit::extraAreaPaintEvent(QPaintEvent *e) painter.drawLine(rect.x(), rect.top(), rect.x(), rect.bottom()); painter.setRenderHint(QPainter::Antialiasing); +#ifndef QT_NO_SYNTAXHIGHLIGHTER QTextBlock block = firstVisibleBlock(); int blockNumber = block.blockNumber(); qreal top = blockBoundingGeometry(block).translated(contentOffset()).top(); @@ -366,12 +373,15 @@ void QScriptEdit::extraAreaPaintEvent(QPaintEvent *e) bottom = top + blockBoundingRect(block).height(); ++blockNumber; } +#endif } void QScriptEdit::extraAreaMouseEvent(QMouseEvent *e) { QTextCursor cursor = cursorForPosition(QPoint(0, e->pos().y())); +#ifndef QT_NO_SYNTAXHIGHLIGHTER cursor.setPosition(cursor.block().position()); +#endif QFontMetrics fm(font()); int markWidth = fm.lineSpacing(); |