QMouseEvent 的button()和buttons() 两个接口返回值使用的注意事项(Precautions for using the return values of the buttons () and buttons () interfaces of qmouseevent)

Qt::MouseButton QMouseEvent::button() const

返回产生事件的按钮。

需要注意的是,对于鼠标移动事件,该函数返回值总是Qt::NoButton。

https://blog.csdn.net/weixin_30823001/article/details/97864508

————————

Qt::MouseButton QMouseEvent::button() const

Returns the button that generated the event.

It should be noted that for the < strong > mouse movement event < / strong >, the return value of this function is always QT:: nobutton.

https://blog.csdn.net/weixin_30823001/article/details/97864508