mirror of
https://github.com/jaredtao/TaoQuick.git
synced 2025-01-17 20:12:54 +08:00
remove unused function
This commit is contained in:
parent
5e7db6ad2f
commit
c7325181ff
@ -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)
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user