progress_dialog.cpp
Go to the documentation of this file.
2 
4 {
5  setWindowTitle("Action progress");
6  setModal(true);
7  resize(350, 100);
8 
9  progress_value_ = new QProgressBar;
10  progress_value_->setRange(0, 100);
11  progress_value_->setValue(0);
12 
13  progress_message_ = new QLabel;
14 
15  cancel_button_ = new QPushButton("Cancel");
16  connect(cancel_button_, SIGNAL(clicked()), this, SLOT(reject()));
17 
18  QVBoxLayout* main_layout = new QVBoxLayout(this);
19  main_layout->addWidget(progress_value_);
20  main_layout->addWidget(progress_message_);
21  main_layout->addWidget(cancel_button_);
22 
23  connect(this, SIGNAL(drawProgress(int, QString)), this, SLOT(progressChanged(int, QString)));
24  connect(this, SIGNAL(drawProgress(int)), this, SLOT(progressChanged(int)));
25  connect(this, SIGNAL(drawProgress(QString)), this, SLOT(progressChanged(QString)));
26 }
27 
28 void
30 {
31  if (progress_value_->value() == 100)
32  Q_EMIT accept();
33 }
34 
35 void
37  const QString msg)
38 {
39  if (value)
40  progress_value_->setValue(value);
41  if (!msg.isEmpty())
42  progress_message_->setText(msg);
43 }
44 
45 void
47 {
48  progress_value_->setValue(value);
49 }
50 
51 void
53 {
54  progress_message_->setText(msg);
55 }
56 
void progressValueChanged()
QProgressBar * progress_value_
void drawProgress(const int value, const QString msg)
QPushButton * cancel_button_
void progressChanged(const int value, const QString msg)
QLabel * progress_message_


rqt_bag_exporter
Author(s): Romain Hernandez, Victor Lamoine - Institut Maupertuis
autogenerated on Mon Jun 10 2019 14:57:01