diff options
author | David Schulz <[email protected]> | 2020-03-31 11:37:49 +0200 |
---|---|---|
committer | David Schulz <[email protected]> | 2020-04-07 07:26:39 +0000 |
commit | 45e7b78dc3a25c42f19d4275e7b678cfbd4c5771 (patch) | |
tree | d1541466c0315cb8d0d8cfb953a9db07ec6400ac /src/plugins/debugger/watchhandler.cpp | |
parent | 0c1906319de8770e0361545ca3b5a8d8815928d2 (diff) |
Debugger: Add action to reset individual/type formats
Task-number: QTCREATORBUG-22922
Change-Id: Ic8d0dd1214c208869bebdd69feb2cca1213d30cd
Reviewed-by: hjk <[email protected]>
Reviewed-by: Leena Miettinen <[email protected]>
Diffstat (limited to 'src/plugins/debugger/watchhandler.cpp')
-rw-r--r-- | src/plugins/debugger/watchhandler.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 9aac88f9e37..beab34f8f3b 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -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(); addAction(menu, tr("Change Display for Type \"%1\":").arg(item->type), false); addCheckableAction(menu, spacer + tr("Automatic"), true, typeFormat == AutomaticFormat, [this, item] { - //const QModelIndexList active = activeRows(); + //const QModelIndexList active = activeRows(); //for (const QModelIndex &idx : active) // setModelData(LocalsTypeFormatRole, AutomaticFormat, idx); setTypeFormat(item->type, AutomaticFormat); @@ -1925,11 +1931,17 @@ QMenu *WatchModel::createFormatMenu(WatchItem *item, QWidget *parent) for (int format : alternativeFormats) { addCheckableAction(menu, spacer + nameForFormat(format), true, format == typeFormat, [this, format, item] { - setTypeFormat(item->type, format); - m_engine->updateLocals(); + setTypeFormat(item->type, format); + m_engine->updateLocals(); }); } + addAction(menu, tr("Reset All Formats for Types"), true, [this]() { + theTypeFormats.clear(); + saveFormats(); + m_engine->updateLocals(); + }); + return menu; } |