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


ram_qt_guis
Author(s): Victor Lamoine - Institut Maupertuis
autogenerated on Mon Jun 10 2019 14:50:11