v2.0.0
Loading...
Searching...
No Matches
progressview.cpp
Go to the documentation of this file.
1//=============================================================================================================
13
14//=============================================================================================================
15// INCLUDES
16//=============================================================================================================
17
18#include "progressview.h"
19#include "ui_progressview.h"
20
21//=============================================================================================================
22// USED NAMESPACES
23//=============================================================================================================
24
25using namespace DISPLIB;
26
27//=============================================================================================================
28// DEFINE MEMBER METHODS
29//=============================================================================================================
30
31ProgressView::ProgressView(bool bHorizontalMessage,
32 const QString& sStyleSheet)
34, m_pUi(std::make_unique<Ui::ProgressViewWidget>())
35{
36 m_pUi->setupUi(this);
37
38 (bHorizontalMessage) ? setHorizontal() : setVertical();
39
40 if (sStyleSheet != "") {
41 m_pUi->m_VerticalLabel->setStyleSheet(sStyleSheet);
42 m_pUi->m_HorizonatlLabel->setStyleSheet(sStyleSheet);
43 }
44
45 m_pUi->m_progressBar->setMinimum(0);
46 m_pUi->m_progressBar->setMaximum(0);
47 m_pUi->m_progressBar->setValue(0);
48 m_pUi->m_progressBar->setTextVisible(false);
49 m_pUi->m_progressBar->setMaximumWidth(300);
50
51 m_pUi->m_progressBar->setAttribute(Qt::WA_Hover);
52}
53
54//=============================================================================================================
55
59
60//=============================================================================================================
61
65
66//=============================================================================================================
67
71
72//=============================================================================================================
73
75{
76 Q_UNUSED(mode);
77}
78
79//=============================================================================================================
80
82{
83 Q_UNUSED(mode);
84}
85
86//=============================================================================================================
87
89{
90 m_pUi->m_VerticalLabel->hide();
91 m_pUi->m_HorizonatlLabel->show();
92}
93
94//=============================================================================================================
95
97{
98 m_pUi->m_VerticalLabel->show();
99 m_pUi->m_HorizonatlLabel->hide();
100}
101
102//=============================================================================================================
103
104void ProgressView::setMessage(const QString& sMessage)
105{
106 m_pUi->m_VerticalLabel->setText(sMessage);
107 m_pUi->m_HorizonatlLabel->setText(sMessage);
108}
109
110//=============================================================================================================
111
112void ProgressView::updateProgress(int iPercentage,
113 const QString& sMessage)
114{
115 m_pUi->m_progressBar->show();
116
117 if (m_pUi->m_progressBar->maximum() == 0) {
118 m_pUi->m_progressBar->setMaximum(100);
119 }
120
121 m_pUi->m_progressBar->setValue(iPercentage);
122
123 if (sMessage != "") {
124 setMessage(sMessage);
125 }
126}
127
128//=============================================================================================================
129
131{
132 if (bVisible) {
133 m_pUi->m_progressBar->show();
134 } else {
135 m_pUi->m_progressBar->hide();
136 }
137}
138
139//=============================================================================================================
140
142{
143}
Labelled QProgressBar with an automatic show / hide behaviour.
2-D display widgets and visualisation helpers (charts, topography, colour maps).
AbstractView(QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
void updateProgress(int iPercentage, const QString &sMessage="")
virtual void updateGuiMode(GuiMode mode)
void setLoadingBarVisible(bool bVisible)
void setMessage(const QString &sMessage)
virtual void updateProcessingMode(ProcessingMode mode)
virtual void saveSettings()
virtual void loadSettings()
ProgressView(bool bHorizontalMessage=false, const QString &sStyleSheet="")