Mantid
Loading...
Searching...
No Matches
AlgorithmPropertiesWidget.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "DllOption.h"
13#include <QWidget>
14
15class QGridLayout;
16class QGroupBox;
17class QScrollArea;
18
19namespace Mantid {
20namespace Kernel {
21class Property;
22}
23} // namespace Mantid
24
25namespace MantidQt {
26namespace API {
27class PropertyWidget;
28
36 Q_OBJECT
37 Q_PROPERTY(QString algorithmName READ getAlgorithmName WRITE setAlgorithmName)
38
39public:
40 AlgorithmPropertiesWidget(QWidget *parent = nullptr);
42
43 void setInputHistory(MantidQt::API::AbstractAlgorithmInputHistory *inputHistory);
44
45 void initLayout();
46
47 Mantid::API::IAlgorithm_sptr getAlgorithm();
48 void setAlgorithm(const Mantid::API::IAlgorithm_sptr &algo);
49
50 QString getAlgorithmName() const;
51 void setAlgorithmName(QString name);
52
53 void addEnabledAndDisableLists(const QStringList &enabled, const QStringList &disabled);
54
55 void hideOrDisableProperties(const QString &changedPropName = "");
56
57 void saveInput();
58
61
64
66 QWidget *m_viewport;
67
69 QScrollArea *m_scroll;
70
71public slots:
73 void propertyChanged(const QString &changedPropName);
74
76 void replaceWSClicked(const QString &propName);
77
78private:
79 bool isWidgetEnabled(Mantid::Kernel::Property *property, const QString &propName) const;
80
82 QString m_algoName;
83
86
88 QGridLayout *m_inputGrid;
89
91 QGridLayout *m_currentGrid;
92
96
98 QStringList m_enabled;
99
102 QStringList m_disabled;
103
106};
107
108} // namespace API
109} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
This abstract class deals with the loading and saving of previous algorithm property values to/from M...
Widget that contains dynamically generated PropertyWidget's for each property of an algorithm,...
QScrollArea * m_scroll
Scroll area containing the viewport.
MantidQt::API::AbstractAlgorithmInputHistory * m_inputHistory
History of inputs to the algorithm.
Mantid::API::IAlgorithm_sptr m_algo
Pointer to the algorithm to view.
QStringList m_enabled
A list of property names that are FORCED to stay enabled.
QGridLayout * m_inputGrid
The grid widget containing the input boxes.
QHash< QString, QString > m_errors
A map where key = property name; value = the error for this property (i.e.
QWidget * m_viewport
Viewport containing the grid of property widgets.
QHash< QString, QGroupBox * > m_groupWidgets
Mapping between group and it's dynamically created widget.
QHash< QString, PropertyWidget * > m_propWidgets
Each dynamically created PropertyWidget.
QStringList m_disabled
A list of property names that are FORCED to stay disabled.
QGridLayout * m_currentGrid
The current grid widget for sub-boxes.
~AlgorithmPropertiesWidget() override
Destructor.
Base class for properties.
Definition: Property.h:94
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
Helper class which provides the Collimation Length for SANS instruments.