All Classes Namespaces Functions Variables Enumerations Properties Pages
doubleprogressdialog.h
1 /*
2 
3 Pencil2D - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2012-2020 Matthew Chiawen Chang
6 
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; version 2 of the License.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 */
17 
18 #ifndef DOUBLEPROGRESSDIALOG_H
19 #define DOUBLEPROGRESSDIALOG_H
20 
21 #include <QDialog>
22 #include <QProgressBar>
23 
24 namespace Ui {
26 }
27 
29 {
30  Q_OBJECT
31 
32 public:
33  explicit DoubleProgressDialog(QWidget *parent = nullptr);
35 
36  QString getStatus();
37  void setStatus(QString msg);
38 
40  public:
42 
43  float getMin() { return min; }
44  void setMin(float minimum);
45 
46  float getMax() { return max; }
47  void setMax(float maximum);
48 
49  void setRange(float minimum, float maximum) { setMin(minimum); setMax(maximum); }
50 
51  float getValue() { return val; }
52  void setValue(float value);
53 
54  int getPrecision();
55  void setPrecision(int e);
56  private:
57  QProgressBar *bar;
58  float min = 0, max = 1, val = 0;
59 
60  int convertUnits(float value);
61  int unitFactor = 100;
62  };
63 
64  ProgressBarControl *major, *minor;
65 
66 signals:
67  void canceled();
68 
69 private:
70  Ui::DoubleProgressDialog *ui;
71 };
72 
73 #endif // DOUBLEPROGRESSDIALOG_H
Q_OBJECTQ_OBJECT
QObject * parent() const const