문제

I have a child class of QGraphicsItem with Selectable and Movable flags. When I select many items and moving them, all recieves itemChange event. Is there any way to detect in itemChanged that mouse's button is still pressed?

도움이 되었습니까?

해결책

Please refer to the QApplication::mouseButtons() function that will return the current state of the mouse buttons Qt::MouseButtons.

Qt::MouseButtons btns = QApplication::mouseButtons();
if (btns & Qt::LeftButton) {
    // The left button is pressed.
    [..]
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top