forked from qt-creator/qt-creator
Debugger: Add action to reset individual/type formats
Task-number: QTCREATORBUG-22922 Change-Id: Ic8d0dd1214c208869bebdd69feb2cca1213d30cd Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
@@ -1910,12 +1910,18 @@ QMenu *WatchModel::createFormatMenu(WatchItem *item, QWidget *parent)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addAction(menu, tr("Reset All Individual Formats"), true, [this]() {
|
||||||
|
theIndividualFormats.clear();
|
||||||
|
saveFormats();
|
||||||
|
m_engine->updateLocals();
|
||||||
|
});
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
addAction(menu, tr("Change Display for Type \"%1\":").arg(item->type), false);
|
addAction(menu, tr("Change Display for Type \"%1\":").arg(item->type), false);
|
||||||
|
|
||||||
addCheckableAction(menu, spacer + tr("Automatic"), true, typeFormat == AutomaticFormat,
|
addCheckableAction(menu, spacer + tr("Automatic"), true, typeFormat == AutomaticFormat,
|
||||||
[this, item] {
|
[this, item] {
|
||||||
//const QModelIndexList active = activeRows();
|
//const QModelIndexList active = activeRows();
|
||||||
//for (const QModelIndex &idx : active)
|
//for (const QModelIndex &idx : active)
|
||||||
// setModelData(LocalsTypeFormatRole, AutomaticFormat, idx);
|
// setModelData(LocalsTypeFormatRole, AutomaticFormat, idx);
|
||||||
setTypeFormat(item->type, AutomaticFormat);
|
setTypeFormat(item->type, AutomaticFormat);
|
||||||
@@ -1925,11 +1931,17 @@ QMenu *WatchModel::createFormatMenu(WatchItem *item, QWidget *parent)
|
|||||||
for (int format : alternativeFormats) {
|
for (int format : alternativeFormats) {
|
||||||
addCheckableAction(menu, spacer + nameForFormat(format), true, format == typeFormat,
|
addCheckableAction(menu, spacer + nameForFormat(format), true, format == typeFormat,
|
||||||
[this, format, item] {
|
[this, format, item] {
|
||||||
setTypeFormat(item->type, format);
|
setTypeFormat(item->type, format);
|
||||||
m_engine->updateLocals();
|
m_engine->updateLocals();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addAction(menu, tr("Reset All Formats for Types"), true, [this]() {
|
||||||
|
theTypeFormats.clear();
|
||||||
|
saveFormats();
|
||||||
|
m_engine->updateLocals();
|
||||||
|
});
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user