From c7325181ff0958ad9cbcb1109bd118e1e1543070 Mon Sep 17 00:00:00 2001 From: jared Date: Wed, 5 Jan 2022 12:47:02 +0800 Subject: [PATCH] remove unused function --- .../src/TaoCommon/QuickTool/QuickTool.cpp | 46 ------------------- .../src/TaoCommon/QuickTool/QuickTool.h | 10 ---- 2 files changed, 56 deletions(-) diff --git a/3rdparty/TaoCommon/src/TaoCommon/QuickTool/QuickTool.cpp b/3rdparty/TaoCommon/src/TaoCommon/QuickTool/QuickTool.cpp index 8d54a65..89c8807 100644 --- a/3rdparty/TaoCommon/src/TaoCommon/QuickTool/QuickTool.cpp +++ b/3rdparty/TaoCommon/src/TaoCommon/QuickTool/QuickTool.cpp @@ -62,52 +62,6 @@ QPoint QuickTool::cursorGlobalPos() const return QCursor::pos(); } -void QuickTool::setMoveItemOnWindow(QQuickItem* item, QWindow* window) -{ - if (!item || !window) - { - return; - } - pMoveItem = item; - pMoveWindow = window; - pMoveWindow->installEventFilter(this); -} - -bool QuickTool::eventFilter(QObject* watched, QEvent* e) -{ - if (watched == pMoveWindow) - { - if (e->type() == QEvent::MouseButtonPress) - { - QMouseEvent* pE = static_cast(e); - if (pE && !mPressed) - { - if (pMoveItem->boundingRect().contains(pE->pos())) - { - mPressed = true; - } - } - } - else if (e->type() == QEvent::MouseButtonRelease) - { - mPressed = false; - } - else if (e->type() == QEvent::MouseMove) - { - QMouseEvent* pE = static_cast(e); - if (pE && mPressed) - { - if (pMoveItem->boundingRect().contains(pE->pos())) - { - pMoveWindow->startSystemMove(); - } - } - } - } - - return Super::eventFilter(watched, e); -} - QObject* QuickTool::getObject(const QString& targetObjName) const { if (!pRootObject) diff --git a/3rdparty/TaoCommon/src/TaoCommon/QuickTool/QuickTool.h b/3rdparty/TaoCommon/src/TaoCommon/QuickTool/QuickTool.h index 1b2a0bb..5622b48 100644 --- a/3rdparty/TaoCommon/src/TaoCommon/QuickTool/QuickTool.h +++ b/3rdparty/TaoCommon/src/TaoCommon/QuickTool/QuickTool.h @@ -41,16 +41,6 @@ public: Q_INVOKABLE QPoint cursorGlobalPos() const; - Q_INVOKABLE void setMoveItemOnWindow(QQuickItem* item, QWindow* window); - -protected: - bool eventFilter(QObject* watched, QEvent* e) override; - private: QObject* pRootObject = nullptr; - - QQuickItem* pMoveItem = nullptr; - QWindow* pMoveWindow = nullptr; - QPoint mLastPos; - bool mPressed = false; };