Debugger: Add a way to copy selected values from Locals and Expressions

Task-number: QTCREATORBUG-14956
Change-Id: I2700820adf716afb784ec686297c15c48f3592f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2016-06-03 17:02:23 +02:00
parent 797dc11937
commit 6df0a34e99
3 changed files with 16 additions and 8 deletions

View File

@@ -1824,15 +1824,17 @@ void WatchHandler::addTypeFormats(const QByteArray &type, const DisplayFormats &
m_model->m_reportedTypeFormats.insert(QLatin1String(stripForFormat(type)), formats);
}
QString WatchHandler::editorContents()
QString WatchHandler::editorContents(const QModelIndexList &list)
{
QString contents;
QTextStream ts(&contents);
m_model->forAllItems([&ts](WatchItem *item) {
const QChar tab = QLatin1Char('\t');
const QChar nl = QLatin1Char('\n');
ts << QString(item->level(), tab) << item->name << tab << displayValue(item) << tab
<< item->type << nl;
m_model->forAllItems([&ts, this, list](WatchItem *item) {
if (list.isEmpty() || list.contains(m_model->indexForItem(item))) {
const QChar tab = QLatin1Char('\t');
const QChar nl = QLatin1Char('\n');
ts << QString(item->level(), tab) << item->name << tab << displayValue(item) << tab
<< item->type << nl;
}
});
return contents;
}