Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
MantidQt::API::ListPropertyWidget Class Reference

Widget for displaying a Property that has a set of allowed values. More...

#include <ListPropertyWidget.h>

Inheritance diagram for MantidQt::API::ListPropertyWidget:
MantidQt::API::PropertyWidget

Public Member Functions

QWidget * getMainWidget () override
 
QString getValue () const override
 
 ListPropertyWidget (Mantid::Kernel::Property *prop, QWidget *parent=nullptr, QGridLayout *layout=nullptr, int row=-1)
 Constructor. More...
 
void setValueImpl (const QString &value) override
 Set the value into the GUI. More...
 
 ~ListPropertyWidget () override
 Destructor. More...
 
- Public Member Functions inherited from MantidQt::API::PropertyWidget
void addReplaceWSButton ()
 Create and show the "Replace WS" button. More...
 
QGridLayout * getGridLayout ()
 
int getGridRow ()
 
virtual QWidget * getMainWidget ()=0
 
Mantid::Kernel::PropertygetProperty ()
 
virtual QString getValue () const =0
 Return the value of the property given the GUI state. More...
 
bool inGrid () const
 
 PropertyWidget (Mantid::Kernel::Property *prop, QWidget *parent=nullptr, QGridLayout *layout=nullptr, int row=-1)
 Constructor. More...
 
void setEnabled (bool val)
 Sets all widgets contained within to Enabled. More...
 
void setError (const QString &error)
 Externally set an error string to display in the validator. More...
 
void setPreviousValue (const QString &previousValue)
 Set this widget's previously-entered value. More...
 
void setValue (const QString &value)
 Set the value of the property given into the GUI state. More...
 
void setVisible (bool val) override
 Sets all widgets contained within to Visible. More...
 
 ~PropertyWidget () override
 Destructor. More...
 

Protected Attributes

QLabel * m_label
 Label (name of the property) More...
 
QListWidget * m_list
 List box with the allowed List. More...
 
- Protected Attributes inherited from MantidQt::API::PropertyWidget
QString m_doc
 Documentation string (tooltip) More...
 
QString m_enteredValue
 Stored the last non-previously-entered value entered entered by the user. More...
 
QString m_error
 Error message received when trying to set the value. More...
 
QGridLayout * m_gridLayout
 Grid layout of the dialog to which we are adding widgets. More...
 
QMap< Info, ClickableLabel * > m_icons
 Allow icon access by Info enum. More...
 
bool m_isOutputWsProp
 Whether or not the property is an output workspace. More...
 
QWidget * m_parent
 Parent widget to add sub-widgets to. More...
 
QString m_previousValue
 Stores the previously entered value when this dialog was last open. More...
 
Mantid::Kernel::Propertym_prop
 Property being looked at. This is NOT owned by the widget. More...
 
QPushButton * m_replaceWSButton
 Button to "replace input workspace". More...
 
int m_row
 If using the GridLayout, this is the row where the widget was inserted. More...
 
bool m_useHistory
 History on/off flag. More...
 
QVector< QWidget * > m_widgets
 All contained widgets. More...
 

Additional Inherited Members

- Public Types inherited from MantidQt::API::PropertyWidget
enum  Info { INVALID , REPLACE , RESTORE }
 
- Public Slots inherited from MantidQt::API::PropertyWidget
void replaceWSButtonClicked ()
 Deal with the "replace workspace" button being clicked. More...
 
void toggleUseHistory ()
 Toggle whether or not to use the previously-entered value. More...
 
void updateIconVisibility (const QString &error="")
 Update which icons should be shown. More...
 
void userEditedProperty ()
 To be called when a user edits a property, as opposed to one being set programmatically. More...
 
void valueChangedSlot ()
 Emits a signal that the value of the property was changed. More...
 
- Signals inherited from MantidQt::API::PropertyWidget
void replaceWorkspaceName (const QString &propName)
 Signal is emitted whenever someone clicks the replace WS button. More...
 
void userChangedProperty ()
 
void valueChanged (const QString &propName)
 Signal is emitted whenever the value (as entered by the user) in the GUI changes. More...
 
- 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. More...
 
- 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. More...
 

Detailed Description

Widget for displaying a Property that has a set of allowed values.

The display is then a multi selection list box instead of a Text box.

Definition at line 21 of file ListPropertyWidget.h.

Constructor & Destructor Documentation

◆ ListPropertyWidget()

MantidQt::API::ListPropertyWidget::ListPropertyWidget ( Mantid::Kernel::Property prop,
QWidget *  parent = nullptr,
QGridLayout *  layout = nullptr,
int  row = -1 
)

◆ ~ListPropertyWidget()

MantidQt::API::ListPropertyWidget::~ListPropertyWidget ( )
overridedefault

Destructor.

Member Function Documentation

◆ getMainWidget()

QWidget * MantidQt::API::ListPropertyWidget::getMainWidget ( )
inlineoverridevirtual
Returns
the main widget of this combo of widgets

Implements MantidQt::API::PropertyWidget.

Definition at line 32 of file ListPropertyWidget.h.

◆ getValue()

QString MantidQt::API::ListPropertyWidget::getValue ( ) const
overridevirtual
Returns
the value of the property, as typed in the GUI, as a string

Implements MantidQt::API::PropertyWidget.

Definition at line 61 of file ListPropertyWidget.cpp.

References m_list.

◆ setValueImpl()

void MantidQt::API::ListPropertyWidget::setValueImpl ( const QString &  value)
overridevirtual

Set the value into the GUI.

Parameters
value:: string representation of the value

Implements MantidQt::API::PropertyWidget.

Definition at line 77 of file ListPropertyWidget.cpp.

References Mantid::Kernel::Property::getDefault(), m_list, MantidQt::API::PropertyWidget::m_prop, and value.

Member Data Documentation

◆ m_label

QLabel* MantidQt::API::ListPropertyWidget::m_label
protected

Label (name of the property)

Definition at line 36 of file ListPropertyWidget.h.

Referenced by ListPropertyWidget().

◆ m_list

QListWidget* MantidQt::API::ListPropertyWidget::m_list
protected

List box with the allowed List.

Definition at line 39 of file ListPropertyWidget.h.

Referenced by getValue(), ListPropertyWidget(), and setValueImpl().


The documentation for this class was generated from the following files: