|
Mantid
|
Widget for displaying a Property that has a set of allowed values. More...
#include <OptionsPropertyWidget.h>
Public Slots | |
| void | editingFinished () |
| Performs validation of the inputs when editing is finished. | |
Public Slots inherited from MantidQt::API::PropertyWidget | |
| void | replaceWSButtonClicked () |
| Deal with the "replace workspace" button being clicked. | |
| void | toggleUseHistory () |
| Toggle whether or not to use the previously-entered value. | |
| void | updateIconVisibility (const QString &error="") |
| Update which icons should be shown. | |
| void | userEditedProperty () |
| To be called when a user edits a property, as opposed to one being set programmatically. | |
| void | valueChangedSlot () |
| Emits a signal that the value of the property was changed. | |
Public Member Functions | |
| QWidget * | getMainWidget () override |
| QString | getValue () const override |
| OptionsPropertyWidget (Mantid::Kernel::Property *prop, QWidget *parent=nullptr, QGridLayout *layout=nullptr, int row=-1) | |
| Constructor. | |
| void | setValueImpl (const QString &value) override |
| Set the value into the GUI. | |
| ~OptionsPropertyWidget () override | |
| Destructor. | |
Public Member Functions inherited from MantidQt::API::PropertyWidget | |
| void | addReplaceWSButton () |
| Create and show the "Replace WS" button. | |
| QGridLayout * | getGridLayout () |
| int | getGridRow () |
| Mantid::Kernel::Property * | getProperty () |
| const Mantid::Kernel::Property * | getProperty () const |
| bool | inGrid () const |
| PropertyWidget (Mantid::Kernel::Property *prop, QWidget *parent=nullptr, QGridLayout *layout=nullptr, int row=-1) | |
| Constructor. | |
| void | setEnabled (bool val) |
| Sets all widgets contained within to Enabled. | |
| void | setError (const QString &error) |
| Externally set an error string to display in the validator. | |
| void | setPrevious_isDynamicDefault (bool flag) |
Set the isDynamicDefault flag associated with the previously-entered value. | |
| void | setPreviousValue (const QString &previousValue) |
| Set this widget's previously-entered value. | |
| void | setValue (const QString &value) |
| Set the value of the property given into the GUI state. | |
| void | setVisible (bool val) override |
| Sets all widgets contained within to Visible. | |
| void | transferHistoryState (const PropertyWidget *other, const PropertyWidget *upstream=nullptr) |
Transfer the history state from another PropertyWidget, possibly additionally depending on the history state of an upstream property. | |
| ~PropertyWidget () override | |
| Destructor. | |
Protected Attributes | |
| QComboBox * | m_combo |
| Combo box with the allowed options. | |
| QLabel * | m_label |
| Label (name of the property) | |
Protected Attributes inherited from MantidQt::API::PropertyWidget | |
| QString | m_doc |
| Documentation string (tooltip) | |
| bool | m_entered_isDynamicDefault |
Stores the isDynamicDefault flag corresponding to the last value entered by the user. | |
| QString | m_enteredValue |
| Stores the last value entered by the user. | |
| QString | m_error |
| Error message received when trying to set the value. | |
| QGridLayout * | m_gridLayout |
| Grid layout of the dialog to which we are adding widgets. | |
| QMap< Info, ClickableLabel * > | m_icons |
| Allow icon access by Info enum. | |
| bool | m_isOutputWsProp |
| Whether or not the property is an output workspace. | |
| QString | m_lastValue |
| Last modified value. | |
| QWidget * | m_parent |
| Parent widget to add sub-widgets to. | |
| bool | m_previous_isDynamicDefault |
Stores the isDynamicDefault flag corresponding to the previously entered value. | |
| QString | m_previousValue |
| Stores the previously entered value when this dialog was last open. | |
| Mantid::Kernel::Property * | m_prop |
| Property being looked at. This is NOT owned by the widget. | |
| QPushButton * | m_replaceWSButton |
| Button to "replace input workspace". | |
| int | m_row |
| If using the GridLayout, this is the row where the widget was inserted. | |
| bool | m_useHistory |
| History on/off flag. | |
| QVector< QWidget * > | m_widgets |
| All contained widgets. | |
Additional Inherited Members | |
Public Types inherited from MantidQt::API::PropertyWidget | |
| enum | Info { INVALID , REPLACE , RESTORE } |
Signals inherited from MantidQt::API::PropertyWidget | |
| void | replaceWorkspaceName (const QString &propName) |
| Signal is emitted whenever someone clicks the replace WS button. | |
| void | userChangedProperty () |
| void | valueChanged (const QString &propName) |
| Signal is emitted whenever the value (as entered by the user) in the GUI changes. | |
Static Public Member Functions inherited from MantidQt::API::PropertyWidget | |
| static void | setFieldPlaceholderText (Mantid::Kernel::Property *prop, QLineEdit *field) |
| Set the placeholder text of the given field based on the default value of the given property. | |
Static Protected Member Functions inherited from MantidQt::API::PropertyWidget | |
| static void | setLabelFont (Mantid::Kernel::Property *prop, QWidget *label) |
| Set the font of the given label based on the optional/required status of the given property. | |
Widget for displaying a Property that has a set of allowed values.
The display is then a drop-down box instead of a Text box.
Definition at line 24 of file OptionsPropertyWidget.h.
| MantidQt::API::OptionsPropertyWidget::OptionsPropertyWidget | ( | Mantid::Kernel::Property * | prop, |
| QWidget * | parent = nullptr, |
||
| QGridLayout * | layout = nullptr, |
||
| int | row = -1 |
||
| ) |
Constructor.
Definition at line 28 of file OptionsPropertyWidget.cpp.
References Mantid::Kernel::Property::allowedValues(), editingFinished(), m_combo, MantidQt::API::PropertyWidget::m_doc, MantidQt::API::PropertyWidget::m_gridLayout, m_label, MantidQt::API::PropertyWidget::m_parent, MantidQt::API::PropertyWidget::m_prop, MantidQt::API::PropertyWidget::m_row, MantidQt::API::PropertyWidget::m_widgets, Mantid::Kernel::Property::name(), MantidQt::API::PropertyWidget::setValue(), Mantid::Kernel::Property::type(), MantidQt::API::PropertyWidget::userEditedProperty(), and Mantid::Kernel::Property::value().
|
overridedefault |
Destructor.
|
slot |
Performs validation of the inputs when editing is finished.
Definition at line 84 of file OptionsPropertyWidget.cpp.
References Mantid::Kernel::Property::getDefault(), index, m_combo, MantidQt::API::PropertyWidget::m_prop, MantidQt::API::PropertyWidget::updateIconVisibility(), and value.
Referenced by OptionsPropertyWidget().
|
inlineoverridevirtual |
Implements MantidQt::API::PropertyWidget.
Definition at line 35 of file OptionsPropertyWidget.h.
|
overridevirtual |
Implements MantidQt::API::PropertyWidget.
Definition at line 68 of file OptionsPropertyWidget.cpp.
References m_combo.
|
overridevirtual |
Set the value into the GUI.
| value | :: string representation of the value |
Implements MantidQt::API::PropertyWidget.
Definition at line 74 of file OptionsPropertyWidget.cpp.
References Mantid::Kernel::Property::getDefault(), index, m_combo, MantidQt::API::PropertyWidget::m_prop, and value.
|
protected |
Combo box with the allowed options.
Definition at line 42 of file OptionsPropertyWidget.h.
Referenced by editingFinished(), getValue(), OptionsPropertyWidget(), and setValueImpl().
|
protected |
Label (name of the property)
Definition at line 39 of file OptionsPropertyWidget.h.
Referenced by OptionsPropertyWidget().