kivio
stencilbarbutton.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef STENCILBARBUTTON_H
00020 #define STENCILBARBUTTON_H
00021
00022 #include <qpushbutton.h>
00023
00024 class QPixmap;
00025 namespace Kivio {
00026
00027 class DragBarButton : public QPushButton
00028 {
00029 Q_OBJECT
00030 public:
00031 DragBarButton( const QString&, QWidget* parent, const char* name = 0 );
00032 ~DragBarButton();
00033
00034 void setIcon( const QString& );
00035 void setPixmap( const QPixmap& );
00036
00037 QSize sizeHint() const;
00038
00039 Qt::Orientation orientation() const { return m_orientation; }
00040
00041 signals:
00042 void beginDrag();
00043 void finishDrag();
00044 void closeRequired(DragBarButton *);
00045
00046 public slots:
00047 void setOrientation(Orientation orientation);
00048
00049 protected:
00050 void drawButton( QPainter* );
00051 void mousePressEvent( QMouseEvent* );
00052 void mouseReleaseEvent( QMouseEvent* );
00053 void mouseMoveEvent( QMouseEvent* );
00054
00055 void enterEvent( QEvent* );
00056 void leaveEvent( QEvent* );
00057
00058 private:
00059 QPixmap* m_pClosePix;
00060 QPixmap* m_pIcon;
00061 bool m_bPressed;
00062 bool m_bDragged;
00063 bool m_bMouseOn;
00064 bool m_bClose;
00065 QPoint m_ppoint;
00066 Qt::Orientation m_orientation;
00067 };
00068
00069 }
00070
00071 #endif
00072
|