Mantid
Loading...
Searching...
No Matches
AlgorithmProgressWidget.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8//----------------------------------
9// Includes
10//----------------------------------
16
17#include <QHBoxLayout>
18#include <QPointer>
19#include <QPushButton>
20#include <QWidget>
21#include <memory>
22
23class QProgressBar;
24class QString;
25
34namespace MantidQt {
35namespace MantidWidgets {
36
38 Q_OBJECT
39public:
40 AlgorithmProgressWidget(QWidget *parent = nullptr);
41
43 void algorithmStarted() override;
45 void algorithmEnded() override;
47 void blockUpdates(bool block = true);
49 void updateProgress(const double progress, const QString &message, const double estimatedTime,
50 const int progressPrecision) override;
51
52public slots:
53 void showDetailsDialog() override;
54
55private:
56 // Widgets are managed by Qt. This class owns them, and Qt will delete them on
57 // close.
59 QProgressBar *const m_progressBar;
61 QHBoxLayout *const m_layout;
63 QPushButton *const m_detailsButton;
66 QPointer<AlgorithmProgressDialogWidget> m_details;
68 std::unique_ptr<AlgorithmProgressPresenter> m_presenter;
69};
70
71} // namespace MantidWidgets
72} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
QPushButton *const m_detailsButton
Button to display the Details window.
QPointer< AlgorithmProgressDialogWidget > m_details
Pointer to the details dialog.
QProgressBar *const m_progressBar
Progress bar shown on the workbench.
std::unique_ptr< AlgorithmProgressPresenter > m_presenter
The presenter of the ProgressWidget.
QHBoxLayout *const m_layout
Layout that contains all the widget for displaying.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...