00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef QRUBBERBAND_H
00025 #define QRUBBERBAND_H
00026
00027 #include <QtGui/qwidget.h>
00028
00029 QT_BEGIN_HEADER
00030
00031 QT_MODULE(Gui)
00032
00033 #ifndef QT_NO_RUBBERBAND
00034
00035 class QRubberBandPrivate;
00036
00037 class Q_GUI_EXPORT QRubberBand : public QWidget
00038 {
00039 Q_OBJECT
00040
00041 public:
00042 enum Shape { Line, Rectangle };
00043 explicit QRubberBand(Shape, QWidget * =0);
00044 ~QRubberBand();
00045
00046 Shape shape() const;
00047
00048 void setGeometry(const QRect &r);
00049
00050 inline void setGeometry(int x, int y, int w, int h);
00051 inline void move(int x, int y);
00052 inline void move(const QPoint &p)
00053 { move(p.x(), p.y()); }
00054 inline void resize(int w, int h)
00055 { setGeometry(geometry().x(), geometry().y(), w, h); }
00056 inline void resize(const QSize &s)
00057 { resize(s.width(), s.height()); }
00058
00059 protected:
00060 bool event(QEvent *e);
00061 void paintEvent(QPaintEvent *);
00062 void changeEvent(QEvent *);
00063 void showEvent(QShowEvent *);
00064 void resizeEvent(QResizeEvent *);
00065 void moveEvent(QMoveEvent *);
00066
00067 private:
00068 Q_DECLARE_PRIVATE(QRubberBand)
00069 };
00070
00071 inline void QRubberBand::setGeometry(int ax, int ay, int aw, int ah)
00072 { setGeometry(QRect(ax, ay, aw, ah)); }
00073 inline void QRubberBand::move(int ax, int ay)
00074 { setGeometry(ax, ay, width(), height()); }
00075
00076 #endif // QT_NO_RUBBERBAND
00077
00078 QT_END_HEADER
00079
00080 #endif // QRUBBERBAND_H