12#include <QProgressBar>
22 parent, this, model)} {
25 m_tree->setSelectionMode(QTreeWidget::NoSelection);
26 m_tree->setColumnWidth(0, 220);
27 m_tree->setHeaderLabels({
"Algorithm",
"Progress",
""});
28 auto header =
m_tree->header();
29 header->setSectionResizeMode(1, QHeaderView::Stretch);
30 header->setStretchLastSection(
false);
32 auto buttonLayout =
new QHBoxLayout();
33 const auto button =
new QPushButton(
"Close",
this);
35 connect(button, &QPushButton::clicked,
this, &AlgorithmProgressDialogWidget::close);
37 buttonLayout->addStretch();
38 buttonLayout->addWidget(button);
40 auto layout =
new QVBoxLayout();
42 layout->addLayout(buttonLayout);
45 setWindowTitle(
"Mantid - Algorithm Progress");
46 setWindowIcon(QIcon(
":/images/MantidIcon.ico"));
54std::pair<QTreeWidgetItem *, QProgressBar *>
56 const auto name = alg->name();
57 const auto &properties = alg->getProperties();
58 const auto item =
new QTreeWidgetItem(
m_tree, QStringList{QString::fromStdString(name)});
60 m_tree->addTopLevelItem(item);
61 auto progressBar =
new QProgressBar(
m_tree);
62 progressBar->setAlignment(Qt::AlignHCenter);
66 m_tree->setItemWidget(item, 1, progressBar);
67 m_tree->setItemWidget(item, 2, cancelButton);
69 for (
const auto &prop : properties) {
70 const auto &propAsString = prop->value();
71 if (!propAsString.empty()) {
72 item->addChild(
new QTreeWidgetItem(item, QStringList{QString::fromStdString(propAsString)}));
76 return std::make_pair(item, progressBar);
83 QDialog::closeEvent(event);
std::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm