Commit 9515a3ee authored by Martyn Gigg's avatar Martyn Gigg
Browse files

Use newer QAction::triggered signal in Mantid Qt code

Removes warnings about using a COMPAT signal on startup.
parent fcc1d020
This diff is collapsed.
......@@ -643,7 +643,7 @@ public slots:
void updateCurves(Table *t, const QString &name);
void showTable(const QString &curve);
void showTable(int i);
void showTable(QAction *action);
void addColToTable();
void cutSelection();
......
......@@ -98,8 +98,8 @@ MantidDockWidget::MantidDockWidget(MantidUI *mui, ApplicationWindow *parent)
m_loadMapper = new QSignalMapper(this);
m_loadMapper->setMapping(liveDataAction, "StartLiveData");
m_loadMapper->setMapping(loadFileAction, "Load");
connect(liveDataAction, SIGNAL(activated()), m_loadMapper, SLOT(map()));
connect(loadFileAction, SIGNAL(activated()), m_loadMapper, SLOT(map()));
connect(liveDataAction, SIGNAL(triggered()), m_loadMapper, SLOT(map()));
connect(loadFileAction, SIGNAL(triggered()), m_loadMapper, SLOT(map()));
connect(m_loadMapper, SIGNAL(mapped(const QString &)), m_mantidUI,
SLOT(showAlgorithmDialog(const QString &)));
m_loadMenu->addAction(loadFileAction);
......@@ -196,11 +196,11 @@ void MantidDockWidget::createWorkspaceMenuActions() {
connect(m_colorFill, SIGNAL(triggered()), this, SLOT(drawColorFillPlot()));
m_showDetectors = new QAction(tr("Show Detectors"), this);
connect(m_showDetectors, SIGNAL(activated()), this,
connect(m_showDetectors, SIGNAL(triggered()), this,
SLOT(showDetectorTable()));
m_showBoxData = new QAction(tr("Show Box Data Table"), this);
connect(m_showBoxData, SIGNAL(activated()), m_mantidUI,
connect(m_showBoxData, SIGNAL(triggered()), m_mantidUI,
SLOT(importBoxDataTable()));
m_showVatesGui = new QAction(tr("Show Vates Simple Interface"), this);
......@@ -211,18 +211,18 @@ void MantidDockWidget::createWorkspaceMenuActions() {
QSize(), QIcon::Normal, QIcon::Off);
m_showVatesGui->setIcon(icon);
}
connect(m_showVatesGui, SIGNAL(activated()), m_mantidUI,
connect(m_showVatesGui, SIGNAL(triggered()), m_mantidUI,
SLOT(showVatesSimpleInterface()));
m_showMDPlot = new QAction(tr("Plot MD"), this);
connect(m_showMDPlot, SIGNAL(activated()), m_mantidUI, SLOT(showMDPlot()));
connect(m_showMDPlot, SIGNAL(triggered()), m_mantidUI, SLOT(showMDPlot()));
m_showListData = new QAction(tr("List Data"), this);
connect(m_showListData, SIGNAL(activated()), m_mantidUI,
connect(m_showListData, SIGNAL(triggered()), m_mantidUI,
SLOT(showListData()));
m_showSpectrumViewer = new QAction(tr("Show Spectrum Viewer"), this);
connect(m_showSpectrumViewer, SIGNAL(activated()), m_mantidUI,
connect(m_showSpectrumViewer, SIGNAL(triggered()), m_mantidUI,
SLOT(showSpectrumViewer()));
m_showSliceViewer = new QAction(tr("Show Slice Viewer"), this);
......@@ -233,7 +233,7 @@ void MantidDockWidget::createWorkspaceMenuActions() {
QSize(), QIcon::Normal, QIcon::Off);
m_showSliceViewer->setIcon(icon);
}
connect(m_showSliceViewer, SIGNAL(activated()), m_mantidUI,
connect(m_showSliceViewer, SIGNAL(triggered()), m_mantidUI,
SLOT(showSliceViewer()));
m_showLogs = new QAction(tr("Sample Logs..."), this);
......@@ -249,11 +249,11 @@ void MantidDockWidget::createWorkspaceMenuActions() {
SLOT(showAlgorithmHistory()));
m_saveNexus = new QAction(tr("Save Nexus"), this);
connect(m_saveNexus, SIGNAL(activated()), m_mantidUI,
connect(m_saveNexus, SIGNAL(triggered()), m_mantidUI,
SLOT(saveNexusWorkspace()));
m_rename = new QAction(tr("Rename"), this);
connect(m_rename, SIGNAL(activated()), this, SLOT(renameWorkspace()));
connect(m_rename, SIGNAL(triggered()), this, SLOT(renameWorkspace()));
m_delete = new QAction(tr("Delete"), this);
connect(m_delete, SIGNAL(triggered()), this, SLOT(deleteWorkspaces()));
......@@ -276,7 +276,7 @@ void MantidDockWidget::createWorkspaceMenuActions() {
SLOT(convertMDHistoToMatrixWorkspace()));
m_clearUB = new QAction(tr("Clear UB Matrix"), this);
connect(m_clearUB, SIGNAL(activated()), this, SLOT(clearUB()));
connect(m_clearUB, SIGNAL(triggered()), this, SLOT(clearUB()));
m_plotSurface = new QAction(tr("Plot Surface from Group"), this);
connect(m_plotSurface, SIGNAL(triggered()), this, SLOT(plotSurface()));
......@@ -321,12 +321,12 @@ void MantidDockWidget::createSortMenuActions() {
m_sortChoiceGroup->setExclusive(true);
m_byNameChoice->setChecked(true);
connect(m_ascendingSortAction, SIGNAL(activated()), this,
connect(m_ascendingSortAction, SIGNAL(triggered()), this,
SLOT(sortAscending()));
connect(m_descendingSortAction, SIGNAL(activated()), this,
connect(m_descendingSortAction, SIGNAL(triggered()), this,
SLOT(sortDescending()));
connect(m_byNameChoice, SIGNAL(activated()), this, SLOT(chooseByName()));
connect(m_byLastModifiedChoice, SIGNAL(activated()), this,
connect(m_byNameChoice, SIGNAL(triggered()), this, SLOT(chooseByName()));
connect(m_byLastModifiedChoice, SIGNAL(triggered()), this,
SLOT(chooseByLastModified()));
m_sortMenu->addActions(sortDirectionGroup->actions());
......@@ -1295,7 +1295,7 @@ void MantidDockWidget::popupMenu(const QPoint &pos) {
QString name = QString::fromStdString(programNames[i]);
// Setup new menu option for the program
m_program = new QAction(name, this);
connect(m_program, SIGNAL(activated()), m_programMapper, SLOT(map()));
connect(m_program, SIGNAL(triggered()), m_programMapper, SLOT(map()));
// Send name of program when clicked
m_programMapper->setMapping(m_program, name);
m_saveToProgram->addAction(m_program);
......
......@@ -138,46 +138,46 @@ MantidUI::MantidUI(ApplicationWindow *aw)
actionCopyRowToTable = new QAction(this);
actionCopyRowToTable->setIcon(QIcon(getQPixmap("table_xpm")));
connect(actionCopyRowToTable, SIGNAL(activated()), this,
connect(actionCopyRowToTable, SIGNAL(triggered()), this,
SLOT(copyRowToTable()));
actionCopyRowToGraph = new QAction(this);
actionCopyRowToGraph->setIcon(QIcon(getQPixmap("graph_xpm")));
connect(actionCopyRowToGraph, SIGNAL(activated()), this,
connect(actionCopyRowToGraph, SIGNAL(triggered()), this,
SLOT(copyRowToGraph()));
actionCopyRowToGraphErr = new QAction(this);
actionCopyRowToGraphErr->setIcon(QIcon(getQPixmap("graph_xpm")));
connect(actionCopyRowToGraphErr, SIGNAL(activated()), this,
connect(actionCopyRowToGraphErr, SIGNAL(triggered()), this,
SLOT(copyRowToGraphErr()));
actionWaterfallPlot = new QAction(QIcon(":/waterfall_plot.png"),
tr("Plot spectra as waterfall"), this);
connect(actionWaterfallPlot, SIGNAL(activated()), this,
connect(actionWaterfallPlot, SIGNAL(triggered()), this,
SLOT(copyRowsToWaterfall()));
actionCopyDetectorsToTable = new QAction(tr("View detectors table"), this);
actionCopyDetectorsToTable->setIcon(QIcon(getQPixmap("table_xpm")));
connect(actionCopyDetectorsToTable, SIGNAL(activated()), this,
connect(actionCopyDetectorsToTable, SIGNAL(triggered()), this,
SLOT(copyDetectorsToTable()));
actionCopyValues = new QAction(tr("Copy"), this);
actionCopyValues->setIcon(QIcon(getQPixmap("copy_xpm")));
connect(actionCopyValues, SIGNAL(activated()), this, SLOT(copyValues()));
connect(actionCopyValues, SIGNAL(triggered()), this, SLOT(copyValues()));
actionCopyColumnToTable = new QAction(this);
actionCopyColumnToTable->setIcon(QIcon(getQPixmap("table_xpm")));
connect(actionCopyColumnToTable, SIGNAL(activated()), this,
connect(actionCopyColumnToTable, SIGNAL(triggered()), this,
SLOT(copyColumnToTable()));
actionCopyColumnToGraph = new QAction(this);
actionCopyColumnToGraph->setIcon(QIcon(getQPixmap("graph_xpm")));
connect(actionCopyColumnToGraph, SIGNAL(activated()), this,
connect(actionCopyColumnToGraph, SIGNAL(triggered()), this,
SLOT(copyColumnToGraph()));
actionCopyColumnToGraphErr = new QAction(this);
actionCopyColumnToGraphErr->setIcon(QIcon(getQPixmap("graph_xpm")));
connect(actionCopyColumnToGraphErr, SIGNAL(activated()), this,
connect(actionCopyColumnToGraphErr, SIGNAL(triggered()), this,
SLOT(copyColumnToGraphErr()));
connect(this, SIGNAL(needToCreateLoadDAEMantidMatrix(const QString &)), this,
......@@ -2176,11 +2176,11 @@ void MantidUI::menuMantidMatrixAboutToShow() {
menuMantidMatrix->addAction(action);
action = new QAction("Save Nexus", this);
connect(action, SIGNAL(activated()), this, SLOT(saveNexusWorkspace()));
connect(action, SIGNAL(triggered()), this, SLOT(saveNexusWorkspace()));
menuMantidMatrix->addAction(action);
action = new QAction("Rename", this);
connect(action, SIGNAL(activated()), this, SLOT(renameWorkspace()));
connect(action, SIGNAL(triggered()), this, SLOT(renameWorkspace()));
menuMantidMatrix->addAction(action);
// separate delete
......
......@@ -376,7 +376,7 @@ void FitControl::loadBuiltInModels(QMenu *menuModels) {
for (int i = 0; i < modelNames.size(); i++) {
QAction *actionModel = new QAction(modelNames.at(i), this);
mapperModel->setMapping(actionModel, modelNames.at(i));
connect(actionModel, SIGNAL(activated()), mapperModel, SLOT(map()));
connect(actionModel, SIGNAL(triggered()), mapperModel, SLOT(map()));
menuModels->addAction(actionModel);
}
connect(mapperModel, SIGNAL(mapped(const QString &)), this,
......
......@@ -173,13 +173,13 @@ void EditLocalParameterDialog::showContextMenu() {
{
QAction *action = new QAction("Copy", this);
action->setToolTip("Copy data to clipboard.");
connect(action, SIGNAL(activated()), this, SLOT(copy()));
connect(action, SIGNAL(triggered()), this, SLOT(copy()));
menu->addAction(action);
}
{
QAction *action = new QAction("Paste", this);
action->setToolTip("Paste data from clipboard.");
connect(action, SIGNAL(activated()), this, SLOT(paste()));
connect(action, SIGNAL(triggered()), this, SLOT(paste()));
auto text = QApplication::clipboard()->text();
action->setEnabled(!text.isEmpty());
menu->addAction(action);
......
......@@ -245,12 +245,12 @@ void SANSRunWindow::initLayout() {
m_uiForm.batch_table->setContextMenuPolicy(Qt::ActionsContextMenu);
m_batch_paste = new QAction(tr("&Paste"), m_uiForm.batch_table);
m_batch_paste->setShortcut(tr("Ctrl+P"));
connect(m_batch_paste, SIGNAL(activated()), this, SLOT(pasteToBatchTable()));
connect(m_batch_paste, SIGNAL(triggered()), this, SLOT(pasteToBatchTable()));
m_uiForm.batch_table->addAction(m_batch_paste);
m_batch_clear = new QAction(tr("&Clear"), m_uiForm.batch_table);
m_uiForm.batch_table->addAction(m_batch_clear);
connect(m_batch_clear, SIGNAL(activated()), this, SLOT(clearBatchTable()));
connect(m_batch_clear, SIGNAL(triggered()), this, SLOT(clearBatchTable()));
// Main Logging
m_uiForm.logging_field->attachLoggingChannel();
......
......@@ -305,10 +305,10 @@ void FitPropertyBrowser::initLayout(QWidget *w) {
m_fitMapper->setMapping(m_fitActionSeqFit, "SeqFit");
m_fitMapper->setMapping(m_fitActionUndoFit, "UndoFit");
m_fitMapper->setMapping(m_fitActionEvaluate, "Evaluate");
connect(m_fitActionFit, SIGNAL(activated()), m_fitMapper, SLOT(map()));
connect(m_fitActionSeqFit, SIGNAL(activated()), m_fitMapper, SLOT(map()));
connect(m_fitActionUndoFit, SIGNAL(activated()), m_fitMapper, SLOT(map()));
connect(m_fitActionEvaluate, SIGNAL(activated()), m_fitMapper, SLOT(map()));
connect(m_fitActionFit, SIGNAL(triggered()), m_fitMapper, SLOT(map()));
connect(m_fitActionSeqFit, SIGNAL(triggered()), m_fitMapper, SLOT(map()));
connect(m_fitActionUndoFit, SIGNAL(triggered()), m_fitMapper, SLOT(map()));
connect(m_fitActionEvaluate, SIGNAL(triggered()), m_fitMapper, SLOT(map()));
connect(m_fitMapper, SIGNAL(mapped(const QString &)), this,
SLOT(executeFitMenu(const QString &)));
m_fitMenu->addAction(m_fitActionFit);
......@@ -331,11 +331,11 @@ void FitPropertyBrowser::initLayout(QWidget *w) {
displayMapper->setMapping(m_displayActionPlotGuess, "PlotGuess");
displayMapper->setMapping(m_displayActionQuality, "Quality");
displayMapper->setMapping(m_displayActionClearAll, "ClearAll");
connect(m_displayActionPlotGuess, SIGNAL(activated()), displayMapper,
connect(m_displayActionPlotGuess, SIGNAL(triggered()), displayMapper,
SLOT(map()));
connect(m_displayActionQuality, SIGNAL(activated()), displayMapper,
connect(m_displayActionQuality, SIGNAL(triggered()), displayMapper,
SLOT(map()));
connect(m_displayActionClearAll, SIGNAL(activated()), displayMapper,
connect(m_displayActionClearAll, SIGNAL(triggered()), displayMapper,
SLOT(map()));
connect(displayMapper, SIGNAL(mapped(const QString &)), this,
SLOT(executeDisplayMenu(const QString &)));
......
......@@ -148,7 +148,7 @@ InstrumentWidget::InstrumentWidget(const QString &wsName, QWidget *parent,
// Init actions
m_clearPeakOverlays = new QAction("Clear peaks", this);
connect(m_clearPeakOverlays, SIGNAL(activated()), this,
connect(m_clearPeakOverlays, SIGNAL(triggered()), this,
SLOT(clearPeakOverlays()));
// confirmClose(app->confirmCloseInstrWindow);
......
......@@ -208,38 +208,38 @@ InstrumentWidgetMaskTab::InstrumentWidgetMaskTab(InstrumentWidget *instrWidget)
new QAction("As Detector Mask to workspace", this);
m_save_as_workspace_exclude->setToolTip(
"Save current detector mask to mask workspace.");
connect(m_save_as_workspace_exclude, SIGNAL(activated()), this,
connect(m_save_as_workspace_exclude, SIGNAL(triggered()), this,
SLOT(saveMaskToWorkspace()));
m_save_as_workspace_include =
new QAction("As Detector ROI to workspace", this);
m_save_as_workspace_include->setToolTip(
"Save current detector mask as ROI to mask workspace.");
connect(m_save_as_workspace_include, SIGNAL(activated()), this,
connect(m_save_as_workspace_include, SIGNAL(triggered()), this,
SLOT(saveInvertedMaskToWorkspace()));
m_save_as_file_exclude = new QAction("As Detector Mask to file", this);
m_save_as_file_exclude->setToolTip(
"Save current detector mask to mask file.");
connect(m_save_as_file_exclude, SIGNAL(activated()), this,
connect(m_save_as_file_exclude, SIGNAL(triggered()), this,
SLOT(saveMaskToFile()));
m_save_as_file_include = new QAction("As Detector ROI to file", this);
m_save_as_file_include->setToolTip("Save current mask as ROI to mask file.");
connect(m_save_as_file_include, SIGNAL(activated()), this,
connect(m_save_as_file_include, SIGNAL(triggered()), this,
SLOT(saveInvertedMaskToFile()));
m_save_as_cal_file_exclude =
new QAction("As Detector Mask to cal file", this);
m_save_as_cal_file_exclude->setToolTip(
"Save current detector mask to cal file.");
connect(m_save_as_cal_file_exclude, SIGNAL(activated()), this,
connect(m_save_as_cal_file_exclude, SIGNAL(triggered()), this,
SLOT(saveMaskToCalFile()));
m_save_as_cal_file_include = new QAction("As Detector ROI to cal file", this);
m_save_as_cal_file_include->setToolTip(
"Save current detector mask as ROI to cal file.");
connect(m_save_as_cal_file_include, SIGNAL(activated()), this,
connect(m_save_as_cal_file_include, SIGNAL(triggered()), this,
SLOT(saveInvertedMaskToCalFile()));
m_save_as_table_xrange_exclude =
......@@ -249,29 +249,29 @@ InstrumentWidgetMaskTab::InstrumentWidgetMaskTab(InstrumentWidget *instrWidget)
"The name of output table workspace is 'MaskBinTable'. "
"If the output table workspace has alrady exist, then "
"the newly masked detectors will be added to output workspace.");
connect(m_save_as_table_xrange_exclude, SIGNAL(activated()), this,
connect(m_save_as_table_xrange_exclude, SIGNAL(triggered()), this,
SLOT(saveMaskToTable()));
m_save_group_file_include = new QAction("As include group to file", this);
m_save_group_file_include->setToolTip(
"Save current mask as include group to a file.");
connect(m_save_group_file_include, SIGNAL(activated()), this,
connect(m_save_group_file_include, SIGNAL(triggered()), this,
SLOT(saveIncludeGroupToFile()));
m_save_group_file_exclude = new QAction("As exclude group to file", this);
m_save_group_file_exclude->setToolTip(
"Save current mask as exclude group to a file.");
connect(m_save_group_file_exclude, SIGNAL(activated()), this,
connect(m_save_group_file_exclude, SIGNAL(triggered()), this,
SLOT(saveExcludeGroupToFile()));
m_extract_to_workspace = new QAction("Extract detectors to workspace", this);
m_extract_to_workspace->setToolTip("Extract detectors to workspace.");
connect(m_extract_to_workspace, SIGNAL(activated()), this,
connect(m_extract_to_workspace, SIGNAL(triggered()), this,
SLOT(extractDetsToWorkspace()));
m_sum_to_workspace = new QAction("Sum detectors to workspace", this);
m_sum_to_workspace->setToolTip("Sum detectors to workspace.");
connect(m_sum_to_workspace, SIGNAL(activated()), this,
connect(m_sum_to_workspace, SIGNAL(triggered()), this,
SLOT(sumDetsToWorkspace()));
// Save button and its menus
......
......@@ -322,11 +322,11 @@ void MessageDisplay::initActions() {
m_logLevelMapping->setMapping(m_information, Poco::Message::PRIO_INFORMATION);
m_logLevelMapping->setMapping(m_debug, Poco::Message::PRIO_DEBUG);
connect(m_error, SIGNAL(activated()), m_logLevelMapping, SLOT(map()));
connect(m_warning, SIGNAL(activated()), m_logLevelMapping, SLOT(map()));
connect(m_notice, SIGNAL(activated()), m_logLevelMapping, SLOT(map()));
connect(m_information, SIGNAL(activated()), m_logLevelMapping, SLOT(map()));
connect(m_debug, SIGNAL(activated()), m_logLevelMapping, SLOT(map()));
connect(m_error, SIGNAL(triggered()), m_logLevelMapping, SLOT(map()));
connect(m_warning, SIGNAL(triggered()), m_logLevelMapping, SLOT(map()));
connect(m_notice, SIGNAL(triggered()), m_logLevelMapping, SLOT(map()));
connect(m_information, SIGNAL(triggered()), m_logLevelMapping, SLOT(map()));
connect(m_debug, SIGNAL(triggered()), m_logLevelMapping, SLOT(map()));
connect(m_logLevelMapping, SIGNAL(mapped(int)), this,
SLOT(setGlobalLogLevel(int)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment