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(new 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
57{
58 delete m_pUi;
59}
60
61//=============================================================================================================
62
66
67//=============================================================================================================
68
72
73//=============================================================================================================
74
76{
77 Q_UNUSED(mode);
78}
79
80//=============================================================================================================
81
83{
84 Q_UNUSED(mode);
85}
86
87//=============================================================================================================
88
90{
91 m_pUi->m_VerticalLabel->hide();
92 m_pUi->m_HorizonatlLabel->show();
93}
94
95//=============================================================================================================
96
98{
99 m_pUi->m_VerticalLabel->show();
100 m_pUi->m_HorizonatlLabel->hide();
101}
102
103//=============================================================================================================
104
105void ProgressView::setMessage(const QString &sMessage)
106{
107 m_pUi->m_VerticalLabel->setText(sMessage);
108 m_pUi->m_HorizonatlLabel->setText(sMessage);
109}
110
111//=============================================================================================================
112
113void ProgressView::updateProgress(int iPercentage,
114 const QString& sMessage)
115{
116 m_pUi->m_progressBar->show();
117
118 if (m_pUi->m_progressBar->maximum() == 0){
119 m_pUi->m_progressBar->setMaximum(100);
120 }
121
122 m_pUi->m_progressBar->setValue(iPercentage);
123
124 if(sMessage != ""){
125 setMessage(sMessage);
126 }
127}
128
129//=============================================================================================================
130
132{
133 if (bVisible){
134 m_pUi->m_progressBar->show();
135 } else {
136 m_pUi->m_progressBar->hide();
137 }
138}
139
140//=============================================================================================================
141
143{
144
145}
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="")