mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
replace hardcoded Qt::MouseButton values with enums
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
2de3cc02e2
commit
0cedb69854
5 changed files with 7 additions and 7 deletions
|
@ -1007,7 +1007,7 @@ void QDeclarativeFlickablePrivate::captureDelayedPress(QGraphicsSceneMouseEvent
|
|||
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));
|
||||
|
@ -1490,7 +1490,7 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event)
|
|||
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)));
|
||||
|
|
|
@ -670,7 +670,7 @@ bool QDeclarativeMouseArea::sendMouseEvent(QGraphicsSceneMouseEvent *event)
|
|||
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)));
|
||||
|
|
|
@ -1227,7 +1227,7 @@ bool QDeclarativePathView::sendMouseEvent(QGraphicsSceneMouseEvent *event)
|
|||
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)));
|
||||
|
|
|
@ -893,7 +893,7 @@ void QGraphicsItemPrivate::remapItemPos(QEvent *event, QGraphicsItem *item)
|
|||
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)));
|
||||
|
|
|
@ -1027,7 +1027,7 @@ QList<QGraphicsItem *> QGraphicsScenePrivate::itemsAtPosition(const QPoint &scre
|
|||
*/
|
||||
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(),
|
||||
|
@ -1190,7 +1190,7 @@ void QGraphicsScenePrivate::sendMouseEvent(QGraphicsSceneMouseEvent *mouseEvent)
|
|||
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()));
|
||||
|
|
Loading…
Add table
Reference in a new issue