| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #ifndef XTOOLBUTTON_H
- #define XTOOLBUTTON_H
- #include <QWidget>
- #include <QtCore>
- #include <QtGui>
- class XToolButton : public QWidget
- {
- Q_OBJECT
- public:
- explicit XToolButton(QWidget *parent = 0);
- ~XToolButton();
- void setPixmap(const QPixmap &);
- void setText(const QString &);
- void setMouseEnterFlag(bool);
- void setMousePressFlag(bool);
- protected:
- void enterEvent(QEvent *);
- void leaveEvent(QEvent *);
- void mousePressEvent(QMouseEvent *);
- void paintEvent(QPaintEvent *);
- signals:
- void signalLabelPress(XToolButton *);
- private:
- //functions
- void initVariable();
- void initSetupUi();
- void createFrame();
- void createWidget();
- void createLayout();
- void paintWidget(int, QPainter *);
- bool getMouseEnterFlag();
- bool getMousePressFlag();
- //members
- bool m_mouseEnterFlag;
- bool m_mousePressFlag;
- //pointer members
- QVBoxLayout *m_pLayout;
- QLabel *m_pLabelIcon;
- QLabel *m_pLabelText;
-
- };
- #endif // XTOOLBUTTON_H
|