src/gui/widgets/qprogressbar.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.
00004 **
00005 ** This file is part of the QtGui module of the Qt Toolkit.
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://www.trolltech.com/products/qt/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://www.trolltech.com/products/qt/licensing.html or contact the
00017 ** sales department at sales@trolltech.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ****************************************************************************/
00023 
00024 #ifndef QPROGRESSBAR_H
00025 #define QPROGRESSBAR_H
00026 
00027 #include <QtGui/qframe.h>
00028 
00029 QT_BEGIN_HEADER
00030 
00031 QT_MODULE(Gui)
00032 
00033 #ifndef QT_NO_PROGRESSBAR
00034 
00035 class QProgressBarPrivate;
00036 
00037 class Q_GUI_EXPORT QProgressBar : public QWidget
00038 {
00039     Q_OBJECT
00040     Q_ENUMS(Direction)
00041     Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
00042     Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
00043     Q_PROPERTY(QString text READ text)
00044     Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged)
00045     Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
00046     Q_PROPERTY(bool textVisible READ isTextVisible WRITE setTextVisible)
00047     Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
00048     Q_PROPERTY(bool invertedAppearance READ invertedAppearance WRITE setInvertedAppearance)
00049     Q_PROPERTY(Direction textDirection READ textDirection WRITE setTextDirection)
00050     Q_PROPERTY(QString format READ format WRITE setFormat)
00051 
00052 public:
00053     enum Direction { TopToBottom, BottomToTop };
00054 
00055     explicit QProgressBar(QWidget *parent = 0);
00056 
00057     int minimum() const;
00058     int maximum() const;
00059 
00060     void setRange(int minimum, int maximum);
00061     int value() const;
00062 
00063     virtual QString text() const;
00064     void setTextVisible(bool visible);
00065     bool isTextVisible() const;
00066 
00067     Qt::Alignment alignment() const;
00068     void setAlignment(Qt::Alignment alignment);
00069 
00070     QSize sizeHint() const;
00071     QSize minimumSizeHint() const;
00072 
00073     Qt::Orientation orientation() const;
00074 
00075     void setInvertedAppearance(bool invert);
00076     bool invertedAppearance();
00077     void setTextDirection(QProgressBar::Direction textDirection);
00078     QProgressBar::Direction textDirection();
00079 
00080     void setFormat(const QString &format);
00081     QString format() const;
00082 
00083 public Q_SLOTS:
00084     void reset();
00085     void setMinimum(int minimum);
00086     void setMaximum(int maximum);
00087     void setValue(int value);
00088     void setOrientation(Qt::Orientation);
00089 
00090 Q_SIGNALS:
00091     void valueChanged(int value);
00092 
00093 protected:
00094     bool event(QEvent *e);
00095     void paintEvent(QPaintEvent *);
00096 
00097 private:
00098     Q_DECLARE_PRIVATE(QProgressBar)
00099     Q_DISABLE_COPY(QProgressBar)
00100 };
00101 
00102 #endif // QT_NO_PROGRESSBAR
00103 
00104 QT_END_HEADER
00105 
00106 #endif // QPROGRESSBAR_H

Generated on Thu Mar 15 11:57:04 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1