forked from qt-creator/qt-creator
Utils: Start replacing SavedActions by QAction or Utils::Aspect
First mechanical step here is to derive SavedActions from BaseAspect instead of QAction. Change-Id: I2ec95883b825462c1d867f83cc2b3bd2c2732055 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -54,9 +54,9 @@ namespace Utils {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
SavedAction::SavedAction(QObject *parent)
|
SavedAction::SavedAction(QObject *parent)
|
||||||
: QAction(parent)
|
|
||||||
{
|
{
|
||||||
connect(this, &QAction::triggered, this, &SavedAction::actionTriggered);
|
setParent(parent);
|
||||||
|
connect(&m_action, &QAction::triggered, this, &SavedAction::actionTriggered);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -82,8 +82,8 @@ void SavedAction::setValue(const QVariant &value, bool doemit)
|
|||||||
if (value == m_value)
|
if (value == m_value)
|
||||||
return;
|
return;
|
||||||
m_value = value;
|
m_value = value;
|
||||||
if (this->isCheckable())
|
if (m_action.isCheckable())
|
||||||
this->setChecked(m_value.toBool());
|
m_action.setChecked(m_value.toBool());
|
||||||
if (doemit)
|
if (doemit)
|
||||||
emit valueChanged(m_value);
|
emit valueChanged(m_value);
|
||||||
}
|
}
|
||||||
@@ -187,7 +187,7 @@ void SavedAction::readSettings(const QSettings *settings)
|
|||||||
return;
|
return;
|
||||||
QVariant var = settings->value(m_settingsGroup + QLatin1Char('/') + m_settingsKey, m_defaultValue);
|
QVariant var = settings->value(m_settingsGroup + QLatin1Char('/') + m_settingsKey, m_defaultValue);
|
||||||
// work around old ini files containing @Invalid() entries
|
// work around old ini files containing @Invalid() entries
|
||||||
if (isCheckable() && !var.isValid())
|
if (m_action.isCheckable() && !var.isValid())
|
||||||
var = false;
|
var = false;
|
||||||
setValue(var);
|
setValue(var);
|
||||||
}
|
}
|
||||||
@@ -274,7 +274,7 @@ void SavedAction::connectWidget(QWidget *widget, ApplyMode applyMode)
|
|||||||
|
|
||||||
// Copy tooltip, but only if there's nothing explcitly set on the widget yet.
|
// Copy tooltip, but only if there's nothing explcitly set on the widget yet.
|
||||||
if (widget->toolTip().isEmpty())
|
if (widget->toolTip().isEmpty())
|
||||||
widget->setToolTip(toolTip());
|
widget->setToolTip(m_action.toolTip());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -329,21 +329,26 @@ void SavedAction::setDialogText(const QString &dialogText)
|
|||||||
|
|
||||||
void SavedAction::actionTriggered(bool)
|
void SavedAction::actionTriggered(bool)
|
||||||
{
|
{
|
||||||
if (isCheckable())
|
if (m_action.isCheckable())
|
||||||
setValue(isChecked());
|
setValue(m_action.isChecked());
|
||||||
if (actionGroup() && actionGroup()->isExclusive()) {
|
if (m_action.actionGroup() && m_action.actionGroup()->isExclusive()) {
|
||||||
// FIXME: should be taken care of more directly
|
// FIXME: should be taken care of more directly
|
||||||
const QList<QAction *> actions = actionGroup()->actions();
|
const QList<QAction *> actions = m_action.actionGroup()->actions();
|
||||||
for (QAction *act : actions)
|
for (QAction *act : actions)
|
||||||
if (auto dact = qobject_cast<SavedAction *>(act))
|
if (auto dact = qobject_cast<SavedAction *>(act))
|
||||||
dact->setValue(bool(act == this));
|
dact->setValue(bool(act == &m_action));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAction *SavedAction::action()
|
||||||
|
{
|
||||||
|
return &m_action;
|
||||||
|
}
|
||||||
|
|
||||||
void SavedAction::trigger(const QVariant &data)
|
void SavedAction::trigger(const QVariant &data)
|
||||||
{
|
{
|
||||||
setData(data);
|
m_action.setData(data);
|
||||||
QAction::trigger();
|
m_action.trigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
|
#include "aspects.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@@ -37,7 +39,7 @@ namespace Utils {
|
|||||||
|
|
||||||
enum ApplyMode { ImmediateApply, DeferedApply };
|
enum ApplyMode { ImmediateApply, DeferedApply };
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT SavedAction : public QAction
|
class QTCREATOR_UTILS_EXPORT SavedAction : public BaseAspect
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -72,6 +74,15 @@ public:
|
|||||||
QString dialogText() const;
|
QString dialogText() const;
|
||||||
void setDialogText(const QString &dialogText);
|
void setDialogText(const QString &dialogText);
|
||||||
|
|
||||||
|
QAction *action();
|
||||||
|
|
||||||
|
void setText(const QString &text) { m_action.setText(text); }
|
||||||
|
void setToolTip(const QString &toolTip) { m_action.setToolTip(toolTip); }
|
||||||
|
void setCheckable(bool checkable) { m_action.setCheckable(checkable); }
|
||||||
|
void setChecked(bool checked) { m_action.setChecked(checked); }
|
||||||
|
void setEnabled(bool enabled) { m_action.setEnabled(enabled); }
|
||||||
|
void setIcon(const QIcon &icon) { m_action.setIcon(icon); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void valueChanged(const QVariant &newValue);
|
void valueChanged(const QVariant &newValue);
|
||||||
|
|
||||||
@@ -84,6 +95,7 @@ private:
|
|||||||
QString m_settingsGroup;
|
QString m_settingsGroup;
|
||||||
QString m_dialogText;
|
QString m_dialogText;
|
||||||
QWidget *m_widget = nullptr;
|
QWidget *m_widget = nullptr;
|
||||||
|
QAction m_action;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QTCREATOR_UTILS_EXPORT SavedActionSet
|
class QTCREATOR_UTILS_EXPORT SavedActionSet
|
||||||
|
|||||||
@@ -1671,9 +1671,9 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev)
|
|||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
menu->addAction(action(UseToolTipsInBreakpointsView));
|
menu->addAction(action(UseToolTipsInBreakpointsView)->action());
|
||||||
Internal::addHideColumnActions(menu, ev.view());
|
Internal::addHideColumnActions(menu, ev.view());
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
|
|
||||||
menu->popup(ev.globalPos());
|
menu->popup(ev.globalPos());
|
||||||
|
|
||||||
@@ -2632,9 +2632,9 @@ bool BreakpointManager::contextMenuEvent(const ItemViewEvent &ev)
|
|||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
menu->addAction(action(UseToolTipsInBreakpointsView));
|
menu->addAction(action(UseToolTipsInBreakpointsView)->action());
|
||||||
Internal::addHideColumnActions(menu, ev.view());
|
Internal::addHideColumnActions(menu, ev.view());
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
|
|
||||||
menu->popup(ev.globalPos());
|
menu->popup(ev.globalPos());
|
||||||
|
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ CdbEngine::CdbEngine() :
|
|||||||
wh->addTypeFormats("QImage", imageFormats);
|
wh->addTypeFormats("QImage", imageFormats);
|
||||||
wh->addTypeFormats("QImage *", imageFormats);
|
wh->addTypeFormats("QImage *", imageFormats);
|
||||||
|
|
||||||
connect(action(CreateFullBacktrace), &QAction::triggered,
|
connect(action(CreateFullBacktrace)->action(), &QAction::triggered,
|
||||||
this, &CdbEngine::createFullBacktrace);
|
this, &CdbEngine::createFullBacktrace);
|
||||||
connect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
connect(&m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||||
this, &CdbEngine::processFinished);
|
this, &CdbEngine::processFinished);
|
||||||
@@ -216,7 +216,7 @@ CdbEngine::CdbEngine() :
|
|||||||
connect(action(UseDebuggingHelpers), &SavedAction::valueChanged,
|
connect(action(UseDebuggingHelpers), &SavedAction::valueChanged,
|
||||||
this, &CdbEngine::updateLocals);
|
this, &CdbEngine::updateLocals);
|
||||||
|
|
||||||
if (action(UseCodeModel)->isChecked())
|
if (action(UseCodeModel)->action()->isChecked())
|
||||||
m_codeModelSnapshot = CppTools::CppModelManager::instance()->snapshot();
|
m_codeModelSnapshot = CppTools::CppModelManager::instance()->snapshot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ public:
|
|||||||
if (HostOsInfo::isWindowsHost()) {
|
if (HostOsInfo::isWindowsHost()) {
|
||||||
SavedAction *registerAction = action(RegisterForPostMortem);
|
SavedAction *registerAction = action(RegisterForPostMortem);
|
||||||
m_group.insert(registerAction, checkBoxRegisterForPostMortem);
|
m_group.insert(registerAction, checkBoxRegisterForPostMortem);
|
||||||
connect(registerAction, &QAction::toggled,
|
connect(registerAction->action(), &QAction::toggled,
|
||||||
checkBoxRegisterForPostMortem, &QAbstractButton::setChecked);
|
checkBoxRegisterForPostMortem, &QAbstractButton::setChecked);
|
||||||
} else {
|
} else {
|
||||||
checkBoxRegisterForPostMortem->setVisible(false);
|
checkBoxRegisterForPostMortem->setVisible(false);
|
||||||
|
|||||||
@@ -108,9 +108,9 @@ Console::Console()
|
|||||||
m_showDebugButtonAction->setCheckable(true);
|
m_showDebugButtonAction->setCheckable(true);
|
||||||
m_showDebugButtonAction->setChecked(true);
|
m_showDebugButtonAction->setChecked(true);
|
||||||
m_showDebugButtonAction->setIcon(Utils::Icons::INFO_TOOLBAR.icon());
|
m_showDebugButtonAction->setIcon(Utils::Icons::INFO_TOOLBAR.icon());
|
||||||
connect(m_showDebugButtonAction, &Utils::SavedAction::toggled,
|
connect(m_showDebugButtonAction->action(), &QAction::toggled,
|
||||||
proxyModel, &ConsoleProxyModel::setShowLogs);
|
proxyModel, &ConsoleProxyModel::setShowLogs);
|
||||||
m_showDebugButton->setDefaultAction(m_showDebugButtonAction);
|
m_showDebugButton->setDefaultAction(m_showDebugButtonAction->action());
|
||||||
|
|
||||||
m_showWarningButton = new QToolButton(m_consoleWidget);
|
m_showWarningButton = new QToolButton(m_consoleWidget);
|
||||||
|
|
||||||
@@ -121,9 +121,9 @@ Console::Console()
|
|||||||
m_showWarningButtonAction->setCheckable(true);
|
m_showWarningButtonAction->setCheckable(true);
|
||||||
m_showWarningButtonAction->setChecked(true);
|
m_showWarningButtonAction->setChecked(true);
|
||||||
m_showWarningButtonAction->setIcon(Utils::Icons::WARNING_TOOLBAR.icon());
|
m_showWarningButtonAction->setIcon(Utils::Icons::WARNING_TOOLBAR.icon());
|
||||||
connect(m_showWarningButtonAction, &Utils::SavedAction::toggled,
|
connect(m_showWarningButtonAction->action(), &QAction::toggled,
|
||||||
proxyModel, &ConsoleProxyModel::setShowWarnings);
|
proxyModel, &ConsoleProxyModel::setShowWarnings);
|
||||||
m_showWarningButton->setDefaultAction(m_showWarningButtonAction);
|
m_showWarningButton->setDefaultAction(m_showWarningButtonAction->action());
|
||||||
|
|
||||||
m_showErrorButton = new QToolButton(m_consoleWidget);
|
m_showErrorButton = new QToolButton(m_consoleWidget);
|
||||||
|
|
||||||
@@ -134,9 +134,9 @@ Console::Console()
|
|||||||
m_showErrorButtonAction->setCheckable(true);
|
m_showErrorButtonAction->setCheckable(true);
|
||||||
m_showErrorButtonAction->setChecked(true);
|
m_showErrorButtonAction->setChecked(true);
|
||||||
m_showErrorButtonAction->setIcon(Utils::Icons::CRITICAL_TOOLBAR.icon());
|
m_showErrorButtonAction->setIcon(Utils::Icons::CRITICAL_TOOLBAR.icon());
|
||||||
connect(m_showErrorButtonAction, &Utils::SavedAction::toggled,
|
connect(m_showErrorButtonAction->action(), &QAction::toggled,
|
||||||
proxyModel, &ConsoleProxyModel::setShowErrors);
|
proxyModel, &ConsoleProxyModel::setShowErrors);
|
||||||
m_showErrorButton->setDefaultAction(m_showErrorButtonAction);
|
m_showErrorButton->setDefaultAction(m_showErrorButtonAction->action());
|
||||||
|
|
||||||
m_spacer = new QWidget(m_consoleWidget);
|
m_spacer = new QWidget(m_consoleWidget);
|
||||||
m_spacer->setMinimumWidth(30);
|
m_spacer->setMinimumWidth(30);
|
||||||
|
|||||||
@@ -1197,7 +1197,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(const QStringList &arguments)
|
|||||||
this, &DebuggerPluginPrivate::updateBreakMenuItem);
|
this, &DebuggerPluginPrivate::updateBreakMenuItem);
|
||||||
|
|
||||||
// Application interaction
|
// Application interaction
|
||||||
connect(action(SettingsDialog), &QAction::triggered,
|
connect(action(SettingsDialog)->action(), &QAction::triggered,
|
||||||
[] { ICore::showOptionsDialog(DEBUGGER_COMMON_SETTINGS_ID); });
|
[] { ICore::showOptionsDialog(DEBUGGER_COMMON_SETTINGS_ID); });
|
||||||
|
|
||||||
m_perspective.useSubPerspectiveSwitcher(EngineManager::engineChooser());
|
m_perspective.useSubPerspectiveSwitcher(EngineManager::engineChooser());
|
||||||
@@ -2047,7 +2047,7 @@ SavedAction *DebuggerPluginPrivate::action(int code)
|
|||||||
|
|
||||||
QWidget *DebuggerPluginPrivate::addSearch(BaseTreeView *treeView)
|
QWidget *DebuggerPluginPrivate::addSearch(BaseTreeView *treeView)
|
||||||
{
|
{
|
||||||
QAction *act = action(UseAlternatingRowColors);
|
QAction *act = action(UseAlternatingRowColors)->action();
|
||||||
treeView->setAlternatingRowColors(act->isChecked());
|
treeView->setAlternatingRowColors(act->isChecked());
|
||||||
treeView->setProperty(PerspectiveState::savesHeaderKey(), true);
|
treeView->setProperty(PerspectiveState::savesHeaderKey(), true);
|
||||||
connect(act, &QAction::toggled, treeView, &BaseTreeView::setAlternatingRowColors);
|
connect(act, &QAction::toggled, treeView, &BaseTreeView::setAlternatingRowColors);
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ GdbEngine::GdbEngine()
|
|||||||
|
|
||||||
connect(action(AutoDerefPointers), &SavedAction::valueChanged,
|
connect(action(AutoDerefPointers), &SavedAction::valueChanged,
|
||||||
this, &GdbEngine::reloadLocals);
|
this, &GdbEngine::reloadLocals);
|
||||||
connect(action(CreateFullBacktrace), &QAction::triggered,
|
connect(action(CreateFullBacktrace)->action(), &QAction::triggered,
|
||||||
this, &GdbEngine::createFullBacktrace);
|
this, &GdbEngine::createFullBacktrace);
|
||||||
connect(action(UseDebuggingHelpers), &SavedAction::valueChanged,
|
connect(action(UseDebuggingHelpers), &SavedAction::valueChanged,
|
||||||
this, &GdbEngine::reloadLocals);
|
this, &GdbEngine::reloadLocals);
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ LldbEngine::LldbEngine()
|
|||||||
|
|
||||||
connect(action(AutoDerefPointers), &SavedAction::valueChanged,
|
connect(action(AutoDerefPointers), &SavedAction::valueChanged,
|
||||||
this, &LldbEngine::updateLocals);
|
this, &LldbEngine::updateLocals);
|
||||||
connect(action(CreateFullBacktrace), &QAction::triggered,
|
connect(action(CreateFullBacktrace)->action(), &QAction::triggered,
|
||||||
this, &LldbEngine::fetchFullBacktrace);
|
this, &LldbEngine::fetchFullBacktrace);
|
||||||
connect(action(UseDebuggingHelpers), &SavedAction::valueChanged,
|
connect(action(UseDebuggingHelpers), &SavedAction::valueChanged,
|
||||||
this, &LldbEngine::updateLocals);
|
this, &LldbEngine::updateLocals);
|
||||||
|
|||||||
@@ -220,10 +220,10 @@ public:
|
|||||||
QMenu *menu = createStandardContextMenu();
|
QMenu *menu = createStandardContextMenu();
|
||||||
menu->addAction(m_clearContentsAction);
|
menu->addAction(m_clearContentsAction);
|
||||||
menu->addAction(m_saveContentsAction); // X11 clipboard is unreliable for long texts
|
menu->addAction(m_saveContentsAction); // X11 clipboard is unreliable for long texts
|
||||||
menu->addAction(action(LogTimeStamps));
|
menu->addAction(action(LogTimeStamps)->action());
|
||||||
menu->addAction(m_reloadDebuggingHelpersAction);
|
menu->addAction(m_reloadDebuggingHelpersAction);
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
menu->exec(ev->globalPos());
|
menu->exec(ev->globalPos());
|
||||||
delete menu;
|
delete menu;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ bool ModulesModel::contextMenuEvent(const ItemViewEvent &ev)
|
|||||||
[this, modulePath] { engine->requestModuleSections(modulePath); });
|
[this, modulePath] { engine->requestModuleSections(modulePath); });
|
||||||
|
|
||||||
Internal::addHideColumnActions(menu, ev.view());
|
Internal::addHideColumnActions(menu, ev.view());
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
|
|
||||||
menu->popup(ev.globalPos());
|
menu->popup(ev.globalPos());
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -787,7 +787,7 @@ bool PeripheralRegisterHandler::contextMenuEvent(const ItemViewEvent &ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Internal::addHideColumnActions(menu, ev.view());
|
Internal::addHideColumnActions(menu, ev.view());
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
menu->popup(ev.globalPos());
|
menu->popup(ev.globalPos());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ QmlInspectorAgent::QmlInspectorAgent(QmlEngine *engine, QmlDebugConnection *conn
|
|||||||
: m_qmlEngine(engine)
|
: m_qmlEngine(engine)
|
||||||
, m_inspectorToolsContext("Debugger.QmlInspector")
|
, m_inspectorToolsContext("Debugger.QmlInspector")
|
||||||
, m_selectAction(new QAction(this))
|
, m_selectAction(new QAction(this))
|
||||||
, m_showAppOnTopAction(action(ShowAppOnTop))
|
, m_showAppOnTopAction(action(ShowAppOnTop)->action())
|
||||||
{
|
{
|
||||||
m_debugIdToIname.insert(WatchItem::InvalidId, "inspect");
|
m_debugIdToIname.insert(WatchItem::InvalidId, "inspect");
|
||||||
connect(action(ShowQmlObjectTree),
|
connect(action(ShowQmlObjectTree),
|
||||||
|
|||||||
@@ -757,7 +757,7 @@ bool RegisterHandler::contextMenuEvent(const ItemViewEvent &ev)
|
|||||||
addFormatAction(tr("Binary"), BinaryFormat);
|
addFormatAction(tr("Binary"), BinaryFormat);
|
||||||
|
|
||||||
Internal::addHideColumnActions(menu, ev.view());
|
Internal::addHideColumnActions(menu, ev.view());
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
menu->popup(ev.globalPos());
|
menu->popup(ev.globalPos());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ bool SourceFilesHandler::setData(const QModelIndex &idx, const QVariant &data, i
|
|||||||
[this, name] { m_engine->gotoLocation(FilePath::fromString(name)); });
|
[this, name] { m_engine->gotoLocation(FilePath::fromString(name)); });
|
||||||
|
|
||||||
Internal::addHideColumnActions(menu, ev.view());
|
Internal::addHideColumnActions(menu, ev.view());
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
menu->popup(ev.globalPos());
|
menu->popup(ev.globalPos());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,10 +70,10 @@ StackHandler::StackHandler(DebuggerEngine *engine)
|
|||||||
setObjectName("StackModel");
|
setObjectName("StackModel");
|
||||||
setHeader({tr("Level"), tr("Function"), tr("File"), tr("Line"), tr("Address") });
|
setHeader({tr("Level"), tr("Function"), tr("File"), tr("Line"), tr("Address") });
|
||||||
|
|
||||||
connect(action(ExpandStack), &QAction::triggered,
|
connect(action(ExpandStack)->action(), &QAction::triggered,
|
||||||
this, &StackHandler::reloadFullStack);
|
this, &StackHandler::reloadFullStack);
|
||||||
connect(action(MaximalStackDepth), &QAction::triggered,
|
connect(action(MaximalStackDepth)->action(), &QAction::triggered,
|
||||||
this, &StackHandler::reloadFullStack);
|
this, &StackHandler::reloadFullStack);
|
||||||
|
|
||||||
// For now there's always only "the" current thread.
|
// For now there's always only "the" current thread.
|
||||||
rootItem()->appendChild(new ThreadDummyItem);
|
rootItem()->appendChild(new ThreadDummyItem);
|
||||||
@@ -390,13 +390,13 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev)
|
|||||||
frame = frameAt(row);
|
frame = frameAt(row);
|
||||||
const quint64 address = frame.address;
|
const quint64 address = frame.address;
|
||||||
|
|
||||||
menu->addAction(action(ExpandStack));
|
menu->addAction(action(ExpandStack)->action());
|
||||||
|
|
||||||
addAction(menu, tr("Copy Contents to Clipboard"), true, [this] { copyContentsToClipboard(); });
|
addAction(menu, tr("Copy Contents to Clipboard"), true, [this] { copyContentsToClipboard(); });
|
||||||
addAction(menu, tr("Save as Task File..."), true, [this] { saveTaskFile(); });
|
addAction(menu, tr("Save as Task File..."), true, [this] { saveTaskFile(); });
|
||||||
|
|
||||||
if (m_engine->hasCapability(CreateFullBacktraceCapability))
|
if (m_engine->hasCapability(CreateFullBacktraceCapability))
|
||||||
menu->addAction(action(CreateFullBacktrace));
|
menu->addAction(action(CreateFullBacktrace)->action());
|
||||||
|
|
||||||
if (m_engine->hasCapability(AdditionalQmlStackCapability))
|
if (m_engine->hasCapability(AdditionalQmlStackCapability))
|
||||||
addAction(menu, tr("Load QML Stack"), true, [this] { m_engine->loadAdditionalQmlStack(); });
|
addAction(menu, tr("Load QML Stack"), true, [this] { m_engine->loadAdditionalQmlStack(); });
|
||||||
@@ -444,9 +444,9 @@ bool StackHandler::contextMenuEvent(const ItemViewEvent &ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
menu->addAction(action(UseToolTipsInStackView));
|
menu->addAction(action(UseToolTipsInStackView)->action());
|
||||||
Internal::addHideColumnActions(menu, ev.view());
|
Internal::addHideColumnActions(menu, ev.view());
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
menu->popup(ev.globalPos());
|
menu->popup(ev.globalPos());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ bool ThreadsHandler::setData(const QModelIndex &idx, const QVariant &data, int r
|
|||||||
if (ev.as<QContextMenuEvent>()) {
|
if (ev.as<QContextMenuEvent>()) {
|
||||||
auto menu = new QMenu;
|
auto menu = new QMenu;
|
||||||
Internal::addHideColumnActions(menu, ev.view());
|
Internal::addHideColumnActions(menu, ev.view());
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
menu->popup(ev.globalPos());
|
menu->popup(ev.globalPos());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1738,15 +1738,15 @@ bool WatchModel::contextMenuEvent(const ItemViewEvent &ev)
|
|||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
menu->addAction(action(UseDebuggingHelpers));
|
menu->addAction(action(UseDebuggingHelpers)->action());
|
||||||
menu->addAction(action(UseToolTipsInLocalsView));
|
menu->addAction(action(UseToolTipsInLocalsView)->action());
|
||||||
menu->addAction(action(AutoDerefPointers));
|
menu->addAction(action(AutoDerefPointers)->action());
|
||||||
menu->addAction(action(SortStructMembers));
|
menu->addAction(action(SortStructMembers)->action());
|
||||||
menu->addAction(action(UseDynamicType));
|
menu->addAction(action(UseDynamicType)->action());
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
|
|
||||||
Internal::addHideColumnActions(menu, ev.view());
|
Internal::addHideColumnActions(menu, ev.view());
|
||||||
menu->addAction(action(SettingsDialog));
|
menu->addAction(action(SettingsDialog)->action());
|
||||||
connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater);
|
connect(menu, &QMenu::aboutToHide, menu, &QObject::deleteLater);
|
||||||
menu->popup(ev.globalPos());
|
menu->popup(ev.globalPos());
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ WatchTreeView::WatchTreeView(WatchType type)
|
|||||||
connect(this, &QTreeView::expanded, this, &WatchTreeView::expandNode);
|
connect(this, &QTreeView::expanded, this, &WatchTreeView::expandNode);
|
||||||
connect(this, &QTreeView::collapsed, this, &WatchTreeView::collapseNode);
|
connect(this, &QTreeView::collapsed, this, &WatchTreeView::collapseNode);
|
||||||
|
|
||||||
connect(action(LogTimeStamps), &QAction::triggered,
|
connect(action(LogTimeStamps)->action(), &QAction::triggered,
|
||||||
this, &WatchTreeView::updateTimeColumn);
|
this, &WatchTreeView::updateTimeColumn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1194,7 +1194,7 @@ bool FakeVimPluginPrivate::initialize()
|
|||||||
readSettings();
|
readSettings();
|
||||||
|
|
||||||
Command *cmd = nullptr;
|
Command *cmd = nullptr;
|
||||||
cmd = ActionManager::registerAction(theFakeVimSetting(ConfigUseFakeVim),
|
cmd = ActionManager::registerAction(theFakeVimSetting(ConfigUseFakeVim)->action(),
|
||||||
INSTALL_HANDLER, Context(Core::Constants::C_GLOBAL), true);
|
INSTALL_HANDLER, Context(Core::Constants::C_GLOBAL), true);
|
||||||
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+V,Meta+Shift+V") : Tr::tr("Alt+V,Alt+V")));
|
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? Tr::tr("Meta+Shift+V,Meta+Shift+V") : Tr::tr("Alt+V,Alt+V")));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user