delayedPressTarget = q->scene()->mouseGrabberItem();
delayedPressEvent = new QGraphicsSceneMouseEvent(event->type());
delayedPressEvent->setAccepted(false);
- for (int i = 0x1; i <= 0x10; i <<= 1) {
+ for (int i = Qt::LeftButton; i <= Qt::MiddleButton; i <<= 1) {
if (event->buttons() & i) {
Qt::MouseButton button = Qt::MouseButton(i);
delayedPressEvent->setButtonDownPos(button, event->buttonDownPos(button));
bool stealThisEvent = d->stealMouse;
if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab() || disabledItem)) {
mouseEvent.setAccepted(false);
- for (int i = 0x1; i <= 0x10; i <<= 1) {
+ for (int i = Qt::LeftButton; i <= Qt::MiddleButton; i <<= 1) {
if (event->buttons() & i) {
Qt::MouseButton button = Qt::MouseButton(i);
mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
bool stealThisEvent = d->stealMouse;
if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
mouseEvent.setAccepted(false);
- for (int i = 0x1; i <= 0x10; i <<= 1) {
+ for (int i = Qt::LeftButton; i <= Qt::MiddleButton; i <<= 1) {
if (event->buttons() & i) {
Qt::MouseButton button = Qt::MouseButton(i);
mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
bool stealThisEvent = d->stealMouse;
if ((stealThisEvent || myRect.contains(event->scenePos().toPoint())) && (!grabber || !grabber->keepMouseGrab())) {
mouseEvent.setAccepted(false);
- for (int i = 0x1; i <= 0x10; i <<= 1) {
+ for (int i = Qt::LeftButton; i <= Qt::MiddleButton; i <<= 1) {
if (event->buttons() & i) {
Qt::MouseButton button = Qt::MouseButton(i);
mouseEvent.setButtonDownPos(button, mapFromScene(event->buttonDownPos(button)));
QGraphicsSceneMouseEvent *mouseEvent = static_cast<QGraphicsSceneMouseEvent *>(event);
mouseEvent->setPos(item->mapFromItem(q, mouseEvent->pos()));
mouseEvent->setLastPos(item->mapFromItem(q, mouseEvent->pos()));
- for (int i = 0x1; i <= 0x10; i <<= 1) {
+ for (int i = Qt::LeftButton; i <= Qt::MiddleButton; i <<= 1) {
if (mouseEvent->buttons() & i) {
Qt::MouseButton button = Qt::MouseButton(i);
mouseEvent->setButtonDownPos(button, item->mapFromItem(q, mouseEvent->buttonDownPos(button)));
*/
void QGraphicsScenePrivate::storeMouseButtonsForMouseGrabber(QGraphicsSceneMouseEvent *event)
{
- for (int i = 0x1; i <= 0x10; i <<= 1) {
+ for (int i = Qt::LeftButton; i <= Qt::MiddleButton; i <<= 1) {
if (event->buttons() & i) {
mouseGrabberButtonDownPos.insert(Qt::MouseButton(i),
mouseGrabberItems.last()->d_ptr->genericMapFromScene(event->scenePos(),
if (item->isBlockedByModalPanel())
return;
- for (int i = 0x1; i <= 0x10; i <<= 1) {
+ for (int i = Qt::LeftButton; i <= Qt::MiddleButton; i <<= 1) {
Qt::MouseButton button = Qt::MouseButton(i);
mouseEvent->setButtonDownPos(button, mouseGrabberButtonDownPos.value(button, item->d_ptr->genericMapFromScene(mouseEvent->scenePos(), mouseEvent->widget())));
mouseEvent->setButtonDownScenePos(button, mouseGrabberButtonDownScenePos.value(button, mouseEvent->scenePos()));