12#include <QDesktopWidget>
29 :
API::AlgorithmDialog(parent), m_form() {}
40 std::string wsName = qWSName.toStdString();
47 m_form.cbColumnE->insertItem(-1,
"");
48 std::vector<std::string> columns = tws->getColumnNames();
51 QString defaultXColumn;
52 QString defaultYColumn;
53 QString defaultEColumn;
54 for (std::vector<std::string>::const_iterator column = columns.begin(); column != columns.end(); ++column) {
55 QString qName = QString::fromStdString(*column);
56 m_form.cbColumnX->addItem(qName);
57 m_form.cbColumnY->addItem(qName);
58 m_form.cbColumnE->addItem(qName);
60 if (col->getPlotType() == 1 && defaultXColumn.isEmpty())
62 defaultXColumn = qName;
64 if (col->getPlotType() == 2 && defaultYColumn.isEmpty())
66 defaultYColumn = qName;
68 if (col->getPlotType() == 5 && defaultEColumn.isEmpty())
70 defaultEColumn = qName;
74 if (!defaultXColumn.isEmpty()) {
75 int i =
m_form.cbColumnX->findText(defaultXColumn);
77 m_form.cbColumnX->setCurrentIndex(i);
80 if (!defaultYColumn.isEmpty()) {
81 int i =
m_form.cbColumnY->findText(defaultYColumn);
83 m_form.cbColumnY->setCurrentIndex(i);
86 if (!defaultEColumn.isEmpty()) {
87 int i =
m_form.cbColumnE->findText(defaultEColumn);
89 m_form.cbColumnE->setCurrentIndex(i);
109 QString presetInputWorkspace = this->
getInputValue(
"InputWorkspace");
111 if (!presetInputWorkspace.isEmpty()) {
112 int i =
m_form.cbInputWorkspace->findText(presetInputWorkspace);
114 m_form.cbInputWorkspace->setCurrentIndex(i);
117 connect(
m_form.cbInputWorkspace, SIGNAL(currentIndexChanged(
const QString &)),
this,
#define DECLARE_DIALOG(classname)
QString getInputValue(const QString &propName) const
Get an input value from the form, dealing with blank inputs etc.
void fillAndSetComboBox(const QString &propName, QComboBox *optionsBox) const
Fill a combo box for the named algorithm's allowed values.
QLayout * createDefaultButtonLayout(const QString &helpText=QString("?"), const QString &loadText=QString("Run"), const QString &cancelText=QString("Close"), const QString &keepOpenText=QString("Keep Open"))
Create a row layout of buttons with specified text.
QWidget * tie(QWidget *widget, const QString &property, QLayout *parent_layout=nullptr, bool readHistory=true)
Tie a widget to a property.
This class gives specialised dialog for the ConvertTableToMatrixWorkspace algorithm.
Ui::ConvertTableToMatrixWorkspaceDialog m_form
Form.
void fillColumnNames(const QString &)
Update the column name widgets.
void initLayout() override
Initialize the layout.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< Column > Column_sptr
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace