File: simpleprogressbar.h

package info (click to toggle)
bornagain 1.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 118,800 kB
  • sloc: cpp: 469,684; python: 38,920; xml: 805; awk: 630; sh: 286; ansic: 37; makefile: 25
file content (46 lines) | stat: -rw-r--r-- 1,067 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef SIMPLEPROGRESSBAR_H
#define SIMPLEPROGRESSBAR_H

#include "../qt-manhattan-style_global.hpp"
#include <QWidget>

namespace Manhattan {

class QTMANHATTANSTYLESHARED_EXPORT SimpleProgressBar : public QWidget
{
    Q_OBJECT

public:
    explicit SimpleProgressBar(int width = 50, int height = 12, QWidget *parent = 0);
    virtual ~SimpleProgressBar();

    void setError(bool on);
    bool hasError() const;
    virtual QSize sizeHint() const;
    virtual void paintEvent(QPaintEvent *);
    int minimum() const { return m_minimum; }
    int maximum() const { return m_maximum; }
    int value() const { return m_value; }
    bool finished() const { return m_finished; }
    void setRange(int minimum, int maximum);
    void setValue(int value);
    void setFinished(bool b);

public slots:
    void reset();

private:
    QImage bar;
    QString m_text;
    bool m_error;
    int m_progressHeight;
    int m_progressWidth;
    int m_minimum;
    int m_maximum;
    int m_value;
    bool m_finished;
};

} // namespace Manhattan

#endif // SIMPLEPROGRESSBAR_H