forked from qt-creator/qt-creator
EnvironmentMode; Enable text wrapping for tooltips
This fixes the problem described in the bug report, but leaves the tooltip still in a ugly state as it breaks at almost random points. Without making assumptions about the content of environment variables, that's as good as the breaking can be. Task-number: QTCREATORBUG-7993 Change-Id: Id42c597640cf181aff5b8727dfdb9d21e226d907 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -148,7 +148,14 @@ QVariant EnvironmentModel::data(const QModelIndex &index, int role) const
|
|||||||
if (pos >= 0)
|
if (pos >= 0)
|
||||||
return d->m_items.at(pos).value;
|
return d->m_items.at(pos).value;
|
||||||
}
|
}
|
||||||
return d->m_resultEnvironment.value(d->m_resultEnvironment.constBegin() + index.row());
|
QString value = d->m_resultEnvironment.value(d->m_resultEnvironment.constBegin() + index.row());
|
||||||
|
if (role == Qt::ToolTipRole) {
|
||||||
|
// Use html to enable text wrapping
|
||||||
|
value = value.toHtmlEscaped();
|
||||||
|
value.prepend("<html><body>");
|
||||||
|
value.append("</body></html>");
|
||||||
|
}
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (role == Qt::FontRole) {
|
if (role == Qt::FontRole) {
|
||||||
|
|||||||
Reference in New Issue
Block a user