| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickmousearea.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | static bool qmlVisualTouchDebugging() { static enum { Yes, No, Unknown } status = Unknown; if (status == Unknown
 
 
 
 never executed:   }status = Yes;never executed:   }end of blockexecuted 46 times by 23 tests:   returnend of blockExecuted by: 
 executed 2012 times by 23 tests:   status == Yes;return status == Yes;Executed by: 
 executed 2012 times by 23 tests:   }return status == Yes;Executed by: 
  | 0-2012 | ||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | extern const QLoggingCategory &DBG_HOVER_TRACE(); | - | ||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | QQuickMouseAreaPrivate::QQuickMouseAreaPrivate() | - | ||||||||||||||||||||||||
| 14 | : enabled(true), scrollGestureEnabled(true), hovered(false), longPress(false), | - | ||||||||||||||||||||||||
| 15 | moved(false), stealMouse(false), doubleClick(false), preventStealing(false), | - | ||||||||||||||||||||||||
| 16 | propagateComposedEvents(false), overThreshold(false), pressed(nullptr), | - | ||||||||||||||||||||||||
| 17 | pressAndHoldInterval(-1) | - | ||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||
| 19 | , drag(nullptr) | - | ||||||||||||||||||||||||
| 20 | - | |||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||
| 22 | , cursor(nullptr) | - | ||||||||||||||||||||||||
| 23 | - | |||||||||||||||||||||||||
| 24 | { | - | ||||||||||||||||||||||||
| 25 | } executed 2012 times by 23 tests:  end of blockExecuted by: 
  | 2012 | ||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||
| 27 | QQuickMouseAreaPrivate::~QQuickMouseAreaPrivate() | - | ||||||||||||||||||||||||
| 28 | { | - | ||||||||||||||||||||||||
| 29 | - | |||||||||||||||||||||||||
| 30 | delete drag; | - | ||||||||||||||||||||||||
| 31 | - | |||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||
| 33 | delete cursor; | - | ||||||||||||||||||||||||
| 34 | - | |||||||||||||||||||||||||
| 35 | } executed 1970 times by 21 tests:  end of blockExecuted by: 
  | 1970 | ||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | void QQuickMouseAreaPrivate::init() | - | ||||||||||||||||||||||||
