15#include <QDialogButtonBox>
55 const std::string &customButtonLabel)
56 : QDialog(parent), m_wsList(nullptr), m_okButton(nullptr), m_customButton(nullptr) {
57 setWindowTitle(
"Mantid - Select workspace");
61 using VecWorkspaces = std::vector<Mantid::API::Workspace_sptr>;
64 workspaces.erase(std::remove_if(workspaces.begin(), workspaces.end(), comparitor), workspaces.end());
66 for (VecWorkspaces::const_iterator it = workspaces.begin(); it != workspaces.end(); ++it) {
68 tmp << QString::fromStdString((*it)->getName());
72 m_wsList->setSelectionMode(QAbstractItemView::MultiSelection);
74 auto *btnBox =
new QDialogButtonBox(Qt::Horizontal);
76 if (!customButtonLabel.empty()) {
77 m_customButton =
new QPushButton(QString::fromStdString(customButtonLabel));
78 btnBox->addButton(
m_customButton, QDialogButtonBox::DestructiveRole);
83 auto *cancelButton =
new QPushButton(
"Cancel");
84 btnBox->addButton(
m_okButton, QDialogButtonBox::AcceptRole);
85 btnBox->addButton(cancelButton, QDialogButtonBox::RejectRole);
86 connect(btnBox, SIGNAL(accepted()),
this, SLOT(accept()));
87 connect(btnBox, SIGNAL(rejected()),
this, SLOT(reject()));
89 auto *vLayout =
new QVBoxLayout();
91 vLayout->addWidget(btnBox);
103 foreach (QListWidgetItem *item, items) { res << item->text(); }
The Analysis data service stores instances of the Workspace objects and anything that derives from te...
Base MatrixWorkspace Abstract Class.
virtual const std::string id() const =0
A string ID for the class.
std::vector< std::shared_ptr< T > > getObjects(DataServiceHidden includeHidden=DataServiceHidden::Auto) const
Get a vector of the pointers to the data objects stored by the service.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace