Obsolete Members for QTabletEvent
QTabletEvent 类的以下成员已被废弃。提供这些成员是为了确保旧的源代码能够继续运行。我们强烈建议不要在新代码中使用它们。
公共函数
(deprecated in 6.0) QPoint | globalPos() const |
(deprecated in 6.0) const QPointF | globalPosF() const |
(deprecated in 6.0) int | globalX() const |
(deprecated in 6.0) int | globalY() const |
(deprecated in 6.0) QPoint | pos() const |
(deprecated in 6.0) const QPointF | posF() const |
(deprecated in 6.0) qint64 | uniqueId() const |
(deprecated in 6.0) int | x() const |
(deprecated in 6.0) int | y() const |
成员函数文档
[deprecated in 6.0] QPoint QTabletEvent::globalPos() const
自 6.0 版本起,此函数已被废弃。我们强烈建议不要在新代码中使用它。
请改用 `globalPosition()`.toPoint()。
返回事件发生时设备的全局位置。这在 X11 等异步窗口系统中尤为重要;每当您响应鼠标事件移动控件时,globalPos() 的返回值可能与当前位置QCursor::pos() 存在显著差异。
[deprecated in 6.0] const QPointF QTabletEvent::globalPosF() const
自 6.0 版本起,此函数已被废弃。我们强烈建议不要在新代码中使用它。
请改用 `globalPosition()`。该函数返回事件发生时设备的全局位置。在 X11 等异步窗口系统中,这一点尤为重要;每当您根据鼠标事件移动控件时,`globalPosF()` 返回的值可能与 `QCursor::pos()` 返回的当前位置存在显著差异。
另请参阅 posF()。
[deprecated in 6.0] int QTabletEvent::globalX() const
自 6.0 版本起,此函数已被废弃。我们强烈建议在新代码中不要使用它。
请改用 `globalPosition()` 或 `x()`。
返回事件发生时鼠标指针的全球 x 坐标。
[deprecated in 6.0] int QTabletEvent::globalY() const
自 6.0 版本起,此函数已被废弃。我们强烈建议不要在新代码中使用它。
请改用 `globalPosition()` 和 `y()`。
返回事件发生时平板设备的全局 y 坐标。
[deprecated in 6.0] QPoint QTabletEvent::pos() const
自 6.0 起,此函数已弃用。我们强烈建议不要在新代码中使用它。
请改用 `position().toPoint()`。
返回设备相对于接收该事件的小部件的位置。
如果您需要根据鼠标事件移动控件,请使用 `globalPos()` 代替此函数。
[deprecated in 6.0] const QPointF QTabletEvent::posF() const
自 6.0 版本起,此函数已被废弃。我们强烈建议不要在新代码中使用它。
请改用position()。
返回设备相对于接收该事件的小部件的位置。
如果您需要根据鼠标事件移动控件,请使用globalPosF() 代替此函数。
另请参阅 ` globalPosF()`。
[deprecated in 6.0] qint64 QTabletEvent::uniqueId() const
自 6.0 版本起,此函数已被废弃。我们强烈建议不要在新代码中使用它。
请改用 `pointingDevice().uniqueId()`。
返回当前设备的唯一 ID,从而能够区分平板电脑上同时使用的多台设备。
此功能的支持情况取决于平板电脑。
同一台设备的值在不同的操作系统上可能会有所不同。
Linux 版 Wacom 驱动程序的较新版本现在会报告 ID 信息。如果您拥有一台支持唯一 ID 的绘图板,但在 Linux 上无法获得该信息,请考虑升级驱动程序。
从 Qt 4.2 开始,无论笔的朝向如何,唯一 ID 都保持不变。在某些操作系统上,早期版本在使用触控笔的橡皮头端与笔尖端时,会报告不同的值。
另请参阅 pointerType()。
[deprecated in 6.0] int QTabletEvent::x() const
自 6.0 起,此函数已被废弃。我们强烈建议不要在新代码中使用它。
请改用 `position().x()`。
返回设备相对于接收该事件的控件的 x 坐标。
[deprecated in 6.0] int QTabletEvent::y() const
自 6.0 版本起,此函数已被弃用。我们强烈建议不要在新代码中使用它。
请改用 `position().y()`。
返回设备相对于接收该事件的小部件的 y 坐标。
© 2026 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.