MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
progressview.cpp
Go to the documentation of this file.
1//=============================================================================================================
35//=============================================================================================================
36// INCLUDES
37//=============================================================================================================
38
39#include "progressview.h"
40#include "ui_progressview.h"
41
42//=============================================================================================================
43// USED NAMESPACES
44//=============================================================================================================
45
46using namespace DISPLIB;
47
48//=============================================================================================================
49// DEFINE MEMBER METHODS
50//=============================================================================================================
51
52ProgressView::ProgressView(bool bHorizontalMessage,
53 const QString& sStyleSheet)
55, m_pUi(new Ui::ProgressViewWidget)
56{
57 m_pUi->setupUi(this);
58
59 (bHorizontalMessage) ? setHorizontal() : setVertical();
60
61 if(sStyleSheet != ""){
62 m_pUi->m_VerticalLabel->setStyleSheet(sStyleSheet);
63 m_pUi->m_HorizonatlLabel->setStyleSheet(sStyleSheet);
64 }
65
66 m_pUi->m_progressBar->setMinimum(0);
67 m_pUi->m_progressBar->setMaximum(0);
68 m_pUi->m_progressBar->setValue(0);
69 m_pUi->m_progressBar->setTextVisible(false);
70 m_pUi->m_progressBar->setMaximumWidth(300);
71
72 m_pUi->m_progressBar->setAttribute(Qt::WA_Hover);
73}
74
75//=============================================================================================================
76
78{
79 delete m_pUi;
80}
81
82//=============================================================================================================
83
87
88//=============================================================================================================
89
93
94//=============================================================================================================
95
97{
98 Q_UNUSED(mode);
99}
100
101//=============================================================================================================
102
103void ProgressView::updateProcessingMode(ProcessingMode mode)
104{
105 Q_UNUSED(mode);
106}
107
108//=============================================================================================================
109
111{
112 m_pUi->m_VerticalLabel->hide();
113 m_pUi->m_HorizonatlLabel->show();
114}
115
116//=============================================================================================================
117
119{
120 m_pUi->m_VerticalLabel->show();
121 m_pUi->m_HorizonatlLabel->hide();
122}
123
124//=============================================================================================================
125
126void ProgressView::setMessage(const QString &sMessage)
127{
128 m_pUi->m_VerticalLabel->setText(sMessage);
129 m_pUi->m_HorizonatlLabel->setText(sMessage);
130}
131
132//=============================================================================================================
133
134void ProgressView::updateProgress(int iPercentage,
135 const QString& sMessage)
136{
137 m_pUi->m_progressBar->show();
138
139 if (m_pUi->m_progressBar->maximum() == 0){
140 m_pUi->m_progressBar->setMaximum(100);
141 }
142
143 m_pUi->m_progressBar->setValue(iPercentage);
144
145 if(sMessage != ""){
146 setMessage(sMessage);
147 }
148}
149
150//=============================================================================================================
151
153{
154 if (bVisible){
155 m_pUi->m_progressBar->show();
156 } else {
157 m_pUi->m_progressBar->hide();
158 }
159}
160
161//=============================================================================================================
162
164{
165
166}
Declaration of the ProgressView Class.
The AbstractView class provides the base calss for all Disp viewers.
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="")