chore: make use of Qt's startSystemMove()
This commit is contained in:
parent
e58cc703f3
commit
4c438629e7
|
@ -23,6 +23,7 @@
|
||||||
#include <QListView>
|
#include <QListView>
|
||||||
#include <QCollator>
|
#include <QCollator>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
|
#include <QWindow>
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent)
|
MainWindow::MainWindow(QWidget *parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
|
@ -183,7 +184,6 @@ void MainWindow::mousePressEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->buttons() & Qt::LeftButton && !isMaximized()) {
|
if (event->buttons() & Qt::LeftButton && !isMaximized()) {
|
||||||
m_clickedOnWindow = true;
|
m_clickedOnWindow = true;
|
||||||
m_oldMousePos = event->pos();
|
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ void MainWindow::mousePressEvent(QMouseEvent *event)
|
||||||
void MainWindow::mouseMoveEvent(QMouseEvent *event)
|
void MainWindow::mouseMoveEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->buttons() & Qt::LeftButton && m_clickedOnWindow) {
|
if (event->buttons() & Qt::LeftButton && m_clickedOnWindow) {
|
||||||
move(event->globalPos() - m_oldMousePos);
|
window()->windowHandle()->startSystemMove();
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,6 @@ private slots:
|
||||||
void on_minimumWindowBtn_clicked();
|
void on_minimumWindowBtn_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPoint m_oldMousePos;
|
|
||||||
bool m_clickedOnWindow = false;
|
bool m_clickedOnWindow = false;
|
||||||
bool m_playbackSliderPressed = false;
|
bool m_playbackSliderPressed = false;
|
||||||
QLinearGradient m_bgLinearGradient;
|
QLinearGradient m_bgLinearGradient;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user