Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
mainwindow.h 1.03 KB
Copy Edit Web IDE Raw Blame History
unix_chen authored 2018-03-26 07:59 . init
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QCursor>
#include <QToolButton>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
protected:
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
//void paintEvent(QPaintEvent *event);
void enterEvent(QEvent *event);
void leaveEvent(QEvent *event);
void timerEvent(QTimerEvent *event);
void resizeEvent(QResizeEvent* event);
private slots:
void plus();
void windowMin();
void windowMax();
void windowClose();
private:
int m_mouseCurrID = 0;
QCursor m_cursor;
QPoint m_pressPoint;
bool m_moveFlag = false;
int m_moveHeight = 30; //鼠标移动窗口距离top的最大距离
QToolButton *m_plusButton;
QToolButton *m_minButton;
QToolButton *m_maxButton;
QToolButton *m_closeButton;
};
#endif // MAINWINDOW_H

Comment ( 0 )

Sign in for post a comment