From 540d766925db176d54eff0b07a54bd65079da20c Mon Sep 17 00:00:00 2001 From: Gemma Guest <gemma.guest@stfc.ac.uk> Date: Thu, 26 Mar 2020 14:54:36 +0000 Subject: [PATCH] Improve the stitch params tooltip on the reflectometry GUI Previously this tooltip was misleading because it was referencing the transmission stitch params property of the reduction algorithm. This input is actually for all properties for the Stitch1DMany algorithm so we cannot take the documentation from a single algorithm property as we do for the other tooltips. Therefore, this commit adds a function to be able to set a tooltip independently of any algorithm and sets this tooltip manually. --- .../GUI/Experiment/ExperimentWidget.ui | 2 +- .../GUI/Experiment/QtExperimentView.cpp | 13 ++++++++++++- .../GUI/Experiment/QtExperimentView.h | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui index 87ce5f4fc24..4c6d279f7fb 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/ExperimentWidget.ui @@ -75,7 +75,7 @@ </size> </property> <property name="text"> - <string>Output Stitch Params</string> + <string>Output Stitch Properties</string> </property> </widget> </item> diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.cpp b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.cpp index bf8ae9f8a01..60a9a6fb9c2 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.cpp +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.cpp @@ -269,7 +269,6 @@ void QtExperimentView::registerExperimentSettingsWidgets( registerSettingWidget(*m_ui.transStitchParamsEdit, "Params", alg); registerSettingWidget(*m_ui.transScaleRHSCheckBox, "ScaleRHSWorkspace", alg); registerSettingWidget(*m_ui.polCorrCheckBox, "PolarizationAnalysis", alg); - registerSettingWidget(stitchOptionsLineEdit(), "Params", alg); registerSettingWidget(*m_ui.reductionTypeComboBox, "ReductionType", alg); registerSettingWidget(*m_ui.summationTypeComboBox, "SummationType", alg); registerSettingWidget(*m_ui.includePartialBinsCheckBox, "IncludePartialBins", @@ -277,6 +276,12 @@ void QtExperimentView::registerExperimentSettingsWidgets( registerSettingWidget(*m_ui.floodCorComboBox, "FloodCorrection", alg); registerSettingWidget(*m_ui.floodWorkspaceWsSelector, "FloodWorkspace", alg); registerSettingWidget(*m_ui.debugCheckBox, "Debug", alg); + + registerSettingWidget(stitchOptionsLineEdit(), + "Properties to use for stitching the output workspaces " + "in Q. Only required for groups containing multiple " + "rows. Start typing to see property hints or see " + "Stitch1DMany for details."); } void QtExperimentView::connectExperimentSettingsWidgets() { @@ -349,6 +354,12 @@ void QtExperimentView::registerSettingWidget( setToolTipAsPropertyDocumentation(widget, propertyName, alg); } +template <typename Widget> +void QtExperimentView::registerSettingWidget(Widget &widget, + std::string const &tooltip) { + widget.setToolTip(QString::fromStdString(tooltip)); +} + void QtExperimentView::setToolTipAsPropertyDocumentation( QWidget &widget, std::string const &propertyName, const Mantid::API::IAlgorithm_sptr &alg) { diff --git a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.h b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.h index 285ffe9cf06..2efaf48f3fd 100644 --- a/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.h +++ b/qt/scientific_interfaces/ISISReflectometry/GUI/Experiment/QtExperimentView.h @@ -141,6 +141,8 @@ private: template <typename Widget> void registerSettingWidget(Widget &widget, std::string const &propertyName, const Mantid::API::IAlgorithm_sptr &alg); + template <typename Widget> + void registerSettingWidget(Widget &widget, std::string const &tooltip); void connectSettingsChange(QLineEdit &edit); void connectSettingsChange(QComboBox &edit); void connectSettingsChange(QCheckBox &edit); -- GitLab