Mantid
|
Widget for FileProperty, which has a "Browse" button. More...
#include <FilePropertyWidget.h>
Public Slots | |
void | browseClicked () |
Slot called when the browse button is clicked. More... | |
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... | |
Public Member Functions | |
FilePropertyWidget (Mantid::Kernel::Property *prop, QWidget *parent=nullptr, QGridLayout *layout=nullptr, int row=-1) | |
Constructor. More... | |
~FilePropertyWidget () override | |
Destructor. More... | |
Public Member Functions inherited from MantidQt::API::TextPropertyWidget | |
QWidget * | getMainWidget () override |
QString | getValue () const override |
void | setValueImpl (const QString &value) override |
Set the value into the GUI. More... | |
TextPropertyWidget (Mantid::Kernel::Property *prop, QWidget *parent=nullptr, QGridLayout *layout=nullptr, int row=-1) | |
Constructor. More... | |
~TextPropertyWidget () 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::Property * | getProperty () |
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... | |
Static Public Member Functions | |
static QString | openFileDialog (Mantid::Kernel::Property *baseProp) |
Open the file dialog for a given property. More... | |
static QStringList | openMultipleFileDialog (Mantid::Kernel::Property *baseProp) |
Open a file selection box to select Multiple files to load. 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... | |
Protected Attributes | |
QPushButton * | m_browseButton |
"Browse" button More... | |
Mantid::API::FileProperty * | m_fileProp |
Is a file property. More... | |
Mantid::API::MultipleFileProperty * | m_multipleFileProp |
Is a multiple file property. More... | |
Protected Attributes inherited from MantidQt::API::TextPropertyWidget | |
QLabel * | m_label |
Label (name of the property) More... | |
QLineEdit * | m_textbox |
The text box to edit. 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::Property * | m_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 } |
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 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... | |
Widget for FileProperty, which has a "Browse" button.
Definition at line 24 of file FilePropertyWidget.h.
MantidQt::API::FilePropertyWidget::FilePropertyWidget | ( | Mantid::Kernel::Property * | prop, |
QWidget * | parent = nullptr , |
||
QGridLayout * | layout = nullptr , |
||
int | row = -1 |
||
) |
Constructor.
Definition at line 20 of file FilePropertyWidget.cpp.
References browseClicked(), m_browseButton, m_fileProp, MantidQt::API::PropertyWidget::m_gridLayout, m_multipleFileProp, MantidQt::API::PropertyWidget::m_parent, MantidQt::API::PropertyWidget::m_prop, MantidQt::API::PropertyWidget::m_row, MantidQt::API::PropertyWidget::m_widgets, MantidQt::API::PropertyWidget::setValue(), and Mantid::Kernel::Property::value().
|
overridedefault |
Destructor.
|
slot |
Slot called when the browse button is clicked.
Definition at line 44 of file FilePropertyWidget.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_fileProp, m_multipleFileProp, MantidQt::API::PropertyWidget::m_prop, MantidQt::API::TextPropertyWidget::m_textbox, openFileDialog(), openMultipleFileDialog(), and MantidQt::API::PropertyWidget::userEditedProperty().
Referenced by FilePropertyWidget().
|
static |
Open the file dialog for a given property.
baseProp | :: Property pointer |
Definition at line 91 of file FilePropertyWidget.cpp.
References MantidQt::API::FileDialogHandler::getCaption(), MantidQt::API::FileDialogHandler::getFilter(), MantidQt::API::FileDialogHandler::getSaveFileName(), and Mantid::Kernel::SingletonHolder< T >::Instance().
Referenced by browseClicked(), and MantidQt::API::AlgorithmDialog::openFileDialog().
|
static |
Open a file selection box to select Multiple files to load.
baseProp,: | pointer to an instance of MultipleFileProperty used to set up the valid extensions for opening multiple file dialog. |
Definition at line 131 of file FilePropertyWidget.cpp.
References MantidQt::API::FileDialogHandler::getFilter(), and Mantid::Kernel::SingletonHolder< T >::Instance().
Referenced by browseClicked().
|
protected |
"Browse" button
Definition at line 40 of file FilePropertyWidget.h.
Referenced by FilePropertyWidget().
|
protected |
Is a file property.
Definition at line 43 of file FilePropertyWidget.h.
Referenced by browseClicked(), and FilePropertyWidget().
|
protected |
Is a multiple file property.
Definition at line 46 of file FilePropertyWidget.h.
Referenced by browseClicked(), and FilePropertyWidget().