File: qtprogress.h

package info (click to toggle)
turqstat 3.0-2
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 2,112 kB
  • ctags: 1,328
  • sloc: cpp: 17,929; perl: 252; makefile: 223; ansic: 75; sh: 16
file content (52 lines) | stat: -rw-r--r-- 1,686 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
47
48
49
50
51
52
// Copyright (c) 2002-2008 Peter Karlsson
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#ifndef __QTPROGRESS_H
#define __QTPROGRESS_

#include <qdialog.h>
#include <qlabel.h>

/**
 * Class describing a window showing the progress when reading an area where
 * the total number of messages is unknown. The dialog will show the number
 * of read messages as text, instead of drawing a bar like QProgressBar.
 */
class ProgressText : public QDialog
{
    Q_OBJECT

protected:
    /** The label used to display the progress. */
	QLabel *m_progress_p;

public:
    /**
     * Standard constructor. Create a window ready to display the progress
     * of the message base reader.
     * @param parent Parent widget owning the window.
     * @param name   Name given to this instance.
     * @param title  Title to display in window.
     */
    ProgressText(QWidget *parent, const char *name, const QString &title);

    /**
     * Update the progress indicator.
     * @param number Number of messages read so far.
     */
    void setProgress(int number) { m_progress_p->setNum(number); }
};

#endif