1
0
mirror of https://github.com/jaredtao/TaoQuick.git synced 2025-01-19 20:22:56 +08:00

remove unused function

This commit is contained in:
jared 2022-01-05 12:47:02 +08:00
parent 5e7db6ad2f
commit c7325181ff
2 changed files with 0 additions and 56 deletions

View File

@ -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<QMouseEvent*>(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<QMouseEvent*>(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)

View File

@ -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;
};