| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #ifndef XMAINWINDOW_H
- #define XMAINWINDOW_H
- #define VALUE_DIS 10
- #include <QWidget>
- #include <QtCore>
- #include <QtGui>
- #include <ximagebutton.h>
- #include "xtitlebar.h"
- #include "xtoolbar.h"
- #include "xstatusbar.h"
- #include "CustomUI_global.h"
- #include "xlabel.h"
- class CUSTOMUISHARED_EXPORT XMainWindow : public QWidget
- {
- Q_OBJECT
- public:
- explicit XMainWindow(QWidget *parent = 0);
- ~XMainWindow();
- enum enum_Direction
- {
- eNone,
- eTop = 1,
- eRight =2 ,
- eBottom =4,
- eLeft = 8,
- eTopRight = eTop + eRight,
- eRightBottom = eRight + eBottom,
- eBottomLeft = eBottom + eLeft,
- eLeftTop = eLeft + eTop
- };
- protected:
- void paintEvent(QPaintEvent *event);
- void mouseDoubleClickEvent(QMouseEvent *event);
- void mouseMoveEvent(QMouseEvent *event);
- void mousePressEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
- void moveEvent ( QMoveEvent * event );
- signals:
- private:
- void createFrame();
- void createWidget();
- void createLayout();
- void initUI();
- void initVariables();
- enum_Direction getPointPos(int nXRelative,int nYRelative);
- void setCursorStyle(enum_Direction direction);
- void setDragSize(QPoint destPos,enum_Direction direction);
- public slots:
- void slotOnMoveOffset(QPoint offset);
- void slotOnMin();
- void slotOnMaxRestore();
- void slotOnClose();
- private:
- QWidget *m_pContentWidget;
- QRect m_rectRestoreWindow;
- QPoint m_mouseSrcPos;
- enum_Direction m_eDirection;
- XTitleBar *m_pTitleBar;
- XToolBar *m_pToolBar;
- XStatusBar *m_pStatusBar;
- QVBoxLayout *m_pLayout;
- bool m_mouseResizeWindowFlag;
- bool m_mouseMoveWindowFlag;
- bool m_bMaxWin;
- };
- #endif // XMAINWINDOW_H
|