Mantid
Loading...
Searching...
No Matches
qt
widgets
common
src
ProgressableView.cpp
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
#include "
MantidQtWidgets/Common/ProgressableView.h
"
8
9
namespace
MantidQt::MantidWidgets
{
10
11
bool
ProgressableView::isPercentageIndicator
()
const
{
return
m_style
==
Style::PERCENTAGE
; }
12
13
void
ProgressableView::setProgressRange
(
int
min,
int
max) {
14
// Cache values for a percentage-style progress bar i.e. where both are not
15
// zero
16
if
(min != 0 || max != 0) {
17
m_min
= min;
18
m_max
= max;
19
}
20
}
21
22
void
ProgressableView::setAsPercentageIndicator
() {
23
m_style
=
Style::PERCENTAGE
;
24
setProgressRange
(
m_min
,
m_max
);
25
}
26
27
void
ProgressableView::setAsEndlessIndicator
() {
28
m_style
=
Style::ENDLESS
;
29
// To get QProgressBar to display as an endless progress indicator, we need
30
// to set start=end=0 in the derived view class
31
if
(
m_style
==
Style::ENDLESS
)
32
setProgressRange
(0, 0);
33
}
34
}
// namespace MantidQt::MantidWidgets
ProgressableView.h
MantidQt::MantidWidgets::ProgressableView::setProgressRange
virtual void setProgressRange(int min, int max)
Definition:
ProgressableView.cpp:13
MantidQt::MantidWidgets::ProgressableView::m_style
Style m_style
Definition:
ProgressableView.h:34
MantidQt::MantidWidgets::ProgressableView::m_min
int m_min
Definition:
ProgressableView.h:35
MantidQt::MantidWidgets::ProgressableView::setAsEndlessIndicator
void setAsEndlessIndicator()
Definition:
ProgressableView.cpp:27
MantidQt::MantidWidgets::ProgressableView::isPercentageIndicator
bool isPercentageIndicator() const
Definition:
ProgressableView.cpp:11
MantidQt::MantidWidgets::ProgressableView::Style::ENDLESS
@ ENDLESS
MantidQt::MantidWidgets::ProgressableView::Style::PERCENTAGE
@ PERCENTAGE
MantidQt::MantidWidgets::ProgressableView::m_max
int m_max
Definition:
ProgressableView.h:36
MantidQt::MantidWidgets::ProgressableView::setAsPercentageIndicator
void setAsPercentageIndicator()
Definition:
ProgressableView.cpp:22
MantidQt::MantidWidgets
Definition:
AddWorkspaceDialog.h:21
Generated on Tue Jan 3 2023 11:58:02 for Mantid by
1.9.5