8#include "MarbleInputHandler.h"
11#include <QGestureEvent>
13#include <QPinchGesture>
19#include "AbstractDataPluginItem.h"
20#include "AbstractFloatItem.h"
22#include "MarbleAbstractPresenter.h"
23#include "MarbleDebug.h"
24#include "MarbleGlobal.h"
26#include "RenderPlugin.h"
28#include "kineticmodel.h"
33const int TOOLTIP_START_INTERVAL = 1000;
35class Q_DECL_HIDDEN MarbleInputHandler::Protected
38 Protected(MarbleAbstractPresenter *marblePresenter);
40 MarbleAbstractPresenter *
const m_marblePresenter;
41 bool m_positionSignalConnected;
44 qreal m_wheelZoomTargetDistance;
45 bool m_panViaArrowsEnabled;
46 bool m_inertialEarthRotation;
47 bool m_mouseViewRotation;
49 const int m_discreteZoomSteps = 120;
52MarbleInputHandler::Protected::Protected(MarbleAbstractPresenter *marblePresenter)
53 : m_marblePresenter(marblePresenter)
54 , m_positionSignalConnected(false)
55 , m_mouseWheelTimer(nullptr)
57 , m_wheelZoomTargetDistance(0.0)
58 , m_panViaArrowsEnabled(true)
59 , m_inertialEarthRotation(true)
60 , m_mouseViewRotation(true)
65MarbleInputHandler::MarbleInputHandler(MarbleAbstractPresenter *marblePresenter)
66 : d(new Protected(marblePresenter))
68 d->m_mouseWheelTimer =
new QTimer(
this);
71 connect(d->m_marblePresenter->map(), SIGNAL(renderPluginInitialized(RenderPlugin *)),
this, SLOT(installPluginEventFilter(RenderPlugin *)));
74MarbleInputHandler::~MarbleInputHandler()
76 delete d->m_mouseWheelTimer;
80void MarbleInputHandler::setPositionSignalConnected(
bool connected)
82 d->m_positionSignalConnected = connected;
85bool MarbleInputHandler::isPositionSignalConnected()
const
87 return d->m_positionSignalConnected;
90void MarbleInputHandler::setMouseButtonPopupEnabled(
Qt::MouseButton mouseButton,
bool enabled)
93 d->m_disabledMouseButtons &=
~Qt::MouseButtons(mouseButton);
95 d->m_disabledMouseButtons |= mouseButton;
99bool MarbleInputHandler::isMouseButtonPopupEnabled(
Qt::MouseButton mouseButton)
const
101 return !(d->m_disabledMouseButtons & mouseButton);
104void MarbleInputHandler::setPanViaArrowsEnabled(
bool enabled)
106 d->m_panViaArrowsEnabled = enabled;
109bool MarbleInputHandler::panViaArrowsEnabled()
const
111 return d->m_panViaArrowsEnabled;
114void MarbleInputHandler::setInertialEarthRotationEnabled(
bool enabled)
116 d->m_inertialEarthRotation = enabled;
119bool MarbleInputHandler::inertialEarthRotationEnabled()
const
121 return d->m_inertialEarthRotation;
124void MarbleInputHandler::setMouseViewRotationEnabled(
bool enabled)
126 d->m_mouseViewRotation = enabled;
129bool MarbleInputHandler::mouseViewRotationEnabled()
const
131 return d->m_mouseViewRotation;
134void MarbleInputHandler::stopInertialEarthRotation()
138class Q_DECL_HIDDEN MarbleDefaultInputHandler::Private
165 int m_startingRadius;
179 qreal m_leftPressedLon;
181 qreal m_leftPressedLat;
185 QTimer m_pressAndHoldTimer;
188 KineticModel m_kineticSpinning;
197MarbleDefaultInputHandler::Private::Private()
198 : m_leftPressed(false)
199 , m_midPressed(false)
200 , m_rightPressed(false)
202 , m_dragThreshold(MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen ? 15 : 3)
204 m_curpmtl.load(QStringLiteral(
":/marble/cursor/tl.png"));
205 m_curpmtc.load(QStringLiteral(
":/marble/cursor/tc.png"));
206 m_curpmtr.load(QStringLiteral(
":/marble/cursor/tr.png"));
207 m_curpmcr.load(QStringLiteral(
":/marble/cursor/cr.png"));
208 m_curpmcl.load(QStringLiteral(
":/marble/cursor/cl.png"));
209 m_curpmbl.load(QStringLiteral(
":/marble/cursor/bl.png"));
210 m_curpmbc.load(QStringLiteral(
":/marble/cursor/bc.png"));
211 m_curpmbr.load(QStringLiteral(
":/marble/cursor/br.png"));
213 m_arrowCur[0][0] =
QCursor(m_curpmtl, 2, 2);
214 m_arrowCur[1][0] =
QCursor(m_curpmtc, 10, 3);
215 m_arrowCur[2][0] =
QCursor(m_curpmtr, 19, 2);
216 m_arrowCur[0][1] =
QCursor(m_curpmcl, 3, 10);
218 m_arrowCur[2][1] =
QCursor(m_curpmcr, 18, 10);
219 m_arrowCur[0][2] =
QCursor(m_curpmbl, 2, 19);
220 m_arrowCur[1][2] =
QCursor(m_curpmbc, 11, 18);
221 m_arrowCur[2][2] =
QCursor(m_curpmbr, 19, 19);
224MarbleDefaultInputHandler::Private::~Private() =
default;
226MarbleDefaultInputHandler::MarbleDefaultInputHandler(MarbleAbstractPresenter *marblePresenter)
227 : MarbleInputHandler(marblePresenter)
230 d->m_toolTipTimer.setSingleShot(
true);
231 d->m_toolTipTimer.setInterval(TOOLTIP_START_INTERVAL);
232 connect(&d->m_toolTipTimer, SIGNAL(timeout()),
this, SLOT(openItemToolTip()));
233 d->m_lmbTimer.setSingleShot(
true);
234 connect(&d->m_lmbTimer, SIGNAL(timeout()),
this, SLOT(lmbTimeout()));
236 d->m_kineticSpinning.setUpdateInterval(35);
237 connect(&d->m_kineticSpinning, SIGNAL(positionChanged(qreal, qreal)), MarbleInputHandler::d->m_marblePresenter, SLOT(centerOn(qreal, qreal)));
238 connect(&d->m_kineticSpinning, SIGNAL(headingChanged(qreal)), MarbleInputHandler::d->m_marblePresenter, SLOT(headingOn(qreal)));
239 connect(&d->m_kineticSpinning, SIGNAL(finished()), SLOT(restoreViewContext()));
242 connect(
this, SIGNAL(rmbRequest(
int,
int)),
this, SLOT(showRmbMenu(
int,
int)));
243 connect(
this, SIGNAL(lmbRequest(
int,
int)),
this, SLOT(showLmbMenu(
int,
int)));
245 d->m_pressAndHoldTimer.setInterval(800);
246 d->m_pressAndHoldTimer.setSingleShot(
true);
247 connect(&d->m_pressAndHoldTimer, SIGNAL(timeout()),
this, SLOT(handlePressAndHold()));
250MarbleDefaultInputHandler::~MarbleDefaultInputHandler()
255void MarbleDefaultInputHandler::stopInertialEarthRotation()
257 d->m_kineticSpinning.stop();
260void MarbleDefaultInputHandler::lmbTimeout()
262 if (!selectionRubber()->isVisible()) {
263 qreal clickedLon = 0;
264 qreal clickedLat = 0;
266 bool isPointOnGlobe = MarbleInputHandler::d->m_marblePresenter->map()->geoCoordinates(d->m_leftPressedX,
270 GeoDataCoordinates::Degree);
271 Q_EMIT lmbRequest(d->m_leftPressedX, d->m_leftPressedY);
277 if (isPointOnGlobe) {
278 Q_EMIT mouseClickGeoPosition(clickedLon, clickedLat, GeoDataCoordinates::Degree);
283void MarbleInputHandler::restoreViewContext()
286 d->m_mouseWheelTimer->stop();
289 d->m_marblePresenter->setViewContext(Still);
290 d->m_marblePresenter->map()->viewport()->resetFocusPoint();
291 d->m_wheelZoomTargetDistance = 0.0;
294void MarbleDefaultInputHandler::hideSelectionIfCtrlReleased(
QEvent *e)
299 selectionRubber()->hide();
304bool MarbleDefaultInputHandler::handleDoubleClick(
QMouseEvent *event)
308 const bool isMouseAboveMap =
309 MarbleInputHandler::d->m_marblePresenter->map()->geoCoordinates(
event->x(),
event->y(), mouseLon, mouseLat, GeoDataCoordinates::Radian);
310 if (isMouseAboveMap) {
311 d->m_pressAndHoldTimer.stop();
312 d->m_lmbTimer.stop();
313 MarbleInputHandler::d->m_marblePresenter->moveTo(
event->pos(), 0.67);
315 return acceptMouse();
318bool MarbleDefaultInputHandler::handleWheel(
QWheelEvent *wheelevt)
320 MarbleAbstractPresenter *marblePresenter = MarbleInputHandler::d->m_marblePresenter;
321 marblePresenter->setViewContext(Animation);
323 if ((MarbleInputHandler::d->m_steps > 0 && wheelevt->
angleDelta().
y() < 0) || (MarbleInputHandler::d->m_steps < 0 && wheelevt->
angleDelta().
y() > 0)) {
324 MarbleInputHandler::d->m_steps = wheelevt->
angleDelta().
y();
326 MarbleInputHandler::d->m_steps += wheelevt->
angleDelta().
y();
329 if (marblePresenter->map()->discreteZoom()) {
330 if (qAbs(MarbleInputHandler::d->m_steps) >= MarbleInputHandler::d->m_discreteZoomSteps) {
331 marblePresenter->zoomAtBy(wheelevt->
position().
toPoint(), MarbleInputHandler::d->m_steps);
332 MarbleInputHandler::d->m_steps = 0;
335 qreal
zoom = marblePresenter->zoom();
336 qreal target = MarbleInputHandler::d->m_wheelZoomTargetDistance;
337 if (marblePresenter->animationsEnabled() && target > 0.0) {
339 zoom = marblePresenter->zoomFromDistance(target);
341 qreal newDistance = marblePresenter->distanceFromZoom(zoom + MarbleInputHandler::d->m_steps);
342 MarbleInputHandler::d->m_wheelZoomTargetDistance = newDistance;
344 if (MarbleInputHandler::d->m_inertialEarthRotation) {
345 d->m_kineticSpinning.jumpToPosition(MarbleInputHandler::d->m_marblePresenter->centerLongitude(),
346 MarbleInputHandler::d->m_marblePresenter->centerLatitude());
348 MarbleInputHandler::d->m_steps = 0;
351 MarbleInputHandler::d->m_mouseWheelTimer->start(400);
360 MarbleAbstractPresenter *marblePresenter = MarbleInputHandler::d->m_marblePresenter;
362 bool isValid = marblePresenter->map()->geoCoordinates(
center.x(),
center.y(), destLon, destLat, GeoDataCoordinates::Radian);
365 marblePresenter->map()->viewport()->setFocusPoint(GeoDataCoordinates(destLon, destLat));
368 qreal
zoom, target, newDistance;
370 qreal zoomDelta = scaleFactor > 1.0 ? scaleFactor : -1.0 / scaleFactor;
376 marblePresenter->setViewContext(Animation);
377 d->m_pressAndHoldTimer.stop();
378 d->m_lmbTimer.stop();
379 d->m_midPressed =
false;
380 d->m_leftPressed =
false;
383 zoom = marblePresenter->zoom();
384 target = MarbleInputHandler::d->m_wheelZoomTargetDistance;
385 if (marblePresenter->animationsEnabled() && target > 0.0) {
387 zoom = marblePresenter->zoomFromDistance(target);
389 newDistance = marblePresenter->distanceFromZoom(zoom + 20 * zoomDelta);
390 MarbleInputHandler::d->m_wheelZoomTargetDistance = newDistance;
391 marblePresenter->zoomAt(
center.toPoint(), newDistance);
394 marblePresenter->map()->viewport()->resetFocusPoint();
395 marblePresenter->setViewContext(Still);
398 marblePresenter->map()->viewport()->resetFocusPoint();
399 marblePresenter->setViewContext(Still);
405bool MarbleDefaultInputHandler::handleGesture(
QGestureEvent *ge)
412 qreal scaleFactor = pinch->scaleFactor();
415 return handlePinch(center, scaleFactor, pinch->state());
418void MarbleDefaultInputHandler::checkReleasedMove(
QMouseEvent *event)
422 if (d->m_leftPressed) {
423 d->m_leftPressed =
false;
425 if (MarbleInputHandler::d->m_inertialEarthRotation) {
426 d->m_kineticSpinning.start();
428 MarbleInputHandler::d->m_marblePresenter->setViewContext(Still);
433 d->m_midPressed =
false;
437void MarbleDefaultInputHandler::handleMouseButtonPress(
QMouseEvent *event)
440 d->m_pressAndHoldTimer.start();
441 handleLeftMouseButtonPress(event);
445 handleMiddleMouseButtonPress(event);
449 handleRightMouseButtonPress(event);
453void MarbleDefaultInputHandler::handleLeftMouseButtonPress(
QMouseEvent *event)
456 MarbleInputHandler::d->m_marblePresenter->map()->blockSignals(
true);
457 MarbleInputHandler::d->m_marblePresenter->setViewContext(Animation);
458 MarbleInputHandler::d->m_marblePresenter->map()->blockSignals(
false);
461 d->m_lmbTimer.start(400);
464 d->m_leftPressed =
true;
465 d->m_midPressed =
false;
466 selectionRubber()->hide();
472 d->m_leftPressedX =
event->x();
473 d->m_leftPressedY =
event->y();
476 d->m_leftPressedLon = MarbleInputHandler::d->m_marblePresenter->centerLongitude();
477 d->m_leftPressedLat = MarbleInputHandler::d->m_marblePresenter->centerLatitude();
479 if (MarbleInputHandler::d->m_inertialEarthRotation) {
480 d->m_kineticSpinning.stop();
481 d->m_kineticSpinning.setPosition(d->m_leftPressedLon, d->m_leftPressedLat);
485 mDebug() <<
"Starting selection";
486 d->m_pressAndHoldTimer.stop();
487 d->m_lmbTimer.stop();
488 d->m_selectionOrigin =
event->pos();
489 selectionRubber()->setGeometry(
QRect(d->m_selectionOrigin,
QSize()));
490 selectionRubber()->show();
494void MarbleDefaultInputHandler::handleMiddleMouseButtonPress(
QMouseEvent *event)
496 d->m_midPressed =
true;
497 d->m_leftPressed =
false;
498 d->m_startingRadius = MarbleInputHandler::d->m_marblePresenter->radius();
499 d->m_midPressedY =
event->y();
501 if (MarbleInputHandler::d->m_inertialEarthRotation) {
502 d->m_kineticSpinning.start();
505 selectionRubber()->hide();
506 MarbleInputHandler::d->m_marblePresenter->setViewContext(Animation);
509void MarbleDefaultInputHandler::handleRightMouseButtonPress(
QMouseEvent *event)
511 d->m_rightPressed =
true;
512 d->m_rightOrigin =
event->pos();
513 d->m_rightPosition =
event->pos();
514 d->m_heading = MarbleInputHandler::d->m_marblePresenter->map()->heading();
515 if (MarbleInputHandler::d->m_inertialEarthRotation) {
516 d->m_kineticSpinning.stop();
517 d->m_kineticSpinning.setHeading(d->m_heading);
521void MarbleDefaultInputHandler::handleMouseButtonRelease(
QMouseEvent *event)
524 d->m_pressAndHoldTimer.stop();
527 Q_EMIT mouseClickScreenPosition(d->m_leftPressedX, d->m_leftPressedY);
529 d->m_leftPressed =
false;
530 if (MarbleInputHandler::d->m_inertialEarthRotation) {
531 d->m_kineticSpinning.start();
533 MarbleInputHandler::d->m_marblePresenter->setViewContext(Still);
538 d->m_midPressed =
false;
540 MarbleInputHandler::d->m_marblePresenter->setViewContext(Still);
544 if (d->m_rightOrigin ==
event->pos()) {
547 d->m_rightPressed =
false;
549 if (MarbleInputHandler::d->m_inertialEarthRotation) {
550 d->m_kineticSpinning.start();
552 MarbleInputHandler::d->m_marblePresenter->setViewContext(Still);
557 mDebug() <<
"Leaving selection";
558 MarbleInputHandler::d->m_marblePresenter->setSelection(selectionRubber()->geometry());
559 selectionRubber()->hide();
563void MarbleDefaultInputHandler::notifyPosition(
bool isMouseAboveMap, qreal mouseLon, qreal mouseLat)
566 if (MarbleInputHandler::d->m_positionSignalConnected) {
567 if (!isMouseAboveMap) {
570 QString position = GeoDataCoordinates(mouseLon, mouseLat).toString();
571 Q_EMIT mouseMoveGeoPosition(position);
576void MarbleDefaultInputHandler::adjustCursorShape(
const QPoint &mousePosition,
const QPoint &mouseDirection)
580 bool dataAction =
false;
584 for (; it !=
end && dataAction ==
false && toolTipItem.
isNull(); ++it) {
585 if ((*it)->action()) {
589 if (!(*it)->toolTip().isNull() && toolTipItem.
isNull()) {
594 if (toolTipItem.
isNull()) {
595 d->m_toolTipTimer.stop();
596 }
else if (!(d->m_lastToolTipItem.data() == toolTipItem.
data())) {
597 d->m_toolTipTimer.start();
598 d->m_lastToolTipItem = toolTipItem;
599 d->m_toolTipPosition = mousePosition;
601 if (!d->m_toolTipTimer.isActive()) {
602 d->m_toolTipTimer.start();
604 d->m_toolTipPosition = mousePosition;
607 if (!dataAction && !MarbleInputHandler::d->m_marblePresenter->map()->hasFeatureAt(mousePosition)) {
608 if (!d->m_leftPressed) {
614 if (!d->m_leftPressed) {
619 if (panViaArrowsEnabled()) {
620 setCursor(d->m_arrowCur[mouseDirection.
x() + 1][mouseDirection.
y() + 1]);
622 setCursor(d->m_arrowCur[1][1]);
630 int polarity = MarbleInputHandler::d->m_marblePresenter->viewport()->polarity();
632 if (d->m_leftPressed) {
633 d->m_leftPressed =
false;
635 if (MarbleInputHandler::d->m_inertialEarthRotation) {
636 d->m_kineticSpinning.start();
640 QRect boundingRect = MarbleInputHandler::d->m_marblePresenter->viewport()->mapRegion().boundingRect();
642 if (boundingRect.
width() != 0) {
643 dirX = (int)(3 * (
event->x() - boundingRect.
left()) / boundingRect.
width()) - 1;
652 if (boundingRect.
height() != 0) {
653 dirY = (int)(3 * (
event->y() - boundingRect.
top()) / boundingRect.
height()) - 1;
663 d->m_pressAndHoldTimer.stop();
664 d->m_lmbTimer.stop();
665 qreal moveStep = MarbleInputHandler::d->m_marblePresenter->moveStep();
667 MarbleInputHandler::d->m_marblePresenter->rotateBy(-moveStep * (qreal)(+dirX), moveStep * (qreal)(+dirY));
669 MarbleInputHandler::d->m_marblePresenter->rotateBy(-moveStep * (qreal)(-dirX), moveStep * (qreal)(+dirY));
673 if (!MarbleInputHandler::d->m_inertialEarthRotation) {
674 MarbleInputHandler::d->m_marblePresenter->setViewContext(Still);
680bool MarbleDefaultInputHandler::handleMouseEvent(
QMouseEvent *event)
684 checkReleasedMove(event);
690 auto const floatItems = MarbleInputHandler::d->m_marblePresenter->map()->floatItems();
691 for (AbstractFloatItem *floatItem : floatItems) {
692 if (floatItem->enabled() && floatItem->visible() && floatItem->contains(
event->pos())) {
693 d->m_pressAndHoldTimer.stop();
694 d->m_lmbTimer.stop();
702 const bool isMouseAboveMap =
703 MarbleInputHandler::d->m_marblePresenter->map()->geoCoordinates(
event->x(),
event->y(), mouseLon, mouseLat, GeoDataCoordinates::Radian);
704 notifyPosition(isMouseAboveMap, mouseLon, mouseLat);
708 if (isMouseAboveMap || selectionRubber()->isVisible() || MarbleInputHandler::d->m_marblePresenter->map()->hasFeatureAt(mousePosition)) {
710 handleMouseButtonPress(event);
714 handleMouseButtonRelease(event);
717 const bool supportsViewportRotation = MarbleInputHandler::d->m_marblePresenter->map()->projection() ==
Spherical;
720 if (d->m_leftPressed && !selectionRubber()->isVisible()) {
721 auto radius = (qreal)(MarbleInputHandler::d->m_marblePresenter->radius());
722 qreal deltax =
event->x() - d->m_leftPressedX;
723 qreal deltay =
event->y() - d->m_leftPressedY;
725 if (qAbs(deltax) > d->m_dragThreshold || qAbs(deltay) > d->m_dragThreshold || !d->m_lmbTimer.isActive()) {
726 MarbleInputHandler::d->m_marblePresenter->setViewContext(Animation);
728 d->m_pressAndHoldTimer.stop();
729 d->m_lmbTimer.stop();
730 Quaternion quat = Quaternion::fromSpherical(-M_PI / 2 * deltax / radius, +M_PI / 2 * deltay / radius);
731 if (supportsViewportRotation) {
732 const qreal heading = MarbleInputHandler::d->m_marblePresenter->map()->heading();
733 const Quaternion rotation = Quaternion::fromEuler(0, 0, heading * DEG2RAD);
734 quat.rotateAroundAxis(rotation);
737 quat.getSpherical(lon, lat);
738 const qreal posLon = d->m_leftPressedLon + RAD2DEG * lon;
739 const qreal posLat = d->m_leftPressedLat + RAD2DEG * lat;
740 MarbleInputHandler::d->m_marblePresenter->centerOn(posLon, posLat);
741 if (MarbleInputHandler::d->m_inertialEarthRotation) {
742 d->m_kineticSpinning.setPosition(posLon, posLat);
747 if (d->m_midPressed) {
748 int eventy =
event->y();
749 int dy = d->m_midPressedY - eventy;
750 MarbleInputHandler::d->m_marblePresenter->setRadius(d->m_startingRadius * pow(1.005, dy));
753 if (d->m_rightPressed && supportsViewportRotation && MarbleInputHandler::d->m_mouseViewRotation) {
754 qreal centerX, centerY;
755 MarbleInputHandler::d->m_marblePresenter->map()->screenCoordinates(MarbleInputHandler::d->m_marblePresenter->centerLongitude(),
756 MarbleInputHandler::d->m_marblePresenter->centerLatitude(),
761 int dx =
event->x() - d->m_rightPosition.x();
762 int dy =
event->y() - d->m_rightPosition.y();
764 d->m_rightPosition =
event->pos();
767 int sign =
event->y() > centerY ? -1 : 1;
769 if ((
event->x() < centerX &&
event->y() < centerY) || (
event->x() > centerX &&
event->y() > centerY)) {
773 const qreal speedFactor = 0.3;
774 d->m_heading += (dx + dy) * sign * speedFactor;
775 MarbleInputHandler::d->m_marblePresenter->map()->setHeading(d->m_heading);
776 if (MarbleInputHandler::d->m_inertialEarthRotation) {
777 d->m_kineticSpinning.setHeading(d->m_heading);
781 if (selectionRubber()->isVisible()) {
786 direction = mouseMovedOutside(event);
789 if (MarbleInputHandler::d->m_marblePresenter->viewContext() != Animation) {
790 adjustCursorShape(mousePosition, direction);
792 return acceptMouse();
795bool MarbleDefaultInputHandler::acceptMouse()
803bool MarbleDefaultInputHandler::eventFilter(
QObject *o,
QEvent *e)
807 if (layersEventFilter(o, e)) {
811 hideSelectionIfCtrlReleased(e);
819 return handleKeyPress(
static_cast<QKeyEvent *
>(e));
825 return handleDoubleClick(
static_cast<QMouseEvent *
>(e));
829 return handleMouseEvent(
static_cast<QMouseEvent *
>(e));
835bool MarbleDefaultInputHandler::handleTouch(
QTouchEvent *)
840bool MarbleDefaultInputHandler::handleKeyPress(
QKeyEvent *event)
843 MarbleAbstractPresenter *marblePresenter = MarbleInputHandler::d->m_marblePresenter;
845 switch (
event->key()) {
847 stopInertialEarthRotation();
851 stopInertialEarthRotation();
855 stopInertialEarthRotation();
859 stopInertialEarthRotation();
864 stopInertialEarthRotation();
865 marblePresenter->zoomIn();
870 stopInertialEarthRotation();
871 marblePresenter->zoomOut();
875 stopInertialEarthRotation();
876 marblePresenter->goHome();
888void MarbleDefaultInputHandler::handleMouseButtonPressAndHold(
const QPoint &)
893void MarbleDefaultInputHandler::handlePressAndHold()
895 handleMouseButtonPressAndHold(
QPoint(d->m_leftPressedX, d->m_leftPressedY));
898const AbstractDataPluginItem *MarbleDefaultInputHandler::lastToolTipItem()
const
900 return d->m_lastToolTipItem;
903QTimer *MarbleDefaultInputHandler::toolTipTimer()
905 return &d->m_toolTipTimer;
908QPoint MarbleDefaultInputHandler::toolTipPosition()
const
910 return d->m_toolTipPosition;
915#include "moc_MarbleInputHandler.cpp"
This file contains the headers for AbstractProjection.
This file contains the headers for MarbleMap.
This file contains the headers for ViewportParams.
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
bool isValid(QStringView ifopt)
QAction * zoom(const QObject *recvr, const char *slot, QObject *parent)
const QList< QKeySequence > & end()
Binds a QML item to a specific geodetic location in screen coordinates.
@ Linear
Linear interpolation of lon, lat and distance to ground.
@ Spherical
Spherical projection ("Orthographic")
QString translate(const char *context, const char *sourceText, const char *disambiguation, int n)
QGesture * gesture(Qt::GestureType type) const const
bool isNull() const const
QPoint toPoint() const const
QRect normalized() const const
QPointF position() const const
QTextStream & center(QTextStream &stream)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
QPoint angleDelta() const const