Obsolete Members for QQuickItem
类QQuickItem 的以下成员已被弃用。提供这些成员是为了保持旧源代码的正常运行。我们强烈建议不要在新代码中使用它们。
公共函数
(deprecated) void | grabMouse() |
(deprecated) void | grabTouchPoints(const QList<int> &ids) |
(deprecated) void | ungrabMouse() |
(deprecated) void | ungrabTouchPoints() |
成员函数文档
[deprecated]
void QQuickItem::grabMouse()
该函数已被弃用。我们强烈建议不要在新代码中使用它。
请使用QPointerEvent::setExclusiveGrabber().
抓取鼠标输入。
在调用ungrabMouse() 之前,该项目将接收所有鼠标事件。通常不应该调用该函数,因为接受鼠标按下事件可以确保后续事件都会传递给该项目。如果项目想从当前接收者那里接管鼠标事件,则需要调用此函数。
警告 应谨慎使用此函数。
[deprecated]
void QQuickItem::grabTouchPoints(const QList<int> &ids)
该函数已被弃用。我们强烈建议不要在新代码中使用它。
请使用QPointerEvent::setExclusiveGrabber().抓取ids 指定的触摸点。
这些触摸点将由该项目拥有,直到它们被释放。另外,抓取也可能被过滤项目(如 Flickable)窃取。使用setKeepTouchGrab() 可防止抓取被窃取。
[deprecated]
void QQuickItem::ungrabMouse()
该函数已被弃用。我们强烈建议不要在新代码中使用它。
使用QPointerEvent::setExclusiveGrabber()
在调用grabMouse() 后释放鼠标抓取。
请注意,只有当项目希望停止处理其他事件时才可调用此函数。没有必要在释放或取消事件后调用此函数,因为在任何情况下都不会再接收到其他事件。调用此函数后,将不会有移动或释放事件发生。
[deprecated]
void QQuickItem::ungrabTouchPoints()
该函数已被弃用。我们强烈建议不要在新代码中使用它。
请使用 QEventPoint::setExclusiveGrabber() 代替它。解除此项目拥有的触摸点。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.