QGraphicsSceneMouseEvent::button() buttons() 有什么区别

button():Returns the mouse button (if any) that caused the event

导致该事件的,mousebutton.

Returns the combination of mouse buttons that were pressed at the time the event was sent.

事件发生时,正在按下着的 键,


如果此时按下/抬起的是鼠标左键,

函数 返回值
mousePressEvent()/mouseReleaseEvent() button() Qt::LeftButton
mousePressEvent()/mouseReleaseEvent() button() buttons()
mouseMoveEvent() button() Qt::NoButton
mouseMoveEvent() buttons() Qt::LeftButton

你可能感兴趣的:(QT)