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() 有很大差异。

另请参阅 globalX() 和globalY()。

[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 位置。

另请参阅 globalY() 和globalPos()。

[deprecated in 6.0] int QTabletEvent::globalY() const

自 6.0 版起,该函数已被弃用。我们强烈建议不要在新代码中使用该函数。

请使用globalPosition().y() 代替。

返回事件发生时平板设备的全局 y 位置。

另请参阅 globalX() 和globalPos()。

[deprecated in 6.0] QPoint QTabletEvent::pos() const

自 6.0 版起,该函数已被弃用。我们强烈建议不要在新代码中使用该函数。

请使用position().toPoint() 代替它。

返回设备相对于接收事件的部件的位置。

如果您根据鼠标事件移动部件,请使用globalPos() 代替此函数。

另请参阅 x()、y() 和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() 代替它。

返回设备相对于接收事件的 widget 的 x 位置。

另请参阅 y() 和pos()。

[deprecated in 6.0] int QTabletEvent::y() const

自 6.0 版起,该函数已被弃用。我们强烈建议不要在新代码中使用该函数。

请使用position().y() 代替。

返回设备相对于接收事件的 widget 的 y 位置。

另请参阅 x() 和pos()。

© 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.