| 38 | { | - | ||||||||||||||||||||||||
| 39 | QQuickMouseArea * const q = q_func(); | - | ||||||||||||||||||||||||
| 40 | q->setAcceptedMouseButtons(Qt::LeftButton); | - | ||||||||||||||||||||||||
| 41 | q->setAcceptTouchEvents(false); | - | ||||||||||||||||||||||||
| 42 | q->setFiltersChildMouseEvents(true); | - | ||||||||||||||||||||||||
| 43 |     if (qmlVisualTouchDebugging()
  | 0-2012 | ||||||||||||||||||||||||
| 44 | q->setFlag(QQuickItem::ItemHasContents); | - | ||||||||||||||||||||||||
| 45 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 46 | } executed 2012 times by 23 tests:  end of blockExecuted by: 
  | 2012 | ||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||
| 48 | void QQuickMouseAreaPrivate::saveEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
| 49 | { | - | ||||||||||||||||||||||||
| 50 | lastPos = event->localPos(); | - | ||||||||||||||||||||||||
| 51 | lastScenePos = event->windowPos(); | - | ||||||||||||||||||||||||
| 52 | lastButton = event->button(); | - | ||||||||||||||||||||||||
| 53 | lastButtons = event->buttons(); | - | ||||||||||||||||||||||||
| 54 | lastModifiers = event->modifiers(); | - | ||||||||||||||||||||||||
| 55 | lastFlags = event->flags(); | - | ||||||||||||||||||||||||
| 56 | } executed 953 times by 6 tests:  end of blockExecuted by: 
  | 953 | ||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||
| 58 | bool QQuickMouseAreaPrivate::isPressAndHoldConnected() | - | ||||||||||||||||||||||||
| 59 | { | - | ||||||||||||||||||||||||
| 60 | QQuickMouseArea * const q = q_func(); | - | ||||||||||||||||||||||||
| 61 |     do { QObject *sender = (q); void (QQuickMouseArea::*signal)(QQuickMouseEvent *) = &QQuickMouseArea::pressAndHold; static QMetaMethod method = QMetaMethod::fromSignal(signal); static int signalIdx = QMetaObjectPrivate::signalIndex(method); return executed 26 times by 1 test:   QObjectPrivate::get(sender)->isSignalConnected(signalIdx);return QObjectPrivate::get(sender)->isSignalConnected(signalIdx);Executed by: 
 executed 26 times by 1 test:   } while (0);return QObjectPrivate::get(sender)->isSignalConnected(signalIdx);Executed by: 
  | 26 | ||||||||||||||||||||||||
| 62 | } | - | ||||||||||||||||||||||||
| 63 | - | |||||||||||||||||||||||||
| 64 | bool QQuickMouseAreaPrivate::isDoubleClickConnected() | - | ||||||||||||||||||||||||
| 65 | { | - | ||||||||||||||||||||||||
| 66 | QQuickMouseArea * const q = q_func(); | - | ||||||||||||||||||||||||
| 67 |     do { QObject *sender = (q); void (QQuickMouseArea::*signal)(QQuickMouseEvent *) = &QQuickMouseArea::doubleClicked; static QMetaMethod method = QMetaMethod::fromSignal(signal); static int signalIdx = QMetaObjectPrivate::signalIndex(method); return executed 80 times by 2 tests:   QObjectPrivate::get(sender)->isSignalConnected(signalIdx);return QObjectPrivate::get(sender)->isSignalConnected(signalIdx);Executed by: 
 executed 80 times by 2 tests:   } while (0);return QObjectPrivate::get(sender)->isSignalConnected(signalIdx);Executed by: 
  | 80 | ||||||||||||||||||||||||
| 68 | } | - | ||||||||||||||||||||||||
| 69 | - | |||||||||||||||||||||||||
| 70 | bool QQuickMouseAreaPrivate::isClickConnected() | - | ||||||||||||||||||||||||
| 71 | { | - | ||||||||||||||||||||||||
| 72 | QQuickMouseArea * const q = q_func(); | - | ||||||||||||||||||||||||
| 73 |     do { QObject *sender = (q); void (QQuickMouseArea::*signal)(QQuickMouseEvent *) = &QQuickMouseArea::clicked; static QMetaMethod method = QMetaMethod::fromSignal(signal); static int signalIdx = QMetaObjectPrivate::signalIndex(method); return executed 138 times by 4 tests:   QObjectPrivate::get(sender)->isSignalConnected(signalIdx);return QObjectPrivate::get(sender)->isSignalConnected(signalIdx);Executed by: 
 executed 138 times by 4 tests:   } while (0);return QObjectPrivate::get(sender)->isSignalConnected(signalIdx);Executed by: 
  | 138 | ||||||||||||||||||||||||
| 74 | } | - | ||||||||||||||||||||||||
| 75 | - | |||||||||||||||||||||||||
| 76 | bool QQuickMouseAreaPrivate::isWheelConnected() | - | ||||||||||||||||||||||||
| 77 | { | - | ||||||||||||||||||||||||
| 78 | QQuickMouseArea * const q = q_func(); | - | ||||||||||||||||||||||||
| 79 |     do { QObject *sender = (q); void (QQuickMouseArea::*signal)(QQuickWheelEvent *) = &QQuickMouseArea::wheel; static QMetaMethod method = QMetaMethod::fromSignal(signal); static int signalIdx = QMetaObjectPrivate::signalIndex(method); return executed 2 times by 1 test:   QObjectPrivate::get(sender)->isSignalConnected(signalIdx);return QObjectPrivate::get(sender)->isSignalConnected(signalIdx);Executed by: 
 executed 2 times by 1 test:   } while (0);return QObjectPrivate::get(sender)->isSignalConnected(signalIdx);Executed by: 
  | 2 | ||||||||||||||||||||||||
| 80 | } | - | ||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||
| 82 | void QQuickMouseAreaPrivate::propagate(QQuickMouseEvent* event, PropagateType t) | - | ||||||||||||||||||||||||
| 83 | { | - | ||||||||||||||||||||||||
| 84 | QQuickMouseArea * const q = q_func(); | - | ||||||||||||||||||||||||
| 85 |     if (!window
 
  | 2-106 | ||||||||||||||||||||||||
| 86 |         return; executed 88 times by 3 tests:  return;Executed by: 
  | 88 | ||||||||||||||||||||||||
| 87 | QPointF scenePos = q->mapToScene(QPointF(event->x(), event->y())); | - | ||||||||||||||||||||||||
| 88 | propagateHelper(event, window->contentItem(), scenePos, t); | - | ||||||||||||||||||||||||
| 89 | } executed 20 times by 1 test:  end of blockExecuted by: 
  | 20 | ||||||||||||||||||||||||
| 90 | - | |||||||||||||||||||||||||
| 91 | bool QQuickMouseAreaPrivate::propagateHelper(QQuickMouseEvent *ev, QQuickItem *item,const QPointF &sp, PropagateType sig) | - | ||||||||||||||||||||||||
| 92 | { | - | ||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||
| 95 | const QQuickMouseArea * const q = q_func(); | - | ||||||||||||||||||||||||
| 96 | QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); | - | ||||||||||||||||||||||||
| 97 | - | |||||||||||||||||||||||||
| 98 |     if (itemPrivate->flags & QQuickItem::ItemClipsChildrenToShape
  | 0-92 | ||||||||||||||||||||||||
| 99 | QPointF p = item->mapFromScene(sp); | - | ||||||||||||||||||||||||
| 100 |         if (!item->contains(p)
  | 0 | ||||||||||||||||||||||||
| 101 |             return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 102 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 103 | - | |||||||||||||||||||||||||
| 104 | QList<QQuickItem *> children = itemPrivate->paintOrderChildItems(); | - | ||||||||||||||||||||||||
| 105 |     for (int ii = children.count() - 1; ii >= 0
  | 52-72 | ||||||||||||||||||||||||
| 106 | QQuickItem *child = children.at(ii); | - | ||||||||||||||||||||||||
| 107 |         if (!child->isVisible()
 
  | 0-72 | ||||||||||||||||||||||||
| 108 |             continue; never executed:  continue; | 0 | ||||||||||||||||||||||||
| 109 |         if (propagateHelper(ev, child, sp, sig)
  | 32-40 | ||||||||||||||||||||||||
| 110 |             return executed 40 times by 1 test:   true;return true;Executed by: 
 executed 40 times by 1 test:  return true;Executed by: 
  | 40 | ||||||||||||||||||||||||
| 111 |     } executed 32 times by 1 test:  end of blockExecuted by: 
  | 32 | ||||||||||||||||||||||||
| 112 | - | |||||||||||||||||||||||||
| 113 | QQuickMouseArea* ma = qobject_cast<QQuickMouseArea*>(item); | - | ||||||||||||||||||||||||
| 114 |     if (ma
 
 
  | 2-40 | ||||||||||||||||||||||||
| 115 | switch (sig) { | - | ||||||||||||||||||||||||
| 116 |         case executed 10 times by 1 test:   Click:case Click:Executed by: 
 executed 10 times by 1 test:  case Click:Executed by: 
  | 10 | ||||||||||||||||||||||||
| 117 |             if (!ma->d_func()->isClickConnected()
  | 0-10 | ||||||||||||||||||||||||
| 118 |                 return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 119 |             break; executed 10 times by 1 test:  break;Executed by: 
  | 10 | ||||||||||||||||||||||||
| 120 |         case executed 4 times by 1 test:   DoubleClick:case DoubleClick:Executed by: 
 executed 4 times by 1 test:  case DoubleClick:Executed by: 
  | 4 | ||||||||||||||||||||||||
| 121 |             if (!ma->d_func()->isDoubleClickConnected()
  | 0-4 | ||||||||||||||||||||||||
| 122 |                 return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 123 |             break; executed 4 times by 1 test:  break;Executed by: 
  | 4 | ||||||||||||||||||||||||
| 124 |         case executed 4 times by 1 test:   PressAndHold:case PressAndHold:Executed by: 
 executed 4 times by 1 test:  case PressAndHold:Executed by: 
  | 4 | ||||||||||||||||||||||||
| 125 |             if (!ma->d_func()->isPressAndHoldConnected()
  | 0-4 | ||||||||||||||||||||||||
| 126 |                 return never executed:   false;return false;never executed:  return false; | 0 | ||||||||||||||||||||||||
| 127 |             break; executed 4 times by 1 test:  break;Executed by: 
  | 4 | ||||||||||||||||||||||||
| 128 | } | - | ||||||||||||||||||||||||
| 129 | QPointF p = item->mapFromScene(sp); | - | ||||||||||||||||||||||||
| 130 |         if (item->contains(p)
  | 0-18 | ||||||||||||||||||||||||
| 131 | ev->setX(p.x()); | - | ||||||||||||||||||||||||
| 132 | ev->setY(p.y()); | - | ||||||||||||||||||||||||
| 133 | ev->setAccepted(true); | - | ||||||||||||||||||||||||
| 134 | switch (sig) { | - | ||||||||||||||||||||||||
| 135 |             case executed 10 times by 1 test:   Click:case Click:Executed by: 
 executed 10 times by 1 test:   ma->clicked(ev); break;case Click:Executed by: 
 executed 10 times by 1 test:  break;Executed by: 
  | 10 | ||||||||||||||||||||||||
| 136 |             case executed 4 times by 1 test:   DoubleClick:case DoubleClick:Executed by: 
 executed 4 times by 1 test:   ma->doubleClicked(ev); break;case DoubleClick:Executed by: 
 executed 4 times by 1 test:  break;Executed by: 
  | 4 | ||||||||||||||||||||||||
| 137 |             case executed 4 times by 1 test:   PressAndHold:case PressAndHold:Executed by: 
 executed 4 times by 1 test:   ma->pressAndHold(ev); break;case PressAndHold:Executed by: 
 executed 4 times by 1 test:  break;Executed by: 
  | 4 | ||||||||||||||||||||||||
| 138 | } | - | ||||||||||||||||||||||||
| 139 |             if (ev->isAccepted()
  | 2-16 | ||||||||||||||||||||||||
| 140 |                 return executed 16 times by 1 test:   true;return true;Executed by: 
 executed 16 times by 1 test:  return true;Executed by: 
  | 16 | ||||||||||||||||||||||||
| 141 |         } executed 2 times by 1 test:  end of blockExecuted by: 
  | 2 | ||||||||||||||||||||||||
| 142 |     } executed 2 times by 1 test:  end of blockExecuted by: 
  | 2 | ||||||||||||||||||||||||
| 143 |     return executed 36 times by 1 test:   false;return false;Executed by: 
 executed 36 times by 1 test:  return false;Executed by: 
  | 36 | ||||||||||||||||||||||||
| 144 | - | |||||||||||||||||||||||||
| 145 | } | - | ||||||||||||||||||||||||
| 146 | QQuickMouseArea::QQuickMouseArea(QQuickItem *parent) | - | ||||||||||||||||||||||||
| 147 | : QQuickItem(*(new QQuickMouseAreaPrivate), parent) | - | ||||||||||||||||||||||||
| 148 | { | - | ||||||||||||||||||||||||
| 149 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 150 | d->init(); | - | ||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||
| 153 | - | |||||||||||||||||||||||||
| 154 | - | |||||||||||||||||||||||||
| 155 | setCursor(Qt::ArrowCursor); | - | ||||||||||||||||||||||||
| 156 | - | |||||||||||||||||||||||||
| 157 | } executed 2012 times by 23 tests:  end of blockExecuted by: 
  | 2012 | ||||||||||||||||||||||||
| 158 | - | |||||||||||||||||||||||||
| 159 | QQuickMouseArea::~QQuickMouseArea() | - | ||||||||||||||||||||||||
| 160 | { | - | ||||||||||||||||||||||||
| 161 | } | - | ||||||||||||||||||||||||
| 162 | qreal QQuickMouseArea::mouseX() const | - | ||||||||||||||||||||||||
| 163 | { | - | ||||||||||||||||||||||||
| 164 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 165 |     return executed 64 times by 3 tests:   d->lastPos.x();return d->lastPos.x();Executed by: 
 executed 64 times by 3 tests:  return d->lastPos.x();Executed by: 
  | 64 | ||||||||||||||||||||||||
| 166 | } | - | ||||||||||||||||||||||||
| 167 | - | |||||||||||||||||||||||||
| 168 | qreal QQuickMouseArea::mouseY() const | - | ||||||||||||||||||||||||
| 169 | { | - | ||||||||||||||||||||||||
| 170 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 171 |     return executed 64 times by 3 tests:   d->lastPos.y();return d->lastPos.y();Executed by: 
 executed 64 times by 3 tests:  return d->lastPos.y();Executed by: 
  | 64 | ||||||||||||||||||||||||
| 172 | } | - | ||||||||||||||||||||||||
| 173 | bool QQuickMouseArea::isEnabled() const | - | ||||||||||||||||||||||||
| 174 | { | - | ||||||||||||||||||||||||
| 175 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 176 |     return executed 48 times by 2 tests:   d->enabled;return d->enabled;Executed by: 
 executed 48 times by 2 tests:  return d->enabled;Executed by: 
  | 48 | ||||||||||||||||||||||||
| 177 | } | - | ||||||||||||||||||||||||
| 178 | - | |||||||||||||||||||||||||
| 179 | void QQuickMouseArea::setEnabled(bool a) | - | ||||||||||||||||||||||||
| 180 | { | - | ||||||||||||||||||||||||
| 181 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 182 |     if (a != d->enabled
  | 10-112 | ||||||||||||||||||||||||
| 183 | d->enabled = a; | - | ||||||||||||||||||||||||
| 184 | enabledChanged(); | - | ||||||||||||||||||||||||
| 185 |     } executed 112 times by 3 tests:  end of blockExecuted by: 
  | 112 | ||||||||||||||||||||||||
| 186 | } executed 122 times by 3 tests:  end of blockExecuted by: 
  | 122 | ||||||||||||||||||||||||
| 187 | bool QQuickMouseArea::isScrollGestureEnabled() const | - | ||||||||||||||||||||||||
| 188 | { | - | ||||||||||||||||||||||||
| 189 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 190 |     return executed 26 times by 2 tests:   d->scrollGestureEnabled;return d->scrollGestureEnabled;Executed by: 
 executed 26 times by 2 tests:  return d->scrollGestureEnabled;Executed by: 
  | 26 | ||||||||||||||||||||||||
| 191 | } | - | ||||||||||||||||||||||||
| 192 | - | |||||||||||||||||||||||||
| 193 | void QQuickMouseArea::setScrollGestureEnabled(bool e) | - | ||||||||||||||||||||||||
| 194 | { | - | ||||||||||||||||||||||||
| 195 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 196 |     if (e != d->scrollGestureEnabled
  | 0 | ||||||||||||||||||||||||
| 197 | d->scrollGestureEnabled = e; | - | ||||||||||||||||||||||||
| 198 | scrollGestureEnabledChanged(); | - | ||||||||||||||||||||||||
| 199 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 200 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 201 | bool QQuickMouseArea::preventStealing() const | - | ||||||||||||||||||||||||
| 202 | { | - | ||||||||||||||||||||||||
| 203 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 204 |     return executed 24 times by 1 test:   d->preventStealing;return d->preventStealing;Executed by: 
 executed 24 times by 1 test:  return d->preventStealing;Executed by: 
  | 24 | ||||||||||||||||||||||||
| 205 | } | - | ||||||||||||||||||||||||
| 206 | - | |||||||||||||||||||||||||
| 207 | void QQuickMouseArea::setPreventStealing(bool prevent) | - | ||||||||||||||||||||||||
| 208 | { | - | ||||||||||||||||||||||||
| 209 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 210 |     if (prevent != d->preventStealing
  | 2-6 | ||||||||||||||||||||||||
| 211 | d->preventStealing = prevent; | - | ||||||||||||||||||||||||
| 212 | setKeepMouseGrab(d->preventStealing && d->enabled); | - | ||||||||||||||||||||||||
| 213 | preventStealingChanged(); | - | ||||||||||||||||||||||||
| 214 |     } executed 6 times by 1 test:  end of blockExecuted by: 
  | 6 | ||||||||||||||||||||||||
| 215 | } executed 8 times by 1 test:  end of blockExecuted by: 
  | 8 | ||||||||||||||||||||||||
| 216 | bool QQuickMouseArea::propagateComposedEvents() const | - | ||||||||||||||||||||||||
| 217 | { | - | ||||||||||||||||||||||||
| 218 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 219 |     return executed 24 times by 1 test:   d->propagateComposedEvents;return d->propagateComposedEvents;Executed by: 
 executed 24 times by 1 test:  return d->propagateComposedEvents;Executed by: 
  | 24 | ||||||||||||||||||||||||
| 220 | } | - | ||||||||||||||||||||||||
| 221 | - | |||||||||||||||||||||||||
| 222 | void QQuickMouseArea::setPropagateComposedEvents(bool prevent) | - | ||||||||||||||||||||||||
| 223 | { | - | ||||||||||||||||||||||||
| 224 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 225 |     if (prevent != d->propagateComposedEvents
  | 0-60 | ||||||||||||||||||||||||
| 226 | d->propagateComposedEvents = prevent; | - | ||||||||||||||||||||||||
| 227 | setKeepMouseGrab(d->propagateComposedEvents && d->enabled); | - | ||||||||||||||||||||||||
| 228 | propagateComposedEventsChanged(); | - | ||||||||||||||||||||||||
| 229 |     } executed 60 times by 1 test:  end of blockExecuted by: 
  | 60 | ||||||||||||||||||||||||
| 230 | } executed 60 times by 1 test:  end of blockExecuted by: 
  | 60 | ||||||||||||||||||||||||
| 231 | Qt::MouseButtons QQuickMouseArea::pressedButtons() const | - | ||||||||||||||||||||||||
| 232 | { | - | ||||||||||||||||||||||||
| 233 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 234 |     return executed 60 times by 3 tests:   d->pressed;return d->pressed;Executed by: 
 executed 60 times by 3 tests:  return d->pressed;Executed by: 
  | 60 | ||||||||||||||||||||||||
| 235 | } | - | ||||||||||||||||||||||||
| 236 | - | |||||||||||||||||||||||||
| 237 | void QQuickMouseArea::mousePressEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
| 238 | { | - | ||||||||||||||||||||||||
| 239 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 240 | d->moved = false; | - | ||||||||||||||||||||||||
| 241 | d->stealMouse = d->preventStealing; | - | ||||||||||||||||||||||||
| 242 | d->overThreshold = false; | - | ||||||||||||||||||||||||
| 243 |     if (!d->enabled
 
  | 0-292 | ||||||||||||||||||||||||
| 244 | QQuickItem::mousePressEvent(event); | - | ||||||||||||||||||||||||
| 245 |     } executed 98 times by 2 tests:   else {end of blockExecuted by: 
  | 98 | ||||||||||||||||||||||||
| 246 | d->longPress = false; | - | ||||||||||||||||||||||||
| 247 | d->saveEvent(event); | - | ||||||||||||||||||||||||
| 248 | - | |||||||||||||||||||||||||
| 249 |         if (d->drag
  | 80-212 | ||||||||||||||||||||||||
| 250 |             d->drag->setActive(false); executed 80 times by 4 tests:  d->drag->setActive(false);Executed by: 
  | 80 | ||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||
| 252 | setHovered(true); | - | ||||||||||||||||||||||||
| 253 | d->startScene = event->windowPos(); | - | ||||||||||||||||||||||||
| 254 | setKeepMouseGrab(d->stealMouse); | - | ||||||||||||||||||||||||
| 255 | event->setAccepted(setPressed(event->button(), true, event->source())); | - | ||||||||||||||||||||||||
| 256 |         if (event->isAccepted()
  | 16-276 | ||||||||||||||||||||||||
| 257 |             d->pressAndHoldTimer.start(pressAndHoldInterval(), this); executed 276 times by 6 tests:  d->pressAndHoldTimer.start(pressAndHoldInterval(), this);Executed by: 
  | 276 | ||||||||||||||||||||||||
| 258 |     } executed 292 times by 6 tests:  end of blockExecuted by: 
  | 292 | ||||||||||||||||||||||||
| 259 | } | - | ||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||
| 261 | void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
| 262 | { | - | ||||||||||||||||||||||||
| 263 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 264 |     if (!d->enabled
 
  | 0-397 | ||||||||||||||||||||||||
| 265 | QQuickItem::mouseMoveEvent(event); | - | ||||||||||||||||||||||||
| 266 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||
| 267 | } | - | ||||||||||||||||||||||||
| 268 | - | |||||||||||||||||||||||||
| 269 | d->saveEvent(event); | - | ||||||||||||||||||||||||
| 270 | - | |||||||||||||||||||||||||
| 271 | - | |||||||||||||||||||||||||
| 272 | - | |||||||||||||||||||||||||
| 273 | setHovered(contains(d->lastPos)); | - | ||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||
| 276 |     if (d->drag
 
  | 0-338 | ||||||||||||||||||||||||
| 277 |         if (!d->moved
  | 82-256 | ||||||||||||||||||||||||
| 278 |             d->targetStartPos = d->drag->target()->parentItem()
  | 0-82 | ||||||||||||||||||||||||
| 279 | ? d->drag->target()->parentItem()->mapToScene(d->drag->target()->position()) | - | ||||||||||||||||||||||||
| 280 | : d->drag->target()->position(); | - | ||||||||||||||||||||||||
| 281 |         } executed 82 times by 4 tests:  end of blockExecuted by: 
  | 82 | ||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||
| 283 | QPointF startLocalPos; | - | ||||||||||||||||||||||||
| 284 | QPointF curLocalPos; | - | ||||||||||||||||||||||||
| 285 |         if (drag()->target()->parentItem()
  | 0-338 | ||||||||||||||||||||||||
| 286 | startLocalPos = drag()->target()->parentItem()->mapFromScene(d->startScene); | - | ||||||||||||||||||||||||
| 287 | curLocalPos = drag()->target()->parentItem()->mapFromScene(event->windowPos()); | - | ||||||||||||||||||||||||
| 288 |         } executed 338 times by 4 tests:   else {end of blockExecuted by: 
  | 338 | ||||||||||||||||||||||||
| 289 | startLocalPos = d->startScene; | - | ||||||||||||||||||||||||
| 290 | curLocalPos = event->windowPos(); | - | ||||||||||||||||||||||||
| 291 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||
| 293 |         if (keepMouseGrab()
 
 
 
  | 0-232 | ||||||||||||||||||||||||
| 294 |             d->drag->setActive(true); executed 60 times by 4 tests:  d->drag->setActive(true);Executed by: 
  | 60 | ||||||||||||||||||||||||
| 295 | - | |||||||||||||||||||||||||
| 296 |         QPointF startPos = d->drag->target()->parentItem()
  | 0-338 | ||||||||||||||||||||||||
| 297 | ? d->drag->target()->parentItem()->mapFromScene(d->targetStartPos) | - | ||||||||||||||||||||||||
| 298 | : d->targetStartPos; | - | ||||||||||||||||||||||||
| 299 | - | |||||||||||||||||||||||||
| 300 | bool dragX = drag()->axis() & QQuickDrag::XAxis; | - | ||||||||||||||||||||||||
| 301 | bool dragY = drag()->axis() & QQuickDrag::YAxis; | - | ||||||||||||||||||||||||
| 302 | - | |||||||||||||||||||||||||
| 303 | QPointF dragPos = d->drag->target()->position(); | - | ||||||||||||||||||||||||
| 304 | QPointF boundedDragPos = dragPos; | - | ||||||||||||||||||||||||
| 305 |         if (dragX
  | 14-324 | ||||||||||||||||||||||||
| 306 | dragPos.setX(startPos.x() + curLocalPos.x() - startLocalPos.x()); | - | ||||||||||||||||||||||||
| 307 | boundedDragPos.setX(qBound( | - | ||||||||||||||||||||||||
| 308 | d->drag->xmin(), | - | ||||||||||||||||||||||||
| 309 | dragPos.x(), | - | ||||||||||||||||||||||||
| 310 | d->drag->xmax())); | - | ||||||||||||||||||||||||
| 311 |         } executed 324 times by 4 tests:  end of blockExecuted by: 
  | 324 | ||||||||||||||||||||||||
| 312 |         if (dragY
  | 20-318 | ||||||||||||||||||||||||
| 313 | dragPos.setY(startPos.y() + curLocalPos.y() - startLocalPos.y()); | - | ||||||||||||||||||||||||
| 314 | boundedDragPos.setY(qBound( | - | ||||||||||||||||||||||||
| 315 | d->drag->ymin(), | - | ||||||||||||||||||||||||
| 316 | dragPos.y(), | - | ||||||||||||||||||||||||
| 317 | d->drag->ymax())); | - | ||||||||||||||||||||||||
| 318 |         } executed 318 times by 4 tests:  end of blockExecuted by: 
  | 318 | ||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||
| 320 | QPointF targetPos = d->drag->target()->position(); | - | ||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||
| 322 |         if (d->drag->active()
  | 118-220 | ||||||||||||||||||||||||
| 323 |             d->drag->target()->setPosition(boundedDragPos); executed 220 times by 4 tests:  d->drag->target()->setPosition(boundedDragPos);Executed by: 
  | 220 | ||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||
| 325 | bool dragOverThresholdX = QQuickWindowPrivate::dragOverThreshold(dragPos.x() - startPos.x(), | - | ||||||||||||||||||||||||
| 326 | Qt::XAxis, event, d->drag->threshold()); | - | ||||||||||||||||||||||||
| 327 | bool dragOverThresholdY = QQuickWindowPrivate::dragOverThreshold(dragPos.y() - startPos.y(), | - | ||||||||||||||||||||||||
| 328 | Qt::YAxis, event, d->drag->threshold()); | - | ||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||
| 330 |         if (!d->overThreshold
 
 
 
  | 8-220 | ||||||||||||||||||||||||
| 331 |                                   ((
 
 
  | 20-54 | ||||||||||||||||||||||||
| 332 | { | - | ||||||||||||||||||||||||
| 333 | d->overThreshold = true; | - | ||||||||||||||||||||||||
| 334 |             if (d->drag->smoothed()
  | 2-72 | ||||||||||||||||||||||||
| 335 |                 d->startScene = event->windowPos(); executed 72 times by 4 tests:  d->startScene = event->windowPos();Executed by: 
  | 72 | ||||||||||||||||||||||||
| 336 |         } executed 74 times by 4 tests:  end of blockExecuted by: 
  | 74 | ||||||||||||||||||||||||
| 337 | - | |||||||||||||||||||||||||
| 338 |         if (!keepMouseGrab()
 
  | 36-232 | ||||||||||||||||||||||||
| 339 | setKeepMouseGrab(true); | - | ||||||||||||||||||||||||
| 340 | d->stealMouse = true; | - | ||||||||||||||||||||||||
| 341 |         } executed 70 times by 4 tests:  end of blockExecuted by: 
  | 70 | ||||||||||||||||||||||||
| 342 | - | |||||||||||||||||||||||||
| 343 | d->moved = true; | - | ||||||||||||||||||||||||
| 344 |     } executed 338 times by 4 tests:  end of blockExecuted by: 
  | 338 | ||||||||||||||||||||||||
| 345 | - | |||||||||||||||||||||||||
| 346 | - | |||||||||||||||||||||||||
| 347 | QQuickMouseEvent &me = d->quickMouseEvent; | - | ||||||||||||||||||||||||
| 348 | me.reset(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, false, d->longPress, event->flags()); | - | ||||||||||||||||||||||||
| 349 | me.setSource(event->source()); | - | ||||||||||||||||||||||||
| 350 | mouseXChanged(&me); | - | ||||||||||||||||||||||||
| 351 | me.setPosition(d->lastPos); | - | ||||||||||||||||||||||||
| 352 | mouseYChanged(&me); | - | ||||||||||||||||||||||||
| 353 | me.setPosition(d->lastPos); | - | ||||||||||||||||||||||||
| 354 | positionChanged(&me); | - | ||||||||||||||||||||||||
| 355 | } executed 401 times by 4 tests:  end of blockExecuted by: 
  | 401 | ||||||||||||||||||||||||
| 356 | - | |||||||||||||||||||||||||
| 357 | void QQuickMouseArea::mouseReleaseEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
| 358 | { | - | ||||||||||||||||||||||||
| 359 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 360 | d->stealMouse = false; | - | ||||||||||||||||||||||||
| 361 | d->overThreshold = false; | - | ||||||||||||||||||||||||
| 362 |     if (!d->enabled
 
  | 0-220 | ||||||||||||||||||||||||
| 363 | QQuickItem::mouseReleaseEvent(event); | - | ||||||||||||||||||||||||
| 364 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||
| 365 | d->saveEvent(event); | - | ||||||||||||||||||||||||
| 366 | setPressed(event->button(), false, event->source()); | - | ||||||||||||||||||||||||
| 367 |         if (!d->pressed
  | 2-220 | ||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||
| 369 | - | |||||||||||||||||||||||||
| 370 |             if (d->drag
  | 58-162 | ||||||||||||||||||||||||
| 371 |                 d->drag->setActive(false); executed 58 times by 4 tests:  d->drag->setActive(false);Executed by: 
  | 58 | ||||||||||||||||||||||||
| 372 | - | |||||||||||||||||||||||||
| 373 | - | |||||||||||||||||||||||||
| 374 |             if (!acceptHoverEvents()
  | 12-208 | ||||||||||||||||||||||||
| 375 |                 setHovered(false); executed 208 times by 6 tests:  setHovered(false);Executed by: 
  | 208 | ||||||||||||||||||||||||
| 376 | QQuickWindow *w = window(); | - | ||||||||||||||||||||||||
| 377 |             if (w
 
  | 0-218 | ||||||||||||||||||||||||
| 378 |                 ungrabMouse(); executed 218 times by 6 tests:  ungrabMouse();Executed by: 
  | 218 | ||||||||||||||||||||||||
| 379 | setKeepMouseGrab(false); | - | ||||||||||||||||||||||||
| 380 |         } executed 220 times by 6 tests:  end of blockExecuted by: 
  | 220 | ||||||||||||||||||||||||
| 381 |     } executed 222 times by 6 tests:  end of blockExecuted by: 
  | 222 | ||||||||||||||||||||||||
| 382 | d->doubleClick = false; | - | ||||||||||||||||||||||||
| 383 | } executed 222 times by 6 tests:  end of blockExecuted by: 
  | 222 | ||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||
| 385 | void QQuickMouseArea::mouseDoubleClickEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
| 386 | { | - | ||||||||||||||||||||||||
| 387 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 388 |     if (d->enabled
  | 0-38 | ||||||||||||||||||||||||
| 389 | d->saveEvent(event); | - | ||||||||||||||||||||||||
| 390 | QQuickMouseEvent &me = d->quickMouseEvent; | - | ||||||||||||||||||||||||
| 391 | me.reset(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, true, | - | ||||||||||||||||||||||||
| 392 | false, event->flags()); | - | ||||||||||||||||||||||||
| 393 | me.setSource(event->source()); | - | ||||||||||||||||||||||||
| 394 | me.setAccepted(d->isDoubleClickConnected()); | - | ||||||||||||||||||||||||
| 395 | this->doubleClicked(&me); | - | ||||||||||||||||||||||||
| 396 |         if (!me.isAccepted()
  | 16-22 | ||||||||||||||||||||||||
| 397 |             d->propagate(&me, QQuickMouseAreaPrivate::DoubleClick); executed 22 times by 2 tests:  d->propagate(&me, QQuickMouseAreaPrivate::DoubleClick);Executed by: 
  | 22 | ||||||||||||||||||||||||
| 398 |         d->doubleClick = d->isDoubleClickConnected()
 
  | 2-20 | ||||||||||||||||||||||||
| 399 |     } executed 38 times by 2 tests:  end of blockExecuted by: 
  | 38 | ||||||||||||||||||||||||
| 400 | QQuickItem::mouseDoubleClickEvent(event); | - | ||||||||||||||||||||||||
| 401 | } executed 38 times by 2 tests:  end of blockExecuted by: 
  | 38 | ||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||
| 403 | void QQuickMouseArea::hoverEnterEvent(QHoverEvent *event) | - | ||||||||||||||||||||||||
| 404 | { | - | ||||||||||||||||||||||||
| 405 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 406 |     if (!d->enabled
 
  | 0-24 | ||||||||||||||||||||||||
| 407 | QQuickItem::hoverEnterEvent(event); | - | ||||||||||||||||||||||||
| 408 |     } never executed:   else {end of block | 0 | ||||||||||||||||||||||||
| 409 | d->lastPos = event->posF(); | - | ||||||||||||||||||||||||
| 410 | d->lastModifiers = event->modifiers(); | - | ||||||||||||||||||||||||
| 411 | setHovered(true); | - | ||||||||||||||||||||||||
| 412 | QQuickMouseEvent &me = d->quickMouseEvent; | - | ||||||||||||||||||||||||
| 413 | me.reset(d->lastPos.x(), d->lastPos.y(), Qt::NoButton, Qt::NoButton, d->lastModifiers, false, false); | - | ||||||||||||||||||||||||
| 414 | mouseXChanged(&me); | - | ||||||||||||||||||||||||
| 415 | me.setPosition(d->lastPos); | - | ||||||||||||||||||||||||
| 416 | mouseYChanged(&me); | - | ||||||||||||||||||||||||
| 417 | me.setPosition(d->lastPos); | - | ||||||||||||||||||||||||
| 418 |     } executed 24 times by 3 tests:  end of blockExecuted by: 
  | 24 | ||||||||||||||||||||||||
| 419 | } | - | ||||||||||||||||||||||||
| 420 | - | |||||||||||||||||||||||||
| 421 | void QQuickMouseArea::hoverMoveEvent(QHoverEvent *event) | - | ||||||||||||||||||||||||
| 422 | { | - | ||||||||||||||||||||||||
| 423 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 424 |     if (!d->enabled
 
  | 0-12 | ||||||||||||||||||||||||
| 425 | QQuickItem::hoverMoveEvent(event); | - | ||||||||||||||||||||||||
| 426 |     } never executed:   else if (d->lastPos != event->posF()end of block
  | 0-10 | ||||||||||||||||||||||||
| 427 | d->lastPos = event->posF(); | - | ||||||||||||||||||||||||
| 428 | d->lastModifiers = event->modifiers(); | - | ||||||||||||||||||||||||
| 429 | QQuickMouseEvent &me = d->quickMouseEvent; | - | ||||||||||||||||||||||||
| 430 | me.reset(d->lastPos.x(), d->lastPos.y(), Qt::NoButton, Qt::NoButton, d->lastModifiers, false, false); | - | ||||||||||||||||||||||||
| 431 | mouseXChanged(&me); | - | ||||||||||||||||||||||||
| 432 | me.setPosition(d->lastPos); | - | ||||||||||||||||||||||||
| 433 | mouseYChanged(&me); | - | ||||||||||||||||||||||||
| 434 | me.setPosition(d->lastPos); | - | ||||||||||||||||||||||||
| 435 | positionChanged(&me); | - | ||||||||||||||||||||||||
| 436 |     } executed 10 times by 2 tests:  end of blockExecuted by: 
  | 10 | ||||||||||||||||||||||||
| 437 | } executed 12 times by 3 tests:  end of blockExecuted by: 
  | 12 | ||||||||||||||||||||||||
| 438 | - | |||||||||||||||||||||||||
| 439 | void QQuickMouseArea::hoverLeaveEvent(QHoverEvent *event) | - | ||||||||||||||||||||||||
| 440 | { | - | ||||||||||||||||||||||||
| 441 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 442 |     if (!d->enabled
 
  | 0-10 | ||||||||||||||||||||||||
| 443 |         QQuickItem::hoverLeaveEvent(event); never executed:  QQuickItem::hoverLeaveEvent(event); | 0 | ||||||||||||||||||||||||
| 444 | else | - | ||||||||||||||||||||||||
| 445 |         setHovered(false); executed 10 times by 2 tests:  setHovered(false);Executed by: 
  | 10 | ||||||||||||||||||||||||
| 446 | } | - | ||||||||||||||||||||||||
| 447 | - | |||||||||||||||||||||||||
| 448 | - | |||||||||||||||||||||||||
| 449 | void QQuickMouseArea::wheelEvent(QWheelEvent *event) | - | ||||||||||||||||||||||||
| 450 | { | - | ||||||||||||||||||||||||
| 451 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 452 |     if (!d->enabled
 
 
  | 0-2 | ||||||||||||||||||||||||
| 453 | QQuickItem::wheelEvent(event); | - | ||||||||||||||||||||||||
| 454 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||
| 455 | } | - | ||||||||||||||||||||||||
| 456 | - | |||||||||||||||||||||||||
| 457 | QQuickWheelEvent &we = d->quickWheelEvent; | - | ||||||||||||||||||||||||
| 458 | we.reset(event->posF().x(), event->posF().y(), event->angleDelta(), event->pixelDelta(), | - | ||||||||||||||||||||||||
| 459 | event->buttons(), event->modifiers(), event->inverted()); | - | ||||||||||||||||||||||||
| 460 | we.setAccepted(d->isWheelConnected()); | - | ||||||||||||||||||||||||
| 461 | wheel(&we); | - | ||||||||||||||||||||||||
| 462 |     if (!we.isAccepted()
  | 0-2 | ||||||||||||||||||||||||
| 463 |         QQuickItem::wheelEvent(event); never executed:  QQuickItem::wheelEvent(event); | 0 | ||||||||||||||||||||||||
| 464 | } executed 2 times by 1 test:  end of blockExecuted by: 
  | 2 | ||||||||||||||||||||||||
| 465 | - | |||||||||||||||||||||||||
| 466 | - | |||||||||||||||||||||||||
| 467 | void QQuickMouseArea::ungrabMouse() | - | ||||||||||||||||||||||||
| 468 | { | - | ||||||||||||||||||||||||
| 469 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 470 |     if (d->pressed
  | 40-426 | ||||||||||||||||||||||||
| 471 | - | |||||||||||||||||||||||||
| 472 | - | |||||||||||||||||||||||||
| 473 | d->pressed = Qt::NoButton; | - | ||||||||||||||||||||||||
| 474 | d->stealMouse = false; | - | ||||||||||||||||||||||||
| 475 | d->doubleClick = false; | - | ||||||||||||||||||||||||
| 476 | d->overThreshold = false; | - | ||||||||||||||||||||||||
| 477 | setKeepMouseGrab(false); | - | ||||||||||||||||||||||||
| 478 | - | |||||||||||||||||||||||||
| 479 | - | |||||||||||||||||||||||||
| 480 |         if (d->drag
  | 10-30 | ||||||||||||||||||||||||
| 481 |             d->drag->setActive(false); executed 10 times by 1 test:  d->drag->setActive(false);Executed by: 
  | 10 | ||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||
| 483 | - | |||||||||||||||||||||||||
| 484 | canceled(); | - | ||||||||||||||||||||||||
| 485 | pressedChanged(); | - | ||||||||||||||||||||||||
| 486 | containsPressChanged(); | - | ||||||||||||||||||||||||
| 487 | pressedButtonsChanged(); | - | ||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||
| 489 |         if (d->hovered
 
  | 0-38 | ||||||||||||||||||||||||
| 490 | d->hovered = false; | - | ||||||||||||||||||||||||
| 491 | hoveredChanged(); | - | ||||||||||||||||||||||||
| 492 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 493 |     } executed 40 times by 4 tests:  end of blockExecuted by: 
  | 40 | ||||||||||||||||||||||||
| 494 | } executed 466 times by 6 tests:  end of blockExecuted by: 
  | 466 | ||||||||||||||||||||||||
| 495 | - | |||||||||||||||||||||||||
| 496 | void QQuickMouseArea::mouseUngrabEvent() | - | ||||||||||||||||||||||||
| 497 | { | - | ||||||||||||||||||||||||
| 498 | ungrabMouse(); | - | ||||||||||||||||||||||||
| 499 | } executed 248 times by 6 tests:  end of blockExecuted by: 
  | 248 | ||||||||||||||||||||||||
| 500 | - | |||||||||||||||||||||||||
| 501 | bool QQuickMouseArea::sendMouseEvent(QMouseEvent *event) | - | ||||||||||||||||||||||||
| 502 | { | - | ||||||||||||||||||||||||
| 503 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 504 | QPointF localPos = mapFromScene(event->windowPos()); | - | ||||||||||||||||||||||||
| 505 | - | |||||||||||||||||||||||||
| 506 | QQuickWindow *c = window(); | - | ||||||||||||||||||||||||
| 507 |     QQuickItem *grabber = c
  | 0-86 | ||||||||||||||||||||||||
| 508 | bool stealThisEvent = d->stealMouse; | - | ||||||||||||||||||||||||
| 509 |     if ((stealThisEvent
 
 
 
  | 0-62 | ||||||||||||||||||||||||
| 510 | QMouseEvent mouseEvent(event->type(), localPos, event->windowPos(), event->screenPos(), | - | ||||||||||||||||||||||||
| 511 | event->button(), event->buttons(), event->modifiers()); | - | ||||||||||||||||||||||||
| 512 | mouseEvent.setAccepted(false); | - | ||||||||||||||||||||||||
| 513 | - | |||||||||||||||||||||||||
| 514 | switch (event->type()) { | - | ||||||||||||||||||||||||
| 515 |         case executed 38 times by 1 test:   QEvent::MouseMove:case QEvent::MouseMove:Executed by: 
 executed 38 times by 1 test:  case QEvent::MouseMove:Executed by: 
  | 38 | ||||||||||||||||||||||||
| 516 | mouseMoveEvent(&mouseEvent); | - | ||||||||||||||||||||||||
| 517 |             break; executed 38 times by 1 test:  break;Executed by: 
  | 38 | ||||||||||||||||||||||||
| 518 |         case executed 24 times by 1 test:   QEvent::MouseButtonPress:case QEvent::MouseButtonPress:Executed by: 
 executed 24 times by 1 test:  case QEvent::MouseButtonPress:Executed by: 
  | 24 | ||||||||||||||||||||||||
| 519 | mousePressEvent(&mouseEvent); | - | ||||||||||||||||||||||||
| 520 |             break; executed 24 times by 1 test:  break;Executed by: 
  | 24 | ||||||||||||||||||||||||
| 521 |         case never executed:   QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease:never executed:  case QEvent::MouseButtonRelease: | 0 | ||||||||||||||||||||||||
| 522 | mouseReleaseEvent(&mouseEvent); | - | ||||||||||||||||||||||||
| 523 | stealThisEvent = d->stealMouse; | - | ||||||||||||||||||||||||
| 524 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||
| 525 |         default never executed:  :default:never executed:  default: | 0 | ||||||||||||||||||||||||
| 526 |             break; never executed:  break; | 0 | ||||||||||||||||||||||||
| 527 | } | - | ||||||||||||||||||||||||
| 528 |         grabber = c
  | 0-62 | ||||||||||||||||||||||||
| 529 |         if (grabber
 
 
 
  | 0-38 | ||||||||||||||||||||||||
| 530 |             grabMouse(); executed 10 times by 1 test:  grabMouse();Executed by: 
  | 10 | ||||||||||||||||||||||||
| 531 | - | |||||||||||||||||||||||||
| 532 |         return executed 62 times by 1 test:   stealThisEvent;return stealThisEvent;Executed by: 
 executed 62 times by 1 test:  return stealThisEvent;Executed by: 
  | 62 | ||||||||||||||||||||||||
| 533 | } | - | ||||||||||||||||||||||||
| 534 |     if (event->type() == QEvent::MouseButtonRelease
  | 10-14 | ||||||||||||||||||||||||
| 535 |         if (d->pressed
  | 0-14 | ||||||||||||||||||||||||
| 536 | d->pressed &= ~event->button(); | - | ||||||||||||||||||||||||
| 537 | pressedButtonsChanged(); | - | ||||||||||||||||||||||||
| 538 |             if (!d->pressed
  | 0-14 | ||||||||||||||||||||||||
| 539 | - | |||||||||||||||||||||||||
| 540 | d->stealMouse = false; | - | ||||||||||||||||||||||||
| 541 | d->overThreshold = false; | - | ||||||||||||||||||||||||
| 542 |                 if (c
 
  | 0-14 | ||||||||||||||||||||||||
| 543 |                     ungrabMouse(); never executed:  ungrabMouse(); | 0 | ||||||||||||||||||||||||
| 544 | canceled(); | - | ||||||||||||||||||||||||
| 545 | pressedChanged(); | - | ||||||||||||||||||||||||
| 546 | containsPressChanged(); | - | ||||||||||||||||||||||||
| 547 |                 if (d->hovered
  | 0-14 | ||||||||||||||||||||||||
| 548 | d->hovered = false; | - | ||||||||||||||||||||||||
| 549 | hoveredChanged(); | - | ||||||||||||||||||||||||
| 550 |                 } executed 14 times by 1 test:  end of blockExecuted by: 
  | 14 | ||||||||||||||||||||||||
| 551 |             } executed 14 times by 1 test:  end of blockExecuted by: 
  | 14 | ||||||||||||||||||||||||
| 552 |         } executed 14 times by 1 test:  end of blockExecuted by: 
  | 14 | ||||||||||||||||||||||||
| 553 |     } executed 14 times by 1 test:  end of blockExecuted by: 
  | 14 | ||||||||||||||||||||||||
| 554 |     return executed 24 times by 1 test:   false;return false;Executed by: 
 executed 24 times by 1 test:  return false;Executed by: 
  | 24 | ||||||||||||||||||||||||
| 555 | } | - | ||||||||||||||||||||||||
| 556 | - | |||||||||||||||||||||||||
| 557 | bool QQuickMouseArea::childMouseEventFilter(QQuickItem *i, QEvent *e) | - | ||||||||||||||||||||||||
| 558 | { | - | ||||||||||||||||||||||||
| 559 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 560 |     if (!d->pressed
  | 80-102 | ||||||||||||||||||||||||
| 561 |             (!d->enabled
 
  | 0-102 | ||||||||||||||||||||||||
| 562 | - | |||||||||||||||||||||||||
| 563 |              || !d->drag
 
  | 4-60 | ||||||||||||||||||||||||
| 564 | - | |||||||||||||||||||||||||
| 565 | ) | - | ||||||||||||||||||||||||
| 566 | ) | - | ||||||||||||||||||||||||
| 567 |         return executed 64 times by 3 tests:   QQuickItem::childMouseEventFilter(i, e);return QQuickItem::childMouseEventFilter(i, e);Executed by: 
 executed 64 times by 3 tests:  return QQuickItem::childMouseEventFilter(i, e);Executed by: 
  | 64 | ||||||||||||||||||||||||
| 568 | switch (e->type()) { | - | ||||||||||||||||||||||||
| 569 |     case executed 24 times by 1 test:   QEvent::MouseButtonPress:case QEvent::MouseButtonPress:Executed by: 
 executed 24 times by 1 test:  case QEvent::MouseButtonPress:Executed by: 
  | 24 | ||||||||||||||||||||||||
| 570 |     case executed 48 times by 1 test:   QEvent::MouseMove:case QEvent::MouseMove:Executed by: 
 executed 48 times by 1 test:  case QEvent::MouseMove:Executed by: 
  | 48 | ||||||||||||||||||||||||
| 571 |     case executed 14 times by 1 test:   QEvent::MouseButtonRelease:case QEvent::MouseButtonRelease:Executed by: 
 executed 14 times by 1 test:  case QEvent::MouseButtonRelease:Executed by: 
  | 14 | ||||||||||||||||||||||||
| 572 |         return executed 86 times by 1 test:   sendMouseEvent(static_cast<QMouseEvent *>(e));return sendMouseEvent(static_cast<QMouseEvent *>(e));Executed by: 
 executed 86 times by 1 test:  return sendMouseEvent(static_cast<QMouseEvent *>(e));Executed by: 
  | 86 | ||||||||||||||||||||||||
| 573 |     default executed 32 times by 1 test:  :default:Executed by: 
 executed 32 times by 1 test:  default:Executed by: 
  | 32 | ||||||||||||||||||||||||
| 574 |         break; executed 32 times by 1 test:  break;Executed by: 
  | 32 | ||||||||||||||||||||||||
| 575 | } | - | ||||||||||||||||||||||||
| 576 | - | |||||||||||||||||||||||||
| 577 |     return executed 32 times by 1 test:   QQuickItem::childMouseEventFilter(i, e);return QQuickItem::childMouseEventFilter(i, e);Executed by: 
 executed 32 times by 1 test:  return QQuickItem::childMouseEventFilter(i, e);Executed by: 
  | 32 | ||||||||||||||||||||||||
| 578 | } | - | ||||||||||||||||||||||||
| 579 | - | |||||||||||||||||||||||||
| 580 | void QQuickMouseArea::timerEvent(QTimerEvent *event) | - | ||||||||||||||||||||||||
| 581 | { | - | ||||||||||||||||||||||||
| 582 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 583 |     if (event->timerId() == d->pressAndHoldTimer.timerId()
  | 0-26 | ||||||||||||||||||||||||
| 584 | d->pressAndHoldTimer.stop(); | - | ||||||||||||||||||||||||
| 585 | - | |||||||||||||||||||||||||
| 586 |         bool dragged = d->drag
 
  | 0-26 | ||||||||||||||||||||||||
| 587 | - | |||||||||||||||||||||||||
| 588 | - | |||||||||||||||||||||||||
| 589 | - | |||||||||||||||||||||||||
| 590 |         if (d->pressed && dragged == false
 
  | 0-22 | ||||||||||||||||||||||||
| 591 | d->longPress = true; | - | ||||||||||||||||||||||||
| 592 | QQuickMouseEvent &me = d->quickMouseEvent; | - | ||||||||||||||||||||||||
| 593 | me.reset(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, false, d->longPress, d->lastFlags); | - | ||||||||||||||||||||||||
| 594 | me.setSource(Qt::MouseEventSynthesizedByQt); | - | ||||||||||||||||||||||||
| 595 | me.setAccepted(d->isPressAndHoldConnected()); | - | ||||||||||||||||||||||||
| 596 | pressAndHold(&me); | - | ||||||||||||||||||||||||
| 597 |             if (!me.isAccepted()
  | 10-12 | ||||||||||||||||||||||||
| 598 |                 d->propagate(&me, QQuickMouseAreaPrivate::PressAndHold); executed 12 times by 1 test:  d->propagate(&me, QQuickMouseAreaPrivate::PressAndHold);Executed by: 
  | 12 | ||||||||||||||||||||||||
| 599 |             if (!me.isAccepted()
  | 8-14 | ||||||||||||||||||||||||
| 600 |                 d->longPress = false; executed 8 times by 1 test:  d->longPress = false;Executed by: 
  | 8 | ||||||||||||||||||||||||
| 601 |         } executed 22 times by 1 test:  end of blockExecuted by: 
  | 22 | ||||||||||||||||||||||||
| 602 |     } executed 26 times by 3 tests:  end of blockExecuted by: 
  | 26 | ||||||||||||||||||||||||
| 603 | } executed 26 times by 3 tests:  end of blockExecuted by: 
  | 26 | ||||||||||||||||||||||||
| 604 | - | |||||||||||||||||||||||||
| 605 | void QQuickMouseArea::windowDeactivateEvent() | - | ||||||||||||||||||||||||
| 606 | { | - | ||||||||||||||||||||||||
| 607 | ungrabMouse(); | - | ||||||||||||||||||||||||
| 608 | QQuickItem::windowDeactivateEvent(); | - | ||||||||||||||||||||||||
| 609 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 610 | - | |||||||||||||||||||||||||
| 611 | void QQuickMouseArea::geometryChanged(const QRectF &newGeometry, | - | ||||||||||||||||||||||||
| 612 | const QRectF &oldGeometry) | - | ||||||||||||||||||||||||
| 613 | { | - | ||||||||||||||||||||||||
| 614 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 615 | QQuickItem::geometryChanged(newGeometry, oldGeometry); | - | ||||||||||||||||||||||||
| 616 | - | |||||||||||||||||||||||||
| 617 |     if (d->lastScenePos.isNull
  | 1226-1992 | ||||||||||||||||||||||||
| 618 |         d->lastScenePos = mapToScene(d->lastPos); executed 1992 times by 19 tests:  d->lastScenePos = mapToScene(d->lastPos);Executed by: 
  | 1992 | ||||||||||||||||||||||||
| 619 |     else if (newGeometry.x() != oldGeometry.x()
 
  | 116-1010 | ||||||||||||||||||||||||
| 620 |         d->lastPos = mapFromScene(d->lastScenePos); executed 332 times by 4 tests:  d->lastPos = mapFromScene(d->lastScenePos);Executed by: 
  | 332 | ||||||||||||||||||||||||
| 621 | } executed 3218 times by 19 tests:  end of blockExecuted by: 
  | 3218 | ||||||||||||||||||||||||
| 622 | - | |||||||||||||||||||||||||
| 623 | void QQuickMouseArea::itemChange(ItemChange change, const ItemChangeData &value) | - | ||||||||||||||||||||||||
| 624 | { | - | ||||||||||||||||||||||||
| 625 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 626 | switch (change) { | - | ||||||||||||||||||||||||
| 627 |     case executed 64 times by 4 tests:   ItemVisibleHasChanged:case ItemVisibleHasChanged:Executed by: 
 executed 64 times by 4 tests:  case ItemVisibleHasChanged:Executed by: 
  | 64 | ||||||||||||||||||||||||
| 628 |         if (acceptHoverEvents()
 
 
 
  | 0-60 | ||||||||||||||||||||||||
| 629 |             if (!d->hovered
  | 0-2 | ||||||||||||||||||||||||
| 630 | QPointF cursorPos = QGuiApplicationPrivate::lastCursorPosition; | - | ||||||||||||||||||||||||
| 631 | d->lastScenePos = d->window->mapFromGlobal(cursorPos.toPoint()); | - | ||||||||||||||||||||||||
| 632 | d->lastPos = mapFromScene(d->lastScenePos); | - | ||||||||||||||||||||||||
| 633 |             } executed 2 times by 1 test:  end of blockExecuted by: 
  | 2 | ||||||||||||||||||||||||
| 634 | setHovered(!d->hovered); | - | ||||||||||||||||||||||||
| 635 |         } executed 2 times by 1 test:  end of blockExecuted by: 
  | 2 | ||||||||||||||||||||||||
| 636 |         break; executed 64 times by 4 tests:  break;Executed by: 
  | 64 | ||||||||||||||||||||||||
| 637 |     default executed 8206 times by 23 tests:  :default:Executed by: 
 executed 8206 times by 23 tests:  default:Executed by: 
  | 8206 | ||||||||||||||||||||||||
| 638 |         break; executed 8206 times by 23 tests:  break;Executed by: 
  | 8206 | ||||||||||||||||||||||||
| 639 | } | - | ||||||||||||||||||||||||
| 640 | - | |||||||||||||||||||||||||
| 641 | QQuickItem::itemChange(change, value); | - | ||||||||||||||||||||||||
| 642 | } executed 8270 times by 23 tests:  end of blockExecuted by: 
  | 8270 | ||||||||||||||||||||||||
| 643 | bool QQuickMouseArea::hoverEnabled() const | - | ||||||||||||||||||||||||
| 644 | { | - | ||||||||||||||||||||||||
| 645 |     return executed 24 times by 1 test:   acceptHoverEvents();return acceptHoverEvents();Executed by: 
 executed 24 times by 1 test:  return acceptHoverEvents();Executed by: 
  | 24 | ||||||||||||||||||||||||
| 646 | } | - | ||||||||||||||||||||||||
| 647 | - | |||||||||||||||||||||||||
| 648 | void QQuickMouseArea::setHoverEnabled(bool h) | - | ||||||||||||||||||||||||
| 649 | { | - | ||||||||||||||||||||||||
| 650 |     if (h == acceptHoverEvents()
  | 2-162 | ||||||||||||||||||||||||
| 651 |         return; executed 2 times by 1 test:  return;Executed by: 
  | 2 | ||||||||||||||||||||||||
| 652 | - | |||||||||||||||||||||||||
| 653 | setAcceptHoverEvents(h); | - | ||||||||||||||||||||||||
| 654 | hoverEnabledChanged(); | - | ||||||||||||||||||||||||
| 655 | } executed 162 times by 5 tests:  end of blockExecuted by: 
  | 162 | ||||||||||||||||||||||||
| 656 | bool QQuickMouseArea::hovered() const | - | ||||||||||||||||||||||||
| 657 | { | - | ||||||||||||||||||||||||
| 658 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 659 |     return executed 224 times by 4 tests:   d->hovered;return d->hovered;Executed by: 
 executed 224 times by 4 tests:  return d->hovered;Executed by: 
  | 224 | ||||||||||||||||||||||||
| 660 | } | - | ||||||||||||||||||||||||
| 661 | - | |||||||||||||||||||||||||
| 662 | - | |||||||||||||||||||||||||
| 663 | - | |||||||||||||||||||||||||
| 664 | - | |||||||||||||||||||||||||
| 665 | - | |||||||||||||||||||||||||
| 666 | bool QQuickMouseArea::pressed() const | - | ||||||||||||||||||||||||
| 667 | { | - | ||||||||||||||||||||||||
| 668 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 669 |     return executed 688 times by 8 tests:   d->pressed;return d->pressed;Executed by: 
 executed 688 times by 8 tests:  return d->pressed;Executed by: 
  | 688 | ||||||||||||||||||||||||
| 670 | } | - | ||||||||||||||||||||||||
| 671 | bool QQuickMouseArea::containsPress() const | - | ||||||||||||||||||||||||
| 672 | { | - | ||||||||||||||||||||||||
| 673 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 674 |     return executed 68 times by 2 tests:   d->pressed && d->hovered;return d->pressed && d->hovered;Executed by: 
 executed 68 times by 2 tests:  return d->pressed && d->hovered;Executed by: 
  | 68 | ||||||||||||||||||||||||
| 675 | } | - | ||||||||||||||||||||||||
| 676 | - | |||||||||||||||||||||||||
| 677 | void QQuickMouseArea::setHovered(bool h) | - | ||||||||||||||||||||||||
| 678 | { | - | ||||||||||||||||||||||||
| 679 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 680 |     if (d->hovered != h
  | 427-510 | ||||||||||||||||||||||||
| 681 |         for (bool qt_category_enabled = DBG_HOVER_TRACE().isDebugEnabled(); qt_category_enabled
 never executed:  QMessageLogger(__FILE__, 1155, __PRETTY_FUNCTION__, DBG_HOVER_TRACE().categoryName()).debug() << this << d->hovered << "->" << h; | 0-510 | ||||||||||||||||||||||||
| 682 | d->hovered = h; | - | ||||||||||||||||||||||||
| 683 | hoveredChanged(); | - | ||||||||||||||||||||||||
| 684 | d->hovered ? entered() : exited(); | - | ||||||||||||||||||||||||
| 685 |         if (d->pressed
  | 22-488 | ||||||||||||||||||||||||
| 686 |             containsPressChanged(); executed 22 times by 3 tests:  containsPressChanged();Executed by: 
  | 22 | ||||||||||||||||||||||||
| 687 |     } executed 510 times by 8 tests:  end of blockExecuted by: 
  | 510 | ||||||||||||||||||||||||
| 688 | } executed 937 times by 8 tests:  end of blockExecuted by: 
  | 937 | ||||||||||||||||||||||||
| 689 | Qt::MouseButtons QQuickMouseArea::acceptedButtons() const | - | ||||||||||||||||||||||||
| 690 | { | - | ||||||||||||||||||||||||
| 691 |     return executed 24 times by 1 test:   acceptedMouseButtons();return acceptedMouseButtons();Executed by: 
 executed 24 times by 1 test:  return acceptedMouseButtons();Executed by: 
  | 24 | ||||||||||||||||||||||||
| 692 | } | - | ||||||||||||||||||||||||
| 693 | - | |||||||||||||||||||||||||
| 694 | void QQuickMouseArea::setAcceptedButtons(Qt::MouseButtons buttons) | - | ||||||||||||||||||||||||
| 695 | { | - | ||||||||||||||||||||||||
| 696 |     if (buttons != acceptedMouseButtons()
  | 16-54 | ||||||||||||||||||||||||
| 697 | setAcceptedMouseButtons(buttons); | - | ||||||||||||||||||||||||
| 698 | acceptedButtonsChanged(); | - | ||||||||||||||||||||||||
| 699 |     } executed 54 times by 4 tests:  end of blockExecuted by: 
  | 54 | ||||||||||||||||||||||||
| 700 | } executed 70 times by 4 tests:  end of blockExecuted by: 
  | 70 | ||||||||||||||||||||||||
| 701 | - | |||||||||||||||||||||||||
| 702 | bool QQuickMouseArea::setPressed(Qt::MouseButton button, bool p, Qt::MouseEventSource source) | - | ||||||||||||||||||||||||
| 703 | { | - | ||||||||||||||||||||||||
| 704 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 705 | - | |||||||||||||||||||||||||
| 706 | - | |||||||||||||||||||||||||
| 707 |     bool dragged = d->drag
 
  | 58-376 | ||||||||||||||||||||||||
| 708 | - | |||||||||||||||||||||||||
| 709 | - | |||||||||||||||||||||||||
| 710 | - | |||||||||||||||||||||||||
| 711 | bool wasPressed = d->pressed & button; | - | ||||||||||||||||||||||||
| 712 |     bool isclick = wasPressed
 
 
 
  | 2-286 | ||||||||||||||||||||||||
| 713 | Qt::MouseButtons oldPressed = d->pressed; | - | ||||||||||||||||||||||||
| 714 | - | |||||||||||||||||||||||||
| 715 |     if (wasPressed != p
  | 6-508 | ||||||||||||||||||||||||
| 716 | QQuickMouseEvent &me = d->quickMouseEvent; | - | ||||||||||||||||||||||||
| 717 | me.reset(d->lastPos.x(), d->lastPos.y(), d->lastButton, d->lastButtons, d->lastModifiers, isclick, d->longPress, d->lastFlags); | - | ||||||||||||||||||||||||
| 718 | me.setSource(source); | - | ||||||||||||||||||||||||
| 719 |         if (p
  | 222-286 | ||||||||||||||||||||||||
| 720 | d->pressed |= button; | - | ||||||||||||||||||||||||
| 721 |             if (!d->doubleClick
  | 0-286 | ||||||||||||||||||||||||
| 722 |                 pressed(&me); executed 286 times by 6 tests:  pressed(&me);Executed by: 
  | 286 | ||||||||||||||||||||||||
| 723 | me.setPosition(d->lastPos); | - | ||||||||||||||||||||||||
| 724 | mouseXChanged(&me); | - | ||||||||||||||||||||||||
| 725 | me.setPosition(d->lastPos); | - | ||||||||||||||||||||||||
| 726 | mouseYChanged(&me); | - | ||||||||||||||||||||||||
| 727 | - | |||||||||||||||||||||||||
| 728 |             if (!me.isAccepted()
  | 10-276 | ||||||||||||||||||||||||
| 729 | d->pressed = Qt::NoButton; | - | ||||||||||||||||||||||||
| 730 |             } executed 10 times by 1 test:  end of blockExecuted by: 
  | 10 | ||||||||||||||||||||||||
| 731 | - | |||||||||||||||||||||||||
| 732 |             if (!oldPressed
  | 2-284 | ||||||||||||||||||||||||
| 733 | pressedChanged(); | - | ||||||||||||||||||||||||
| 734 | containsPressChanged(); | - | ||||||||||||||||||||||||
| 735 |             } executed 284 times by 6 tests:  end of blockExecuted by: 
  | 284 | ||||||||||||||||||||||||
| 736 | pressedButtonsChanged(); | - | ||||||||||||||||||||||||
| 737 |         } executed 286 times by 6 tests:   else {end of blockExecuted by: 
  | 286 | ||||||||||||||||||||||||
| 738 | d->pressed &= ~button; | - | ||||||||||||||||||||||||
| 739 | released(&me); | - | ||||||||||||||||||||||||
| 740 | me.setPosition(d->lastPos); | - | ||||||||||||||||||||||||
| 741 |             if (!d->pressed
  | 2-220 | ||||||||||||||||||||||||
| 742 | pressedChanged(); | - | ||||||||||||||||||||||||
| 743 | containsPressChanged(); | - | ||||||||||||||||||||||||
| 744 |             } executed 220 times by 6 tests:  end of blockExecuted by: 
  | 220 | ||||||||||||||||||||||||
| 745 | pressedButtonsChanged(); | - | ||||||||||||||||||||||||
| 746 |             if (isclick
 
 
  | 14-162 | ||||||||||||||||||||||||
| 747 | me.setAccepted(d->isClickConnected()); | - | ||||||||||||||||||||||||
| 748 | clicked(&me); | - | ||||||||||||||||||||||||
| 749 |                 if (!me.isAccepted()
  | 54-74 | ||||||||||||||||||||||||
| 750 |                     d->propagate(&me, QQuickMouseAreaPrivate::Click); executed 74 times by 3 tests:  d->propagate(&me, QQuickMouseAreaPrivate::Click);Executed by: 
  | 74 | ||||||||||||||||||||||||
| 751 |             } executed 128 times by 4 tests:  end of blockExecuted by: 
  | 128 | ||||||||||||||||||||||||
| 752 |         } executed 222 times by 6 tests:  end of blockExecuted by: 
  | 222 | ||||||||||||||||||||||||
| 753 | - | |||||||||||||||||||||||||
| 754 |         return executed 508 times by 6 tests:   me.isAccepted();return me.isAccepted();Executed by: 
 executed 508 times by 6 tests:  return me.isAccepted();Executed by: 
  | 508 | ||||||||||||||||||||||||
| 755 | } | - | ||||||||||||||||||||||||
| 756 |     return executed 6 times by 1 test:   false;return false;Executed by: 
 executed 6 times by 1 test:  return false;Executed by: 
  | 6 | ||||||||||||||||||||||||
| 757 | } | - | ||||||||||||||||||||||||
| 758 | Qt::CursorShape QQuickMouseArea::cursorShape() const | - | ||||||||||||||||||||||||
| 759 | { | - | ||||||||||||||||||||||||
| 760 |     return executed 30 times by 2 tests:   cursor().shape();return cursor().shape();Executed by: 
 executed 30 times by 2 tests:  return cursor().shape();Executed by: 
  | 30 | ||||||||||||||||||||||||
| 761 | } | - | ||||||||||||||||||||||||
| 762 | - | |||||||||||||||||||||||||
| 763 | void QQuickMouseArea::setCursorShape(Qt::CursorShape shape) | - | ||||||||||||||||||||||||
| 764 | { | - | ||||||||||||||||||||||||
| 765 |     if (cursor().shape() == shape
  | 2-4 | ||||||||||||||||||||||||
| 766 |         return; executed 2 times by 1 test:  return;Executed by: 
  | 2 | ||||||||||||||||||||||||
| 767 | - | |||||||||||||||||||||||||
| 768 | setCursor(shape); | - | ||||||||||||||||||||||||
| 769 | - | |||||||||||||||||||||||||
| 770 | cursorShapeChanged(); | - | ||||||||||||||||||||||||
| 771 | } executed 4 times by 1 test:  end of blockExecuted by: 
  | 4 | ||||||||||||||||||||||||
| 772 | int QQuickMouseArea::pressAndHoldInterval() const | - | ||||||||||||||||||||||||
| 773 | { | - | ||||||||||||||||||||||||
| 774 | const QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 775 |     return executed 300 times by 7 tests:   d->pressAndHoldInterval > -1 ?return d->pressAndHoldInterval > -1 ? d->pressAndHoldInterval : QGuiApplication::styleHints()->mousePressAndHoldInterval();Executed by: 
 executed 300 times by 7 tests:  return d->pressAndHoldInterval > -1 ? d->pressAndHoldInterval : QGuiApplication::styleHints()->mousePressAndHoldInterval();Executed by: 
  | 300 | ||||||||||||||||||||||||
| 776 |         d->pressAndHoldInterval : QGuiApplication::styleHints()->mousePressAndHoldInterval(); executed 300 times by 7 tests:  return d->pressAndHoldInterval > -1 ? d->pressAndHoldInterval : QGuiApplication::styleHints()->mousePressAndHoldInterval();Executed by: 
  | 300 | ||||||||||||||||||||||||
| 777 | } | - | ||||||||||||||||||||||||
| 778 | - | |||||||||||||||||||||||||
| 779 | void QQuickMouseArea::setPressAndHoldInterval(int interval) | - | ||||||||||||||||||||||||
| 780 | { | - | ||||||||||||||||||||||||
| 781 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 782 |     if (interval != d->pressAndHoldInterval
  | 0-4 | ||||||||||||||||||||||||
| 783 | d->pressAndHoldInterval = interval; | - | ||||||||||||||||||||||||
| 784 | pressAndHoldIntervalChanged(); | - | ||||||||||||||||||||||||
| 785 |     } executed 4 times by 1 test:  end of blockExecuted by: 
  | 4 | ||||||||||||||||||||||||
| 786 | } executed 4 times by 1 test:  end of blockExecuted by: 
  | 4 | ||||||||||||||||||||||||
| 787 | - | |||||||||||||||||||||||||
| 788 | void QQuickMouseArea::resetPressAndHoldInterval() | - | ||||||||||||||||||||||||
| 789 | { | - | ||||||||||||||||||||||||
| 790 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 791 |     if (d->pressAndHoldInterval > -1
  | 0-2 | ||||||||||||||||||||||||
| 792 | d->pressAndHoldInterval = -1; | - | ||||||||||||||||||||||||
| 793 | pressAndHoldIntervalChanged(); | - | ||||||||||||||||||||||||
| 794 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 795 | } executed 2 times by 1 test:  end of blockExecuted by: 
  | 2 | ||||||||||||||||||||||||
| 796 | QQuickDrag *QQuickMouseArea::drag() | - | ||||||||||||||||||||||||
| 797 | { | - | ||||||||||||||||||||||||
| 798 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 799 |     if (!d->drag
  | 452-3098 | ||||||||||||||||||||||||
| 800 |         d->drag = new QQuickDrag; executed 452 times by 6 tests:  d->drag = new QQuickDrag;Executed by: 
  | 452 | ||||||||||||||||||||||||
| 801 |     return executed 3550 times by 6 tests:   d->drag;return d->drag;Executed by: 
 executed 3550 times by 6 tests:  return d->drag;Executed by: 
  | 3550 | ||||||||||||||||||||||||
| 802 | } | - | ||||||||||||||||||||||||
| 803 | - | |||||||||||||||||||||||||
| 804 | - | |||||||||||||||||||||||||
| 805 | QSGNode *QQuickMouseArea::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) | - | ||||||||||||||||||||||||
| 806 | { | - | ||||||||||||||||||||||||
| 807 | (void)data;; | - | ||||||||||||||||||||||||
| 808 | QQuickMouseAreaPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 809 | - | |||||||||||||||||||||||||
| 810 |     if (!qmlVisualTouchDebugging()
  | 0 | ||||||||||||||||||||||||
| 811 |         return never executed:   nullptr;return nullptr;never executed:  return nullptr; | 0 | ||||||||||||||||||||||||
| 812 | - | |||||||||||||||||||||||||
| 813 | QSGInternalRectangleNode *rectangle = static_cast<QSGInternalRectangleNode *>(oldNode); | - | ||||||||||||||||||||||||
| 814 |     if (!rectangle
 never executed:  rectangle = d->sceneGraphContext()->createInternalRectangleNode(); | 0 | ||||||||||||||||||||||||
| 815 | - | |||||||||||||||||||||||||
| 816 | rectangle->setRect(QRectF(0, 0, width(), height())); | - | ||||||||||||||||||||||||
| 817 | rectangle->setColor(QColor(255, 0, 0, 50)); | - | ||||||||||||||||||||||||
| 818 | rectangle->update(); | - | ||||||||||||||||||||||||
| 819 |     return never executed:   rectangle;return rectangle;never executed:  return rectangle; | 0 | ||||||||||||||||||||||||
| 820 | } | - | ||||||||||||||||||||||||
| 821 | - | |||||||||||||||||||||||||
| 822 | - | |||||||||||||||||||||||||
| 823 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |