| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/widgets/kernel/qgesture.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | QGesture::QGesture(QObject *parent) | - | ||||||||||||||||||
| 6 | : QObject(*new QGesturePrivate, parent) | - | ||||||||||||||||||
| 7 | { | - | ||||||||||||||||||
| 8 | d_func()->gestureType = Qt::CustomGesture; | - | ||||||||||||||||||
| 9 | } never executed:  end of block | 0 | ||||||||||||||||||
| 10 | - | |||||||||||||||||||
| 11 | - | |||||||||||||||||||
| 12 | - | |||||||||||||||||||
| 13 | - | |||||||||||||||||||
| 14 | QGesture::QGesture(QGesturePrivate &dd, QObject *parent) | - | ||||||||||||||||||
| 15 | : QObject(dd, parent) | - | ||||||||||||||||||
| 16 | { | - | ||||||||||||||||||
| 17 | } never executed:  end of block | 0 | ||||||||||||||||||
| 18 | - | |||||||||||||||||||
| 19 | - | |||||||||||||||||||
| 20 | - | |||||||||||||||||||
| 21 | - | |||||||||||||||||||
| 22 | QGesture::~QGesture() | - | ||||||||||||||||||
| 23 | { | - | ||||||||||||||||||
| 24 | } | - | ||||||||||||||||||
| 25 | Qt::GestureType QGesture::gestureType() const | - | ||||||||||||||||||
| 26 | { | - | ||||||||||||||||||
| 27 |     return never executed:   d_func()->gestureType;return d_func()->gestureType;never executed:  return d_func()->gestureType; | 0 | ||||||||||||||||||
| 28 | } | - | ||||||||||||||||||
| 29 | - | |||||||||||||||||||
| 30 | Qt::GestureState QGesture::state() const | - | ||||||||||||||||||
| 31 | { | - | ||||||||||||||||||
| 32 |     return never executed:   d_func()->state;return d_func()->state;never executed:  return d_func()->state; | 0 | ||||||||||||||||||
| 33 | } | - | ||||||||||||||||||
| 34 | - | |||||||||||||||||||
| 35 | QPointF QGesture::hotSpot() const | - | ||||||||||||||||||
| 36 | { | - | ||||||||||||||||||
| 37 |     return never executed:   d_func()->hotSpot;return d_func()->hotSpot;never executed:  return d_func()->hotSpot; | 0 | ||||||||||||||||||
| 38 | } | - | ||||||||||||||||||
| 39 | - | |||||||||||||||||||
| 40 | void QGesture::setHotSpot(const QPointF &value) | - | ||||||||||||||||||
| 41 | { | - | ||||||||||||||||||
| 42 | QGesturePrivate * const d = d_func(); | - | ||||||||||||||||||
| 43 | d->hotSpot = value; | - | ||||||||||||||||||
| 44 | d->isHotSpotSet = true; | - | ||||||||||||||||||
| 45 | } never executed:  end of block | 0 | ||||||||||||||||||
| 46 | - | |||||||||||||||||||
| 47 | bool QGesture::hasHotSpot() const | - | ||||||||||||||||||
| 48 | { | - | ||||||||||||||||||
| 49 |     return never executed:   d_func()->isHotSpotSet;return d_func()->isHotSpotSet;never executed:  return d_func()->isHotSpotSet; | 0 | ||||||||||||||||||
| 50 | } | - | ||||||||||||||||||
| 51 | - | |||||||||||||||||||
| 52 | void QGesture::unsetHotSpot() | - | ||||||||||||||||||
| 53 | { | - | ||||||||||||||||||
| 54 | d_func()->isHotSpotSet = false; | - | ||||||||||||||||||
| 55 | } never executed:  end of block | 0 | ||||||||||||||||||
| 56 | void QGesture::setGestureCancelPolicy(GestureCancelPolicy policy) | - | ||||||||||||||||||
| 57 | { | - | ||||||||||||||||||
| 58 | QGesturePrivate * const d = d_func(); | - | ||||||||||||||||||
| 59 | d->gestureCancelPolicy = static_cast<uint>(policy); | - | ||||||||||||||||||
| 60 | } never executed:  end of block | 0 | ||||||||||||||||||
| 61 | - | |||||||||||||||||||
| 62 | QGesture::GestureCancelPolicy QGesture::gestureCancelPolicy() const | - | ||||||||||||||||||
| 63 | { | - | ||||||||||||||||||
| 64 | const QGesturePrivate * const d = d_func(); | - | ||||||||||||||||||
| 65 |     return never executed:   static_cast<GestureCancelPolicy>(d->gestureCancelPolicy);return static_cast<GestureCancelPolicy>(d->gestureCancelPolicy);never executed:  return static_cast<GestureCancelPolicy>(d->gestureCancelPolicy); | 0 | ||||||||||||||||||
| 66 | } | - | ||||||||||||||||||
| 67 | QPanGesture::QPanGesture(QObject *parent) | - | ||||||||||||||||||
| 68 | : QGesture(*new QPanGesturePrivate, parent) | - | ||||||||||||||||||
| 69 | { | - | ||||||||||||||||||
| 70 | d_func()->gestureType = Qt::PanGesture; | - | ||||||||||||||||||
| 71 | } never executed:  end of block | 0 | ||||||||||||||||||
| 72 | - | |||||||||||||||||||
| 73 | - | |||||||||||||||||||
| 74 | - | |||||||||||||||||||
| 75 | - | |||||||||||||||||||
| 76 | QPanGesture::~QPanGesture() | - | ||||||||||||||||||
| 77 | { | - | ||||||||||||||||||
| 78 | } | - | ||||||||||||||||||
| 79 | - | |||||||||||||||||||
| 80 | QPointF QPanGesture::lastOffset() const | - | ||||||||||||||||||
| 81 | { | - | ||||||||||||||||||
| 82 |     return never executed:   d_func()->lastOffset;return d_func()->lastOffset;never executed:  return d_func()->lastOffset; | 0 | ||||||||||||||||||
| 83 | } | - | ||||||||||||||||||
| 84 | - | |||||||||||||||||||
| 85 | QPointF QPanGesture::offset() const | - | ||||||||||||||||||
| 86 | { | - | ||||||||||||||||||
| 87 |     return never executed:   d_func()->offset;return d_func()->offset;never executed:  return d_func()->offset; | 0 | ||||||||||||||||||
| 88 | } | - | ||||||||||||||||||
| 89 | - | |||||||||||||||||||
| 90 | QPointF QPanGesture::delta() const | - | ||||||||||||||||||
| 91 | { | - | ||||||||||||||||||
| 92 | const QPanGesturePrivate * const d = d_func(); | - | ||||||||||||||||||
| 93 |     return never executed:   d->offset - d->lastOffset;return d->offset - d->lastOffset;never executed:  return d->offset - d->lastOffset; | 0 | ||||||||||||||||||
| 94 | } | - | ||||||||||||||||||
| 95 | - | |||||||||||||||||||
| 96 | qreal QPanGesture::acceleration() const | - | ||||||||||||||||||
| 97 | { | - | ||||||||||||||||||
| 98 |     return never executed:   d_func()->acceleration;return d_func()->acceleration;never executed:  return d_func()->acceleration; | 0 | ||||||||||||||||||
| 99 | } | - | ||||||||||||||||||
| 100 | - | |||||||||||||||||||
| 101 | void QPanGesture::setLastOffset(const QPointF &value) | - | ||||||||||||||||||
| 102 | { | - | ||||||||||||||||||
| 103 | d_func()->lastOffset = value; | - | ||||||||||||||||||
| 104 | } never executed:  end of block | 0 | ||||||||||||||||||
| 105 | - | |||||||||||||||||||
| 106 | void QPanGesture::setOffset(const QPointF &value) | - | ||||||||||||||||||
| 107 | { | - | ||||||||||||||||||
| 108 | d_func()->offset = value; | - | ||||||||||||||||||
| 109 | } never executed:  end of block | 0 | ||||||||||||||||||
| 110 | - | |||||||||||||||||||
| 111 | void QPanGesture::setAcceleration(qreal value) | - | ||||||||||||||||||
| 112 | { | - | ||||||||||||||||||
| 113 | d_func()->acceleration = value; | - | ||||||||||||||||||
| 114 | } never executed:  end of block | 0 | ||||||||||||||||||
| 115 | QPinchGesture::QPinchGesture(QObject *parent) | - | ||||||||||||||||||
| 116 | : QGesture(*new QPinchGesturePrivate, parent) | - | ||||||||||||||||||
| 117 | { | - | ||||||||||||||||||
| 118 | d_func()->gestureType = Qt::PinchGesture; | - | ||||||||||||||||||
| 119 | } never executed:  end of block | 0 | ||||||||||||||||||
| 120 | - | |||||||||||||||||||
| 121 | - | |||||||||||||||||||
| 122 | - | |||||||||||||||||||
| 123 | - | |||||||||||||||||||
| 124 | QPinchGesture::~QPinchGesture() | - | ||||||||||||||||||
| 125 | { | - | ||||||||||||||||||
| 126 | } | - | ||||||||||||||||||
| 127 | - | |||||||||||||||||||
| 128 | QPinchGesture::ChangeFlags QPinchGesture::totalChangeFlags() const | - | ||||||||||||||||||
| 129 | { | - | ||||||||||||||||||
| 130 |     return never executed:   d_func()->totalChangeFlags;return d_func()->totalChangeFlags;never executed:  return d_func()->totalChangeFlags; | 0 | ||||||||||||||||||
| 131 | } | - | ||||||||||||||||||
| 132 | - | |||||||||||||||||||
| 133 | void QPinchGesture::setTotalChangeFlags(QPinchGesture::ChangeFlags value) | - | ||||||||||||||||||
| 134 | { | - | ||||||||||||||||||
| 135 | d_func()->totalChangeFlags = value; | - | ||||||||||||||||||
| 136 | } never executed:  end of block | 0 | ||||||||||||||||||
| 137 | - | |||||||||||||||||||
| 138 | QPinchGesture::ChangeFlags QPinchGesture::changeFlags() const | - | ||||||||||||||||||
| 139 | { | - | ||||||||||||||||||
| 140 |     return never executed:   d_func()->changeFlags;return d_func()->changeFlags;never executed:  return d_func()->changeFlags; | 0 | ||||||||||||||||||
| 141 | } | - | ||||||||||||||||||
| 142 | - | |||||||||||||||||||
| 143 | void QPinchGesture::setChangeFlags(QPinchGesture::ChangeFlags value) | - | ||||||||||||||||||
| 144 | { | - | ||||||||||||||||||
| 145 | d_func()->changeFlags = value; | - | ||||||||||||||||||
| 146 | } never executed:  end of block | 0 | ||||||||||||||||||
| 147 | - | |||||||||||||||||||
| 148 | QPointF QPinchGesture::startCenterPoint() const | - | ||||||||||||||||||
| 149 | { | - | ||||||||||||||||||
| 150 |     return never executed:   d_func()->startCenterPoint;return d_func()->startCenterPoint;never executed:  return d_func()->startCenterPoint; | 0 | ||||||||||||||||||
| 151 | } | - | ||||||||||||||||||
| 152 | - | |||||||||||||||||||
| 153 | QPointF QPinchGesture::lastCenterPoint() const | - | ||||||||||||||||||
| 154 | { | - | ||||||||||||||||||
| 155 |     return never executed:   d_func()->lastCenterPoint;return d_func()->lastCenterPoint;never executed:  return d_func()->lastCenterPoint; | 0 | ||||||||||||||||||
| 156 | } | - | ||||||||||||||||||
| 157 | - | |||||||||||||||||||
| 158 | QPointF QPinchGesture::centerPoint() const | - | ||||||||||||||||||
| 159 | { | - | ||||||||||||||||||
| 160 |     return never executed:   d_func()->centerPoint;return d_func()->centerPoint;never executed:  return d_func()->centerPoint; | 0 | ||||||||||||||||||
| 161 | } | - | ||||||||||||||||||
| 162 | - | |||||||||||||||||||
| 163 | void QPinchGesture::setStartCenterPoint(const QPointF &value) | - | ||||||||||||||||||
| 164 | { | - | ||||||||||||||||||
| 165 | d_func()->startCenterPoint = value; | - | ||||||||||||||||||
| 166 | } never executed:  end of block | 0 | ||||||||||||||||||
| 167 | - | |||||||||||||||||||
| 168 | void QPinchGesture::setLastCenterPoint(const QPointF &value) | - | ||||||||||||||||||
| 169 | { | - | ||||||||||||||||||
| 170 | d_func()->lastCenterPoint = value; | - | ||||||||||||||||||
| 171 | } never executed:  end of block | 0 | ||||||||||||||||||
| 172 | - | |||||||||||||||||||
| 173 | void QPinchGesture::setCenterPoint(const QPointF &value) | - | ||||||||||||||||||
| 174 | { | - | ||||||||||||||||||
| 175 | d_func()->centerPoint = value; | - | ||||||||||||||||||
| 176 | } never executed:  end of block | 0 | ||||||||||||||||||
| 177 | - | |||||||||||||||||||
| 178 | - | |||||||||||||||||||
| 179 | qreal QPinchGesture::totalScaleFactor() const | - | ||||||||||||||||||
| 180 | { | - | ||||||||||||||||||
| 181 |     return never executed:   d_func()->totalScaleFactor;return d_func()->totalScaleFactor;never executed:  return d_func()->totalScaleFactor; | 0 | ||||||||||||||||||
| 182 | } | - | ||||||||||||||||||
| 183 | - | |||||||||||||||||||
| 184 | qreal QPinchGesture::lastScaleFactor() const | - | ||||||||||||||||||
| 185 | { | - | ||||||||||||||||||
| 186 |     return never executed:   d_func()->lastScaleFactor;return d_func()->lastScaleFactor;never executed:  return d_func()->lastScaleFactor; | 0 | ||||||||||||||||||
| 187 | } | - | ||||||||||||||||||
| 188 | - | |||||||||||||||||||
| 189 | qreal QPinchGesture::scaleFactor() const | - | ||||||||||||||||||
| 190 | { | - | ||||||||||||||||||
| 191 |     return never executed:   d_func()->scaleFactor;return d_func()->scaleFactor;never executed:  return d_func()->scaleFactor; | 0 | ||||||||||||||||||
| 192 | } | - | ||||||||||||||||||
| 193 | - | |||||||||||||||||||
| 194 | void QPinchGesture::setTotalScaleFactor(qreal value) | - | ||||||||||||||||||
| 195 | { | - | ||||||||||||||||||
| 196 | d_func()->totalScaleFactor = value; | - | ||||||||||||||||||
| 197 | } never executed:  end of block | 0 | ||||||||||||||||||
| 198 | - | |||||||||||||||||||
| 199 | void QPinchGesture::setLastScaleFactor(qreal value) | - | ||||||||||||||||||
| 200 | { | - | ||||||||||||||||||
| 201 | d_func()->lastScaleFactor = value; | - | ||||||||||||||||||
| 202 | } never executed:  end of block | 0 | ||||||||||||||||||
| 203 | - | |||||||||||||||||||
| 204 | void QPinchGesture::setScaleFactor(qreal value) | - | ||||||||||||||||||
| 205 | { | - | ||||||||||||||||||
| 206 | d_func()->scaleFactor = value; | - | ||||||||||||||||||
| 207 | } never executed:  end of block | 0 | ||||||||||||||||||
| 208 | - | |||||||||||||||||||
| 209 | - | |||||||||||||||||||
| 210 | qreal QPinchGesture::totalRotationAngle() const | - | ||||||||||||||||||
| 211 | { | - | ||||||||||||||||||
| 212 |     return never executed:   d_func()->totalRotationAngle;return d_func()->totalRotationAngle;never executed:  return d_func()->totalRotationAngle; | 0 | ||||||||||||||||||
| 213 | } | - | ||||||||||||||||||
| 214 | - | |||||||||||||||||||
| 215 | qreal QPinchGesture::lastRotationAngle() const | - | ||||||||||||||||||
| 216 | { | - | ||||||||||||||||||
| 217 |     return never executed:   d_func()->lastRotationAngle;return d_func()->lastRotationAngle;never executed:  return d_func()->lastRotationAngle; | 0 | ||||||||||||||||||
| 218 | } | - | ||||||||||||||||||
| 219 | - | |||||||||||||||||||
| 220 | qreal QPinchGesture::rotationAngle() const | - | ||||||||||||||||||
| 221 | { | - | ||||||||||||||||||
| 222 |     return never executed:   d_func()->rotationAngle;return d_func()->rotationAngle;never executed:  return d_func()->rotationAngle; | 0 | ||||||||||||||||||
| 223 | } | - | ||||||||||||||||||
| 224 | - | |||||||||||||||||||
| 225 | void QPinchGesture::setTotalRotationAngle(qreal value) | - | ||||||||||||||||||
| 226 | { | - | ||||||||||||||||||
| 227 | d_func()->totalRotationAngle = value; | - | ||||||||||||||||||
| 228 | } never executed:  end of block | 0 | ||||||||||||||||||
| 229 | - | |||||||||||||||||||
| 230 | void QPinchGesture::setLastRotationAngle(qreal value) | - | ||||||||||||||||||
| 231 | { | - | ||||||||||||||||||
| 232 | d_func()->lastRotationAngle = value; | - | ||||||||||||||||||
| 233 | } never executed:  end of block | 0 | ||||||||||||||||||
| 234 | - | |||||||||||||||||||
| 235 | void QPinchGesture::setRotationAngle(qreal value) | - | ||||||||||||||||||
| 236 | { | - | ||||||||||||||||||
| 237 | d_func()->rotationAngle = value; | - | ||||||||||||||||||
| 238 | } never executed:  end of block | 0 | ||||||||||||||||||
| 239 | QSwipeGesture::QSwipeGesture(QObject *parent) | - | ||||||||||||||||||
| 240 | : QGesture(*new QSwipeGesturePrivate, parent) | - | ||||||||||||||||||
| 241 | { | - | ||||||||||||||||||
| 242 | d_func()->gestureType = Qt::SwipeGesture; | - | ||||||||||||||||||
| 243 | } never executed:  end of block | 0 | ||||||||||||||||||
| 244 | - | |||||||||||||||||||
| 245 | - | |||||||||||||||||||
| 246 | - | |||||||||||||||||||
| 247 | - | |||||||||||||||||||
| 248 | QSwipeGesture::~QSwipeGesture() | - | ||||||||||||||||||
| 249 | { | - | ||||||||||||||||||
| 250 | } | - | ||||||||||||||||||
| 251 | - | |||||||||||||||||||
| 252 | QSwipeGesture::SwipeDirection QSwipeGesture::horizontalDirection() const | - | ||||||||||||||||||
| 253 | { | - | ||||||||||||||||||
| 254 | const QSwipeGesturePrivate * const d = d_func(); | - | ||||||||||||||||||
| 255 |     if (d->swipeAngle < 0
 
 
  | 0 | ||||||||||||||||||
| 256 |         return never executed:   QSwipeGesture::NoDirection;return QSwipeGesture::NoDirection;never executed:  return QSwipeGesture::NoDirection; | 0 | ||||||||||||||||||
| 257 |     else if (d->swipeAngle < 90
 
  | 0 | ||||||||||||||||||
| 258 |         return never executed:   QSwipeGesture::Right;return QSwipeGesture::Right;never executed:  return QSwipeGesture::Right; | 0 | ||||||||||||||||||
| 259 | else | - | ||||||||||||||||||
| 260 |         return never executed:   QSwipeGesture::Left;return QSwipeGesture::Left;never executed:  return QSwipeGesture::Left; | 0 | ||||||||||||||||||
| 261 | } | - | ||||||||||||||||||
| 262 | - | |||||||||||||||||||
| 263 | QSwipeGesture::SwipeDirection QSwipeGesture::verticalDirection() const | - | ||||||||||||||||||
| 264 | { | - | ||||||||||||||||||
| 265 | const QSwipeGesturePrivate * const d = d_func(); | - | ||||||||||||||||||
| 266 |     if (d->swipeAngle <= 0
 
  | 0 | ||||||||||||||||||
| 267 |         return never executed:   QSwipeGesture::NoDirection;return QSwipeGesture::NoDirection;never executed:  return QSwipeGesture::NoDirection; | 0 | ||||||||||||||||||
| 268 |     else if (d->swipeAngle < 180
  | 0 | ||||||||||||||||||
| 269 |         return never executed:   QSwipeGesture::Up;return QSwipeGesture::Up;never executed:  return QSwipeGesture::Up; | 0 | ||||||||||||||||||
| 270 | else | - | ||||||||||||||||||
| 271 |         return never executed:   QSwipeGesture::Down;return QSwipeGesture::Down;never executed:  return QSwipeGesture::Down; | 0 | ||||||||||||||||||
| 272 | } | - | ||||||||||||||||||
| 273 | - | |||||||||||||||||||
| 274 | qreal QSwipeGesture::swipeAngle() const | - | ||||||||||||||||||
| 275 | { | - | ||||||||||||||||||
| 276 |     return never executed:   d_func()->swipeAngle;return d_func()->swipeAngle;never executed:  return d_func()->swipeAngle; | 0 | ||||||||||||||||||
| 277 | } | - | ||||||||||||||||||
| 278 | - | |||||||||||||||||||
| 279 | void QSwipeGesture::setSwipeAngle(qreal value) | - | ||||||||||||||||||
| 280 | { | - | ||||||||||||||||||
| 281 | d_func()->swipeAngle = value; | - | ||||||||||||||||||
| 282 | } never executed:  end of block | 0 | ||||||||||||||||||
| 283 | QTapGesture::QTapGesture(QObject *parent) | - | ||||||||||||||||||
| 284 | : QGesture(*new QTapGesturePrivate, parent) | - | ||||||||||||||||||
| 285 | { | - | ||||||||||||||||||
| 286 | d_func()->gestureType = Qt::TapGesture; | - | ||||||||||||||||||
| 287 | } never executed:  end of block | 0 | ||||||||||||||||||
| 288 | - | |||||||||||||||||||
| 289 | - | |||||||||||||||||||
| 290 | - | |||||||||||||||||||
| 291 | - | |||||||||||||||||||
| 292 | QTapGesture::~QTapGesture() | - | ||||||||||||||||||
| 293 | { | - | ||||||||||||||||||
| 294 | } | - | ||||||||||||||||||
| 295 | - | |||||||||||||||||||
| 296 | QPointF QTapGesture::position() const | - | ||||||||||||||||||
| 297 | { | - | ||||||||||||||||||
| 298 |     return never executed:   d_func()->position;return d_func()->position;never executed:  return d_func()->position; | 0 | ||||||||||||||||||
| 299 | } | - | ||||||||||||||||||
| 300 | - | |||||||||||||||||||
| 301 | void QTapGesture::setPosition(const QPointF &value) | - | ||||||||||||||||||
| 302 | { | - | ||||||||||||||||||
| 303 | d_func()->position = value; | - | ||||||||||||||||||
| 304 | } never executed:  end of block | 0 | ||||||||||||||||||
| 305 | QTapAndHoldGesture::QTapAndHoldGesture(QObject *parent) | - | ||||||||||||||||||
| 306 | : QGesture(*new QTapAndHoldGesturePrivate, parent) | - | ||||||||||||||||||
| 307 | { | - | ||||||||||||||||||
| 308 | d_func()->gestureType = Qt::TapAndHoldGesture; | - | ||||||||||||||||||
| 309 | } never executed:  end of block | 0 | ||||||||||||||||||
| 310 | - | |||||||||||||||||||
| 311 | - | |||||||||||||||||||
| 312 | - | |||||||||||||||||||
| 313 | - | |||||||||||||||||||
| 314 | QTapAndHoldGesture::~QTapAndHoldGesture() | - | ||||||||||||||||||
| 315 | { | - | ||||||||||||||||||
| 316 | } | - | ||||||||||||||||||
| 317 | - | |||||||||||||||||||
| 318 | QPointF QTapAndHoldGesture::position() const | - | ||||||||||||||||||
| 319 | { | - | ||||||||||||||||||
| 320 |     return never executed:   d_func()->position;return d_func()->position;never executed:  return d_func()->position; | 0 | ||||||||||||||||||
| 321 | } | - | ||||||||||||||||||
| 322 | - | |||||||||||||||||||
| 323 | void QTapAndHoldGesture::setPosition(const QPointF &value) | - | ||||||||||||||||||
| 324 | { | - | ||||||||||||||||||
| 325 | d_func()->position = value; | - | ||||||||||||||||||
| 326 | } never executed:  end of block | 0 | ||||||||||||||||||
| 327 | void QTapAndHoldGesture::setTimeout(int msecs) | - | ||||||||||||||||||
| 328 | { | - | ||||||||||||||||||
| 329 | QTapAndHoldGesturePrivate::Timeout = msecs; | - | ||||||||||||||||||
| 330 | } never executed:  end of block | 0 | ||||||||||||||||||
| 331 | int QTapAndHoldGesture::timeout() | - | ||||||||||||||||||
| 332 | { | - | ||||||||||||||||||
| 333 |     return never executed:   QTapAndHoldGesturePrivate::Timeout;return QTapAndHoldGesturePrivate::Timeout;never executed:  return QTapAndHoldGesturePrivate::Timeout; | 0 | ||||||||||||||||||
| 334 | } | - | ||||||||||||||||||
| 335 | - | |||||||||||||||||||
| 336 | int QTapAndHoldGesturePrivate::Timeout = 700; | - | ||||||||||||||||||
| 337 | QGestureEvent::QGestureEvent(const QList<QGesture *> &gestures) | - | ||||||||||||||||||
| 338 | : QEvent(QEvent::Gesture), m_gestures(gestures), m_widget(0) | - | ||||||||||||||||||
| 339 | - | |||||||||||||||||||
| 340 | { | - | ||||||||||||||||||
| 341 | } never executed:  end of block | 0 | ||||||||||||||||||
| 342 | - | |||||||||||||||||||
| 343 | - | |||||||||||||||||||
| 344 | - | |||||||||||||||||||
| 345 | - | |||||||||||||||||||
| 346 | QGestureEvent::~QGestureEvent() | - | ||||||||||||||||||
| 347 | { | - | ||||||||||||||||||
| 348 | } | - | ||||||||||||||||||
| 349 | - | |||||||||||||||||||
| 350 | - | |||||||||||||||||||
| 351 | - | |||||||||||||||||||
| 352 | - | |||||||||||||||||||
| 353 | QList<QGesture *> QGestureEvent::gestures() const | - | ||||||||||||||||||
| 354 | { | - | ||||||||||||||||||
| 355 |     return never executed:   m_gestures;return m_gestures;never executed:  return m_gestures; | 0 | ||||||||||||||||||
| 356 | } | - | ||||||||||||||||||
| 357 | - | |||||||||||||||||||
| 358 | - | |||||||||||||||||||
| 359 | - | |||||||||||||||||||
| 360 | - | |||||||||||||||||||
| 361 | QGesture *QGestureEvent::gesture(Qt::GestureType type) const | - | ||||||||||||||||||
| 362 | { | - | ||||||||||||||||||
| 363 |     for (int i = 0; i < m_gestures.size()
  | 0 | ||||||||||||||||||
| 364 |         if (m_gestures.at(i)->gestureType() == type
  | 0 | ||||||||||||||||||
| 365 |             return never executed:   m_gestures.at(i);return m_gestures.at(i);never executed:  return m_gestures.at(i); | 0 | ||||||||||||||||||
| 366 |     return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||
| 367 | } | - | ||||||||||||||||||
| 368 | - | |||||||||||||||||||
| 369 | - | |||||||||||||||||||
| 370 | - | |||||||||||||||||||
| 371 | - | |||||||||||||||||||
| 372 | QList<QGesture *> QGestureEvent::activeGestures() const | - | ||||||||||||||||||
| 373 | { | - | ||||||||||||||||||
| 374 | QList<QGesture *> gestures; | - | ||||||||||||||||||
| 375 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(m_gestures)>::type> _container_((m_gestures)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGesture *gesture = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||
| 376 |         if (gesture->state() != Qt::GestureCanceled
  | 0 | ||||||||||||||||||
| 377 |             gestures.append(gesture); never executed:  gestures.append(gesture); | 0 | ||||||||||||||||||
| 378 |     } never executed:  end of block | 0 | ||||||||||||||||||
| 379 |     return never executed:   gestures;return gestures;never executed:  return gestures; | 0 | ||||||||||||||||||
| 380 | } | - | ||||||||||||||||||
| 381 | - | |||||||||||||||||||
| 382 | - | |||||||||||||||||||
| 383 | - | |||||||||||||||||||
| 384 | - | |||||||||||||||||||
| 385 | QList<QGesture *> QGestureEvent::canceledGestures() const | - | ||||||||||||||||||
| 386 | { | - | ||||||||||||||||||
| 387 | QList<QGesture *> gestures; | - | ||||||||||||||||||
| 388 | for (QForeachContainer<typename QtPrivate::remove_reference<decltype(m_gestures)>::type> _container_((m_gestures)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QGesture *gesture = *_container_.i; _container_.control; _container_.control = 0) { | - | ||||||||||||||||||
| 389 |         if (gesture->state() == Qt::GestureCanceled
  | 0 | ||||||||||||||||||
| 390 |             gestures.append(gesture); never executed:  gestures.append(gesture); | 0 | ||||||||||||||||||
| 391 |     } never executed:  end of block | 0 | ||||||||||||||||||
| 392 |     return never executed:   gestures;return gestures;never executed:  return gestures; | 0 | ||||||||||||||||||
| 393 | } | - | ||||||||||||||||||
| 394 | void QGestureEvent::setAccepted(QGesture *gesture, bool value) | - | ||||||||||||||||||
| 395 | { | - | ||||||||||||||||||
| 396 |     if (gesture
  | 0 | ||||||||||||||||||
| 397 |         setAccepted(gesture->gestureType(), value); never executed:  setAccepted(gesture->gestureType(), value); | 0 | ||||||||||||||||||
| 398 | } never executed:  end of block | 0 | ||||||||||||||||||
| 399 | void QGestureEvent::accept(QGesture *gesture) | - | ||||||||||||||||||
| 400 | { | - | ||||||||||||||||||
| 401 |     if (gesture
  | 0 | ||||||||||||||||||
| 402 |         setAccepted(gesture->gestureType(), true); never executed:  setAccepted(gesture->gestureType(), true); | 0 | ||||||||||||||||||
| 403 | } never executed:  end of block | 0 | ||||||||||||||||||
| 404 | void QGestureEvent::ignore(QGesture *gesture) | - | ||||||||||||||||||
| 405 | { | - | ||||||||||||||||||
| 406 |     if (gesture
  | 0 | ||||||||||||||||||
| 407 |         setAccepted(gesture->gestureType(), false); never executed:  setAccepted(gesture->gestureType(), false); | 0 | ||||||||||||||||||
| 408 | } never executed:  end of block | 0 | ||||||||||||||||||
| 409 | - | |||||||||||||||||||
| 410 | - | |||||||||||||||||||
| 411 | - | |||||||||||||||||||
| 412 | - | |||||||||||||||||||
| 413 | bool QGestureEvent::isAccepted(QGesture *gesture) const | - | ||||||||||||||||||
| 414 | { | - | ||||||||||||||||||
| 415 |     return never executed:   gesturereturn gesture ? isAccepted(gesture->gestureType()) : false;
 never executed:  return gesture ? isAccepted(gesture->gestureType()) : false; | 0 | ||||||||||||||||||
| 416 | } | - | ||||||||||||||||||
| 417 | void QGestureEvent::setAccepted(Qt::GestureType gestureType, bool value) | - | ||||||||||||||||||
| 418 | { | - | ||||||||||||||||||
| 419 | setAccepted(false); | - | ||||||||||||||||||
| 420 | m_accepted[gestureType] = value; | - | ||||||||||||||||||
| 421 | } never executed:  end of block | 0 | ||||||||||||||||||
| 422 | void QGestureEvent::accept(Qt::GestureType gestureType) | - | ||||||||||||||||||
| 423 | { | - | ||||||||||||||||||
| 424 | setAccepted(gestureType, true); | - | ||||||||||||||||||
| 425 | } never executed:  end of block | 0 | ||||||||||||||||||
| 426 | void QGestureEvent::ignore(Qt::GestureType gestureType) | - | ||||||||||||||||||
| 427 | { | - | ||||||||||||||||||
| 428 | setAccepted(gestureType, false); | - | ||||||||||||||||||
| 429 | } never executed:  end of block | 0 | ||||||||||||||||||
| 430 | - | |||||||||||||||||||
| 431 | - | |||||||||||||||||||
| 432 | - | |||||||||||||||||||
| 433 | - | |||||||||||||||||||
| 434 | - | |||||||||||||||||||
| 435 | bool QGestureEvent::isAccepted(Qt::GestureType gestureType) const | - | ||||||||||||||||||
| 436 | { | - | ||||||||||||||||||
| 437 |     return never executed:   m_accepted.value(gestureType, true);return m_accepted.value(gestureType, true);never executed:  return m_accepted.value(gestureType, true); | 0 | ||||||||||||||||||
| 438 | } | - | ||||||||||||||||||
| 439 | - | |||||||||||||||||||
| 440 | - | |||||||||||||||||||
| 441 | - | |||||||||||||||||||
| 442 | - | |||||||||||||||||||
| 443 | - | |||||||||||||||||||
| 444 | - | |||||||||||||||||||
| 445 | void QGestureEvent::setWidget(QWidget *widget) | - | ||||||||||||||||||
| 446 | { | - | ||||||||||||||||||
| 447 | m_widget = widget; | - | ||||||||||||||||||
| 448 | } never executed:  end of block | 0 | ||||||||||||||||||
| 449 | - | |||||||||||||||||||
| 450 | - | |||||||||||||||||||
| 451 | - | |||||||||||||||||||
| 452 | - | |||||||||||||||||||
| 453 | QWidget *QGestureEvent::widget() const | - | ||||||||||||||||||
| 454 | { | - | ||||||||||||||||||
| 455 |     return never executed:   m_widget;return m_widget;never executed:  return m_widget; | 0 | ||||||||||||||||||
| 456 | } | - | ||||||||||||||||||
| 457 | QPointF QGestureEvent::mapToGraphicsScene(const QPointF &gesturePoint) const | - | ||||||||||||||||||
| 458 | { | - | ||||||||||||||||||
| 459 | QWidget *w = widget(); | - | ||||||||||||||||||
| 460 |     if (w
  | 0 | ||||||||||||||||||
| 461 |         w = w->parentWidget(); never executed:  w = w->parentWidget(); | 0 | ||||||||||||||||||
| 462 | QGraphicsView *view = qobject_cast<QGraphicsView*>(w); | - | ||||||||||||||||||
| 463 |     if (view
  | 0 | ||||||||||||||||||
| 464 |         return never executed:   view->mapToScene(view->mapFromGlobal(gesturePoint.toPoint()));return view->mapToScene(view->mapFromGlobal(gesturePoint.toPoint()));never executed:  return view->mapToScene(view->mapFromGlobal(gesturePoint.toPoint())); | 0 | ||||||||||||||||||
| 465 | } | - | ||||||||||||||||||
| 466 |     return never executed:   QPointF();return QPointF();never executed:  return QPointF(); | 0 | ||||||||||||||||||
| 467 | } | - | ||||||||||||||||||
| 468 | - | |||||||||||||||||||
| 469 | - | |||||||||||||||||||
| 470 | - | |||||||||||||||||||
| 471 | - | |||||||||||||||||||
| 472 | static void formatGestureHeader(QDebug d, const char *className, const QGesture *gesture) | - | ||||||||||||||||||
| 473 | { | - | ||||||||||||||||||
| 474 | d << className << "(state="; | - | ||||||||||||||||||
| 475 | QtDebugUtils::formatQEnum(d, gesture->state()); | - | ||||||||||||||||||
| 476 |      if (gesture->hasHotSpot()
  | 0 | ||||||||||||||||||
| 477 | d << ",hotSpot="; | - | ||||||||||||||||||
| 478 | QtDebugUtils::formatQPoint(d, gesture->hotSpot()); | - | ||||||||||||||||||
| 479 |      } never executed:  end of block | 0 | ||||||||||||||||||
| 480 | } never executed:  end of block | 0 | ||||||||||||||||||
| 481 | - | |||||||||||||||||||
| 482 | __attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QGesture *gesture) | - | ||||||||||||||||||
| 483 | { | - | ||||||||||||||||||
| 484 | QDebugStateSaver saver(d); | - | ||||||||||||||||||
| 485 | d.nospace(); | - | ||||||||||||||||||
| 486 | switch (gesture->gestureType()) { | - | ||||||||||||||||||
| 487 |     case never executed:   Qt::TapGesture:case Qt::TapGesture:never executed:  case Qt::TapGesture: | 0 | ||||||||||||||||||
| 488 | formatGestureHeader(d, "QTapGesture", gesture); | - | ||||||||||||||||||
| 489 | d << ",position="; | - | ||||||||||||||||||
| 490 | QtDebugUtils::formatQPoint(d, static_cast<const QTapGesture*>(gesture)->position()); | - | ||||||||||||||||||
| 491 | d << ')'; | - | ||||||||||||||||||
| 492 |         break; never executed:  break; | 0 | ||||||||||||||||||
| 493 |     case never executed:   Qt::TapAndHoldGesture:case Qt::TapAndHoldGesture:never executed:   {case Qt::TapAndHoldGesture: | 0 | ||||||||||||||||||
| 494 | const QTapAndHoldGesture *tap = static_cast<const QTapAndHoldGesture*>(gesture); | - | ||||||||||||||||||
| 495 | formatGestureHeader(d, "QTapAndHoldGesture", tap); | - | ||||||||||||||||||
| 496 | d << ",position="; | - | ||||||||||||||||||
| 497 | QtDebugUtils::formatQPoint(d, tap->position()); | - | ||||||||||||||||||
| 498 | d << ",timeout=" << tap->timeout() << ')'; | - | ||||||||||||||||||
| 499 | } | - | ||||||||||||||||||
| 500 |         break; never executed:  break; | 0 | ||||||||||||||||||
| 501 |     case never executed:   Qt::PanGesture:case Qt::PanGesture:never executed:   {case Qt::PanGesture: | 0 | ||||||||||||||||||
| 502 | const QPanGesture *pan = static_cast<const QPanGesture*>(gesture); | - | ||||||||||||||||||
| 503 | formatGestureHeader(d, "QPanGesture", pan); | - | ||||||||||||||||||
| 504 | d << ",lastOffset="; | - | ||||||||||||||||||
| 505 | QtDebugUtils::formatQPoint(d, pan->lastOffset()); | - | ||||||||||||||||||
| 506 | d << pan->lastOffset(); | - | ||||||||||||||||||
| 507 | d << ",offset="; | - | ||||||||||||||||||
| 508 | QtDebugUtils::formatQPoint(d, pan->offset()); | - | ||||||||||||||||||
| 509 | d << ",acceleration=" << pan->acceleration() << ",delta="; | - | ||||||||||||||||||
| 510 | QtDebugUtils::formatQPoint(d, pan->delta()); | - | ||||||||||||||||||
| 511 | d << ')'; | - | ||||||||||||||||||
| 512 | } | - | ||||||||||||||||||
| 513 |         break; never executed:  break; | 0 | ||||||||||||||||||
| 514 |     case never executed:   Qt::PinchGesture:case Qt::PinchGesture:never executed:   {case Qt::PinchGesture: | 0 | ||||||||||||||||||
| 515 | const QPinchGesture *pinch = static_cast<const QPinchGesture*>(gesture); | - | ||||||||||||||||||
| 516 | formatGestureHeader(d, "QPinchGesture", pinch); | - | ||||||||||||||||||
| 517 | d << ",totalChangeFlags=" << pinch->totalChangeFlags() | - | ||||||||||||||||||
| 518 | << ",changeFlags=" << pinch->changeFlags() << ",startCenterPoint="; | - | ||||||||||||||||||
| 519 | QtDebugUtils::formatQPoint(d, pinch->startCenterPoint()); | - | ||||||||||||||||||
| 520 | d << ",lastCenterPoint="; | - | ||||||||||||||||||
| 521 | QtDebugUtils::formatQPoint(d, pinch->lastCenterPoint()); | - | ||||||||||||||||||
| 522 | d << ",centerPoint="; | - | ||||||||||||||||||
| 523 | QtDebugUtils::formatQPoint(d, pinch->centerPoint()); | - | ||||||||||||||||||
| 524 | d << ",totalScaleFactor=" << pinch->totalScaleFactor() | - | ||||||||||||||||||
| 525 | << ",lastScaleFactor=" << pinch->lastScaleFactor() | - | ||||||||||||||||||
| 526 | << ",scaleFactor=" << pinch->scaleFactor() | - | ||||||||||||||||||
| 527 | << ",totalRotationAngle=" << pinch->totalRotationAngle() | - | ||||||||||||||||||
| 528 | << ",lastRotationAngle=" << pinch->lastRotationAngle() | - | ||||||||||||||||||
| 529 | << ",rotationAngle=" << pinch->rotationAngle() << ')'; | - | ||||||||||||||||||
| 530 | } | - | ||||||||||||||||||
| 531 |         break; never executed:  break; | 0 | ||||||||||||||||||
| 532 |     case never executed:   Qt::SwipeGesture:case Qt::SwipeGesture:never executed:   {case Qt::SwipeGesture: | 0 | ||||||||||||||||||
| 533 | const QSwipeGesture *swipe = static_cast<const QSwipeGesture*>(gesture); | - | ||||||||||||||||||
| 534 | formatGestureHeader(d, "QSwipeGesture", swipe); | - | ||||||||||||||||||
| 535 | d << ",horizontalDirection="; | - | ||||||||||||||||||
| 536 | QtDebugUtils::formatQEnum(d, swipe->horizontalDirection()); | - | ||||||||||||||||||
| 537 | d << ",verticalDirection="; | - | ||||||||||||||||||
| 538 | QtDebugUtils::formatQEnum(d, swipe->verticalDirection()); | - | ||||||||||||||||||
| 539 | d << ",swipeAngle=" << swipe->swipeAngle() << ')'; | - | ||||||||||||||||||
| 540 | } | - | ||||||||||||||||||
| 541 |         break; never executed:  break; | 0 | ||||||||||||||||||
| 542 |     default never executed:  :default:never executed:  default: | 0 | ||||||||||||||||||
| 543 | formatGestureHeader(d, "Custom gesture", gesture); | - | ||||||||||||||||||
| 544 | d << ",type=" << gesture->gestureType() << ')'; | - | ||||||||||||||||||
| 545 |         break; never executed:  break; | 0 | ||||||||||||||||||
| 546 | } | - | ||||||||||||||||||
| 547 |     return never executed:   d;return d;never executed:  return d; | 0 | ||||||||||||||||||
| 548 | } | - | ||||||||||||||||||
| 549 | - | |||||||||||||||||||
| 550 | __attribute__((visibility("default"))) QDebug operator<<(QDebug d, const QGestureEvent *gestureEvent) | - | ||||||||||||||||||
| 551 | { | - | ||||||||||||||||||
| 552 | QDebugStateSaver saver(d); | - | ||||||||||||||||||
| 553 | d.nospace(); | - | ||||||||||||||||||
| 554 | d << "QGestureEvent(" << gestureEvent->gestures() << ')'; | - | ||||||||||||||||||
| 555 |     return never executed:   d;return d;never executed:  return d; | 0 | ||||||||||||||||||
| 556 | } | - | ||||||||||||||||||
| 557 | - | |||||||||||||||||||
| 558 | - | |||||||||||||||||||
| 559 | - | |||||||||||||||||||
| 560 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |