以下成員源於類 QMouseEvent 被棄用。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。
(deprecated (6.4))
|
QMouseEvent (QEvent::Type type , const QPointF & localPos , Qt::MouseButton button , Qt::MouseButtons buttons , Qt::KeyboardModifiers modifiers , const QPointingDevice * device = QPointingDevice::primaryPointingDevice()) |
(deprecated (6.0))
QPoint
|
globalPos () const |
(deprecated (6.0))
int
|
globalX () const |
(deprecated (6.0))
int
|
globalY () const |
(deprecated (6.0))
QPointF
|
localPos () const |
(deprecated (6.0))
QPoint
|
pos () const |
(deprecated (6.0))
QPointF
|
screenPos () const |
(deprecated (6.0))
Qt::MouseEventSource
|
source () const |
(deprecated (6.0))
QPointF
|
windowPos () const |
(deprecated (6.0))
int
|
x () const |
(deprecated (6.0))
int
|
y () const |
This function is deprecated since 6.4. We strongly advise against using it in new code.
Use another constructor instead (global position is required).
Constructs a mouse event object originating from device .
The type 參數必須是某一 QEvent::MouseButtonPress , QEvent::MouseButtonRelease , QEvent::MouseButtonDblClick ,或 QEvent::MouseMove .
The localPos 是鼠標光標相對於接收 Widget 或項的位置。窗口位置會被設為相同值如 localPos 。 button 導緻給定值事件來自 Qt::MouseButton 枚舉。若事件 type is MouseMove ,此事件的相應按鈕為 Qt::NoButton 。事件發生時的鼠標和鍵盤狀態的指定是通過 buttons and modifiers .
The globalPosition () 被初始化為 QCursor::pos (),可能不閤適。使用其它構造函數以明確指定全局位置。
This function is deprecated since 6.0. We strongly advise against using it in new code.
使用 globalPosition ().toPoint() instead.
返迴鼠標光標的全局位置 當事件發生時 。這對異步窗口係統 (像 X11) 很重要。每當圍繞響應鼠標事件移動 Widget 時,globalPos() 會非常不同於當前指針位置 QCursor::pos (),和來自 QWidget::mapToGlobal ( pos ()).
This function is deprecated since 6.0. We strongly advise against using it in new code.
使用 globalPosition (). x () 代替。
返迴事件發生時的鼠標光標全局 X 位置。
另請參閱 globalY () 和 globalPos ().
This function is deprecated since 6.0. We strongly advise against using it in new code.
使用 globalPosition (). y () 代替。
返迴事件發生時的鼠標光標全局 Y 位置。
另請參閱 globalX () 和 globalPos ().
This function is deprecated since 6.0. We strongly advise against using it in new code.
使用 position () 代替。
將鼠標光標位置返迴作為 QPointF ,相對於接收事件的 Widget 或項。
若因鼠標事件導緻 Widget 移動,使用屏幕位置返迴通過 screenPos () 以避免晃動。
另請參閱 x (), y (), windowPos (),和 screenPos ().
This function is deprecated since 6.0. We strongly advise against using it in new code.
使用 position () 代替。
返迴鼠標光標的位置,相對於接收事件的 Widget。
若因鼠標事件導緻 Widget 移動,使用全局位置返迴通過 globalPos () 以避免晃動。
另請參閱 x (), y (),和 globalPos ().
This function is deprecated since 6.0. We strongly advise against using it in new code.
使用 globalPosition () 代替。
將鼠標光標位置返迴作為 QPointF ,相對於接收事件的屏幕。
另請參閱 x (), y (), pos (), localPos (),和 windowPos ().
This function is deprecated since 6.0. We strongly advise against using it in new code.
使用 pointingDevice () 代替。
返迴鼠標事件來源的有關信息。
The mouse event source can be used to distinguish between genuine and artificial mouse events. The latter are events that are synthesized from touch events by the operating system or Qt itself. This enum tells you from where it was synthesized; but often it's more useful to know from which device it was synthesized, so try to use pointingDevice () 代替。
注意: 很多平颱不提供這種信息。在這種平颱 Qt::MouseEventNotSynthesized 始終被返迴。
注意:
In Qt 5-based code, source() was often used to attempt to distinguish mouse events from an actual mouse vs. those that were synthesized because some legacy
QQuickItem
or
QWidget
subclass did not react to a
QTouchEvent
. However, you could not tell whether it was synthesized from a
QTouchEvent
或
QTabletEvent
, and other information was lost.
pointingDevice
() tells you the specific device that it came from, so you might check
pointingDevice()->type()
or
pointingDevice()->capabilities()
to decide how to react to this event. But it's even better to react to the original event rather than handling only mouse events.
另請參閱 Qt::MouseEventSource and QGraphicsSceneMouseEvent::source ().
This function is deprecated since 6.0. We strongly advise against using it in new code.
使用 scenePosition () 代替。
將鼠標光標位置返迴作為 QPointF ,相對接收事件的窗口。
若因鼠標事件導緻 Widget 移動,使用全局位置返迴通過 globalPos () 以避免晃動。
另請參閱 x (), y (), pos (), localPos (),和 screenPos ().
This function is deprecated since 6.0. We strongly advise against using it in new code.
使用 position ().x() instead.
返迴相對於接收事件 Widget 的鼠標光標 X 位置。
This function is deprecated since 6.0. We strongly advise against using it in new code.
使用 position ().y() instead.
返迴相對於接收事件 Widget 的鼠標光標 Y 位置。