#ifndef SUI_H #define SUI_H #include "sui_title.h" typedef enum { UP=0, DOWN=1, LEFT, RIGHT, LEFTTOP, LEFTBOTTOM, RIGHTBOTTOM, RIGHTTOP, NONE }Orient; class sui : public QWidget { Q_OBJECT public: explicit sui(QWidget *parent = 0); ~sui(); sui_title* title() { return m_title; } void region(const QPoint ¤tGlobalPoint); //鼠标的位置,改变光标 private: QVBoxLayout *m_layout; QWidget *m_widget; QPoint m_point; bool m_press; int m_border_width; Orient ori; sui_title *m_title; protected: void paintEvent(QPaintEvent *event); void showEvent(QShowEvent *event); void mouseMoveEvent(QMouseEvent *event); void mousePressEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); }; #endif // SUI_H