8#include "MarbleInputHandler.h"
16#include <QGestureEvent>
17#include <QPinchGesture>
19#include "kineticmodel.h"
20#include "MarbleGlobal.h"
21#include "MarbleDebug.h"
23#include "MarbleAbstractPresenter.h"
25#include "AbstractFloatItem.h"
26#include "AbstractDataPluginItem.h"
28#include "RenderPlugin.h"
32const int TOOLTIP_START_INTERVAL = 1000;
34class Q_DECL_HIDDEN MarbleInputHandler::Protected
37 Protected(MarbleAbstractPresenter *marblePresenter);
39 MarbleAbstractPresenter *
const m_marblePresenter;
40 bool m_positionSignalConnected;
43 qreal m_wheelZoomTargetDistance;
44 bool m_panViaArrowsEnabled;
45 bool m_inertialEarthRotation;
46 bool m_mouseViewRotation;
48 const int m_discreteZoomSteps = 120;
51MarbleInputHandler::Protected::Protected(MarbleAbstractPresenter *marblePresenter)
52 : m_marblePresenter( marblePresenter ),
53 m_positionSignalConnected( false ),
54 m_mouseWheelTimer( nullptr ),
56 m_wheelZoomTargetDistance( 0.0 ),
57 m_panViaArrowsEnabled( true ),
58 m_inertialEarthRotation( true ),
59 m_mouseViewRotation( true ),
64MarbleInputHandler::MarbleInputHandler(MarbleAbstractPresenter *marblePresenter)
65 : d(new Protected(marblePresenter))
67 d->m_mouseWheelTimer =
new QTimer(
this );
68 connect(d->m_mouseWheelTimer, SIGNAL(timeout()),
this, SLOT(restoreViewContext()));
70 connect(d->m_marblePresenter->map(), SIGNAL(renderPluginInitialized(RenderPlugin*)),
71 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)
94 d->m_disabledMouseButtons &=
~Qt::MouseButtons(mouseButton);
98 d->m_disabledMouseButtons |= mouseButton;
102bool MarbleInputHandler::isMouseButtonPopupEnabled(
Qt::MouseButton mouseButton)
const
104 return !(d->m_disabledMouseButtons & mouseButton);
107void MarbleInputHandler::setPanViaArrowsEnabled(
bool enabled)
109 d->m_panViaArrowsEnabled = enabled;
112bool MarbleInputHandler::panViaArrowsEnabled()
const
114 return d->m_panViaArrowsEnabled;
117void MarbleInputHandler::setInertialEarthRotationEnabled(
bool enabled)
119 d->m_inertialEarthRotation = enabled;
122bool MarbleInputHandler::inertialEarthRotationEnabled()
const
124 return d->m_inertialEarthRotation;
127void MarbleInputHandler::setMouseViewRotationEnabled(
bool enabled)
129 d->m_mouseViewRotation = enabled;
132bool MarbleInputHandler::mouseViewRotationEnabled()
const
134 return d->m_mouseViewRotation;
137void MarbleInputHandler::stopInertialEarthRotation()
141class Q_DECL_HIDDEN MarbleDefaultInputHandler::Private
168 int m_startingRadius;
182 qreal m_leftPressedLon;
184 qreal m_leftPressedLat;
188 QTimer m_pressAndHoldTimer;
191 KineticModel m_kineticSpinning;
200MarbleDefaultInputHandler::Private::Private()
201 : m_leftPressed(false),
203 m_rightPressed(false),
205 m_dragThreshold(MarbleGlobal::getInstance()->profiles() & MarbleGlobal::SmallScreen ? 15 : 3)
207 m_curpmtl.load(QStringLiteral(
":/marble/cursor/tl.png"));
208 m_curpmtc.load(QStringLiteral(
":/marble/cursor/tc.png"));
209 m_curpmtr.load(QStringLiteral(
":/marble/cursor/tr.png"));
210 m_curpmcr.load(QStringLiteral(
":/marble/cursor/cr.png"));
211 m_curpmcl.load(QStringLiteral(
":/marble/cursor/cl.png"));
212 m_curpmbl.load(QStringLiteral(
":/marble/cursor/bl.png"));
213 m_curpmbc.load(QStringLiteral(
":/marble/cursor/bc.png"));
214 m_curpmbr.load(QStringLiteral(
":/marble/cursor/br.png"));
216 m_arrowCur[0][0] =
QCursor( m_curpmtl, 2, 2 );
217 m_arrowCur[1][0] =
QCursor( m_curpmtc, 10, 3 );
218 m_arrowCur[2][0] =
QCursor( m_curpmtr, 19, 2 );
219 m_arrowCur[0][1] =
QCursor( m_curpmcl, 3, 10 );
221 m_arrowCur[2][1] =
QCursor( m_curpmcr, 18, 10 );
222 m_arrowCur[0][2] =
QCursor( m_curpmbl, 2, 19 );
223 m_arrowCur[1][2] =
QCursor( m_curpmbc, 11, 18 );
224 m_arrowCur[2][2] =
QCursor( m_curpmbr, 19, 19 );
227MarbleDefaultInputHandler::Private::~Private()
231MarbleDefaultInputHandler::MarbleDefaultInputHandler(MarbleAbstractPresenter *marblePresenter)
232 : MarbleInputHandler(marblePresenter),
235 d->m_toolTipTimer.setSingleShot(
true);
236 d->m_toolTipTimer.setInterval(TOOLTIP_START_INTERVAL);
237 connect(&d->m_toolTipTimer, SIGNAL(timeout()),
this, SLOT(openItemToolTip()));
238 d->m_lmbTimer.setSingleShot(
true);
239 connect(&d->m_lmbTimer, SIGNAL(timeout()),
this, SLOT(lmbTimeout()));
241 d->m_kineticSpinning.setUpdateInterval(35);
242 connect(&d->m_kineticSpinning, SIGNAL(positionChanged(qreal,qreal)),
243 MarbleInputHandler::d->m_marblePresenter, SLOT(centerOn(qreal,qreal)));
244 connect(&d->m_kineticSpinning, SIGNAL(headingChanged(qreal)),
245 MarbleInputHandler::d->m_marblePresenter, SLOT(headingOn(qreal)));
246 connect(&d->m_kineticSpinning, SIGNAL(finished()), SLOT(restoreViewContext()));
249 connect(
this, SIGNAL(rmbRequest(
int,
int)),
this, SLOT(showRmbMenu(
int,
int)));
250 connect(
this, SIGNAL(lmbRequest(
int,
int)),
this, SLOT(showLmbMenu(
int,
int)));
252 d->m_pressAndHoldTimer.setInterval(800);
253 d->m_pressAndHoldTimer.setSingleShot(
true);
254 connect(&d->m_pressAndHoldTimer, SIGNAL(timeout()),
this, SLOT(handlePressAndHold()));
257MarbleDefaultInputHandler::~MarbleDefaultInputHandler()
262void MarbleDefaultInputHandler::stopInertialEarthRotation()
264 d->m_kineticSpinning.stop();
267void MarbleDefaultInputHandler::lmbTimeout()
269 if (!selectionRubber()->isVisible())
271 qreal clickedLon = 0;
272 qreal clickedLat = 0;
274 bool isPointOnGlobe = MarbleInputHandler::d->m_marblePresenter->map()->geoCoordinates( d->m_leftPressedX, d->m_leftPressedY,
275 clickedLon, clickedLat,
276 GeoDataCoordinates::Degree );
277 emit lmbRequest(d->m_leftPressedX, d->m_leftPressedY);
283 if ( isPointOnGlobe ) {
284 emit mouseClickGeoPosition( clickedLon, clickedLat,
285 GeoDataCoordinates::Degree );
290void MarbleInputHandler::restoreViewContext()
293 d->m_mouseWheelTimer->stop();
296 d->m_marblePresenter->setViewContext(Still);
297 d->m_marblePresenter->map()->viewport()->resetFocusPoint();
298 d->m_wheelZoomTargetDistance = 0.0;
301void MarbleDefaultInputHandler::hideSelectionIfCtrlReleased(
QEvent *e)
308 selectionRubber()->hide();
313bool MarbleDefaultInputHandler::handleDoubleClick(
QMouseEvent *event)
317 const bool isMouseAboveMap = MarbleInputHandler::d->m_marblePresenter->map()->geoCoordinates(
event->x(),
event->y(),
318 mouseLon, mouseLat, GeoDataCoordinates::Radian);
321 d->m_pressAndHoldTimer.stop();
322 d->m_lmbTimer.stop();
323 MarbleInputHandler::d->m_marblePresenter->moveTo(
event->pos(), 0.67);
325 return acceptMouse();
328bool MarbleDefaultInputHandler::handleWheel(
QWheelEvent *wheelevt)
330 MarbleAbstractPresenter *marblePresenter = MarbleInputHandler::d->m_marblePresenter;
331 marblePresenter->setViewContext(Animation);
333 if( (MarbleInputHandler::d->m_steps > 0 && wheelevt->delta() < 0) ||
334 (MarbleInputHandler::d->m_steps < 0 && wheelevt->delta() > 0) )
336 MarbleInputHandler::d->m_steps = wheelevt->delta();
340 MarbleInputHandler::d->m_steps += wheelevt->delta();
343 if (marblePresenter->map()->discreteZoom())
345 if(qAbs(MarbleInputHandler::d->m_steps) >= MarbleInputHandler::d->m_discreteZoomSteps)
347 marblePresenter->zoomAtBy(wheelevt->pos(), MarbleInputHandler::d->m_steps);
348 MarbleInputHandler::d->m_steps = 0;
353 qreal
zoom = marblePresenter->zoom();
354 qreal target = MarbleInputHandler::d->m_wheelZoomTargetDistance;
355 if (marblePresenter->animationsEnabled() && target > 0.0)
358 zoom = marblePresenter->zoomFromDistance(target);
360 qreal newDistance = marblePresenter->distanceFromZoom(zoom + MarbleInputHandler::d->m_steps);
361 MarbleInputHandler::d->m_wheelZoomTargetDistance = newDistance;
362 marblePresenter->zoomAt(wheelevt->pos(), newDistance);
363 if (MarbleInputHandler::d->m_inertialEarthRotation)
365 d->m_kineticSpinning.jumpToPosition(MarbleInputHandler::d->m_marblePresenter->centerLongitude(),
366 MarbleInputHandler::d->m_marblePresenter->centerLatitude());
368 MarbleInputHandler::d->m_steps = 0;
371 MarbleInputHandler::d->m_mouseWheelTimer->start(400);
380 MarbleAbstractPresenter *marblePresenter = MarbleInputHandler::d->m_marblePresenter;
383 destLon, destLat, GeoDataCoordinates::Radian );
387 marblePresenter->map()->viewport()->setFocusPoint(GeoDataCoordinates(destLon, destLat));
390 qreal
zoom, target, newDistance;
392 qreal zoomDelta = scaleFactor > 1.0 ? scaleFactor : -1.0/scaleFactor;
399 marblePresenter->setViewContext(Animation);
400 d->m_pressAndHoldTimer.stop();
401 d->m_lmbTimer.stop();
402 d->m_midPressed =
false;
403 d->m_leftPressed =
false;
406 zoom = marblePresenter->zoom();
407 target = MarbleInputHandler::d->m_wheelZoomTargetDistance;
408 if (marblePresenter->animationsEnabled() && target > 0.0)
411 zoom = marblePresenter->zoomFromDistance(target);
413 newDistance = marblePresenter->distanceFromZoom(zoom + 20 * zoomDelta);
414 MarbleInputHandler::d->m_wheelZoomTargetDistance = newDistance;
415 marblePresenter->zoomAt(
center.toPoint(), newDistance);
418 marblePresenter->map()->viewport()->resetFocusPoint();
419 marblePresenter->setViewContext(Still);
422 marblePresenter->map()->viewport()->resetFocusPoint();
423 marblePresenter->setViewContext(Still);
429bool MarbleDefaultInputHandler::handleGesture(
QGestureEvent *ge)
440 return handlePinch(center, scaleFactor, pinch->
state());
443void MarbleDefaultInputHandler::checkReleasedMove(
QMouseEvent *event)
448 if (d->m_leftPressed)
450 d->m_leftPressed =
false;
452 if (MarbleInputHandler::d->m_inertialEarthRotation)
454 d->m_kineticSpinning.start();
458 MarbleInputHandler::d->m_marblePresenter->setViewContext(Still);
464 d->m_midPressed =
false;
468void MarbleDefaultInputHandler::handleMouseButtonPress(
QMouseEvent *event)
472 d->m_pressAndHoldTimer.start();
473 handleLeftMouseButtonPress(event);
478 handleMiddleMouseButtonPress(event);
483 handleRightMouseButtonPress(event);
487void MarbleDefaultInputHandler::handleLeftMouseButtonPress(
QMouseEvent *event)
490 MarbleInputHandler::d->m_marblePresenter->map()->blockSignals(
true);
491 MarbleInputHandler::d->m_marblePresenter->setViewContext(Animation);
492 MarbleInputHandler::d->m_marblePresenter->map()->blockSignals(
false);
496 d->m_lmbTimer.start(400);
499 d->m_leftPressed =
true;
500 d->m_midPressed =
false;
501 selectionRubber()->hide();
507 d->m_leftPressedX =
event->x();
508 d->m_leftPressedY =
event->y();
511 d->m_leftPressedLon = MarbleInputHandler::d->m_marblePresenter->centerLongitude();
512 d->m_leftPressedLat = MarbleInputHandler::d->m_marblePresenter->centerLatitude();
514 if (MarbleInputHandler::d->m_inertialEarthRotation)
516 d->m_kineticSpinning.stop();
517 d->m_kineticSpinning.setPosition(d->m_leftPressedLon, d->m_leftPressedLat);
522 mDebug() <<
"Starting selection";
523 d->m_pressAndHoldTimer.stop();
524 d->m_lmbTimer.stop();
525 d->m_selectionOrigin =
event->pos();
526 selectionRubber()->setGeometry(
QRect(d->m_selectionOrigin,
QSize()));
527 selectionRubber()->show();
531void MarbleDefaultInputHandler::handleMiddleMouseButtonPress(
QMouseEvent *event)
533 d->m_midPressed =
true;
534 d->m_leftPressed =
false;
535 d->m_startingRadius = MarbleInputHandler::d->m_marblePresenter->radius();
536 d->m_midPressedY =
event->y();
538 if (MarbleInputHandler::d->m_inertialEarthRotation)
540 d->m_kineticSpinning.start();
543 selectionRubber()->hide();
544 MarbleInputHandler::d->m_marblePresenter->setViewContext(Animation);
547void MarbleDefaultInputHandler::handleRightMouseButtonPress(
QMouseEvent *event)
549 d->m_rightPressed =
true;
550 d->m_rightOrigin =
event->pos();
551 d->m_rightPosition =
event->pos();
552 d->m_heading = MarbleInputHandler::d->m_marblePresenter->map()->heading();
553 if (MarbleInputHandler::d->m_inertialEarthRotation)
555 d->m_kineticSpinning.stop();
556 d->m_kineticSpinning.setHeading(d->m_heading);
560void MarbleDefaultInputHandler::handleMouseButtonRelease(
QMouseEvent *event)
564 d->m_pressAndHoldTimer.stop();
567 emit mouseClickScreenPosition(d->m_leftPressedX, d->m_leftPressedY);
569 d->m_leftPressed =
false;
570 if (MarbleInputHandler::d->m_inertialEarthRotation)
572 d->m_kineticSpinning.start();
576 MarbleInputHandler::d->m_marblePresenter->setViewContext(Still);
582 d->m_midPressed =
false;
584 MarbleInputHandler::d->m_marblePresenter->setViewContext(Still);
589 if (d->m_rightOrigin ==
event->pos())
593 d->m_rightPressed =
false;
595 if (MarbleInputHandler::d->m_inertialEarthRotation)
597 d->m_kineticSpinning.start();
601 MarbleInputHandler::d->m_marblePresenter->setViewContext(Still);
606 && selectionRubber()->isVisible())
608 mDebug() <<
"Leaving selection";
609 MarbleInputHandler::d->m_marblePresenter->setSelection(selectionRubber()->geometry());
610 selectionRubber()->hide();
614void MarbleDefaultInputHandler::notifyPosition(
bool isMouseAboveMap, qreal mouseLon, qreal mouseLat)
617 if (MarbleInputHandler::d->m_positionSignalConnected) {
618 if (!isMouseAboveMap)
624 QString position = GeoDataCoordinates(mouseLon, mouseLat).toString();
625 emit mouseMoveGeoPosition(position);
630void MarbleDefaultInputHandler::adjustCursorShape(
const QPoint &mousePosition,
const QPoint &mouseDirection)
634 = MarbleInputHandler::d->m_marblePresenter->map()->whichItemAt(mousePosition);
635 bool dataAction =
false;
639 for (; it !=
end && dataAction ==
false && toolTipItem.
isNull(); ++it)
646 if (!(*it)->toolTip().isNull() && toolTipItem.
isNull())
652 if (toolTipItem.
isNull()) {
653 d->m_toolTipTimer.stop();
655 else if (!( d->m_lastToolTipItem.data() == toolTipItem.
data()))
657 d->m_toolTipTimer.start();
658 d->m_lastToolTipItem = toolTipItem;
659 d->m_toolTipPosition = mousePosition;
663 if (!d->m_toolTipTimer.isActive())
665 d->m_toolTipTimer.start();
667 d->m_toolTipPosition = mousePosition;
670 if (!dataAction && !MarbleInputHandler::d->m_marblePresenter->map()->hasFeatureAt(mousePosition)) {
671 if (!d->m_leftPressed)
682 if (!d->m_leftPressed)
688 if (panViaArrowsEnabled())
690 setCursor(d->m_arrowCur[mouseDirection.
x()+1][mouseDirection.
y()+1]);
694 setCursor(d->m_arrowCur[1][1]);
702 int polarity = MarbleInputHandler::d->m_marblePresenter->viewport()->polarity();
704 if (d->m_leftPressed) {
705 d->m_leftPressed =
false;
707 if (MarbleInputHandler::d->m_inertialEarthRotation)
709 d->m_kineticSpinning.start();
713 QRect boundingRect = MarbleInputHandler::d->m_marblePresenter->viewport()->mapRegion().boundingRect();
715 if (boundingRect.
width() != 0)
717 dirX = (int)( 3 * (
event->x() - boundingRect.
left()) / boundingRect.
width()) - 1;
728 if (boundingRect.
height() != 0)
730 dirY = (int)(3 * (
event->y() - boundingRect.
top()) / boundingRect.
height()) - 1;
742 && panViaArrowsEnabled() && !d->m_kineticSpinning.hasVelocity())
744 d->m_pressAndHoldTimer.stop();
745 d->m_lmbTimer.stop();
746 qreal moveStep = MarbleInputHandler::d->m_marblePresenter->moveStep();
749 MarbleInputHandler::d->m_marblePresenter->rotateBy(-moveStep * (qreal)(+dirX), moveStep * (qreal)(+dirY));
753 MarbleInputHandler::d->m_marblePresenter->rotateBy(-moveStep * (qreal)(-dirX), moveStep * (qreal)(+dirY));
757 if (!MarbleInputHandler::d->m_inertialEarthRotation)
759 MarbleInputHandler::d->m_marblePresenter->setViewContext(Still);
762 return QPoint(dirX, dirY);
765bool MarbleDefaultInputHandler::handleMouseEvent(
QMouseEvent *event)
769 checkReleasedMove(event);
776 auto const floatItems = MarbleInputHandler::d->m_marblePresenter->map()->floatItems();
777 for (AbstractFloatItem *floatItem: floatItems)
779 if ( floatItem->enabled() && floatItem->visible()
780 && floatItem->contains(
event->pos() ) )
782 d->m_pressAndHoldTimer.stop();
783 d->m_lmbTimer.stop();
791 const bool isMouseAboveMap = MarbleInputHandler::d->m_marblePresenter->map()->geoCoordinates(
event->x(),
event->y(),
792 mouseLon, mouseLat, GeoDataCoordinates::Radian);
793 notifyPosition(isMouseAboveMap, mouseLon, mouseLat);
797 if (isMouseAboveMap || selectionRubber()->isVisible()
798 || MarbleInputHandler::d->m_marblePresenter->map()->hasFeatureAt(mousePosition))
802 handleMouseButtonPress(event);
807 handleMouseButtonRelease(event);
810 const bool supportsViewportRotation = MarbleInputHandler::d->m_marblePresenter->map()->projection() ==
Spherical;
813 if (d->m_leftPressed && !selectionRubber()->isVisible())
815 qreal radius = (qreal)(MarbleInputHandler::d->m_marblePresenter->radius());
816 qreal deltax =
event->x() - d->m_leftPressedX;
817 qreal deltay =
event->y() - d->m_leftPressedY;
819 if (qAbs(deltax) > d->m_dragThreshold
820 || qAbs(deltay) > d->m_dragThreshold
821 || !d->m_lmbTimer.isActive())
823 MarbleInputHandler::d->m_marblePresenter->setViewContext(Animation);
825 d->m_pressAndHoldTimer.stop();
826 d->m_lmbTimer.stop();
827 Quaternion quat = Quaternion::fromSpherical( - M_PI/2 * deltax / radius, + M_PI/2 * deltay / radius );
828 if (supportsViewportRotation) {
829 const qreal heading = MarbleInputHandler::d->m_marblePresenter->map()->heading();
830 const Quaternion rotation = Quaternion::fromEuler( 0, 0, heading * DEG2RAD );
831 quat.rotateAroundAxis( rotation );
834 quat.getSpherical( lon, lat );
835 const qreal posLon = d->m_leftPressedLon + RAD2DEG * lon;
836 const qreal posLat = d->m_leftPressedLat + RAD2DEG * lat;
837 MarbleInputHandler::d->m_marblePresenter->centerOn(posLon, posLat);
838 if (MarbleInputHandler::d->m_inertialEarthRotation)
840 d->m_kineticSpinning.setPosition(posLon, posLat);
847 int eventy =
event->y();
848 int dy = d->m_midPressedY - eventy;
849 MarbleInputHandler::d->m_marblePresenter->setRadius(d->m_startingRadius * pow(1.005, dy));
852 if (d->m_rightPressed && supportsViewportRotation && MarbleInputHandler::d->m_mouseViewRotation)
854 qreal centerX, centerY;
855 MarbleInputHandler::d->m_marblePresenter->map()->screenCoordinates(
856 MarbleInputHandler::d->m_marblePresenter->centerLongitude(),
857 MarbleInputHandler::d->m_marblePresenter->centerLatitude(), centerX, centerY);
860 int dx =
event->x() - d->m_rightPosition.x();
861 int dy =
event->y() - d->m_rightPosition.y();
863 d->m_rightPosition =
event->pos();
866 int sign =
event->y() > centerY ? -1 : 1;
868 if ((
event->x() < centerX &&
event->y() < centerY) || (
event->x() > centerX &&
event->y() > centerY))
873 const qreal speedFactor = 0.3;
874 d->m_heading += (dx + dy) * sign * speedFactor;
875 MarbleInputHandler::d->m_marblePresenter->map()->setHeading(d->m_heading);
876 if (MarbleInputHandler::d->m_inertialEarthRotation)
878 d->m_kineticSpinning.setHeading(d->m_heading);
882 if (selectionRubber()->isVisible())
890 direction = mouseMovedOutside(event);
893 if (MarbleInputHandler::d->m_marblePresenter->viewContext() != Animation) {
894 adjustCursorShape(mousePosition, direction);
896 return acceptMouse();
899bool MarbleDefaultInputHandler::acceptMouse()
907bool MarbleDefaultInputHandler::eventFilter(
QObject* o,
QEvent* e)
911 if (layersEventFilter(o, e))
916 hideSelectionIfCtrlReleased(e);
925 return handleKeyPress(
static_cast<QKeyEvent *
>(e));
931 return handleDoubleClick(
static_cast<QMouseEvent*
>(e));
935 return handleMouseEvent(
static_cast<QMouseEvent*
>(e));
941bool MarbleDefaultInputHandler::handleTouch(
QTouchEvent*)
946bool MarbleDefaultInputHandler::handleKeyPress(
QKeyEvent* event)
949 MarbleAbstractPresenter *marblePresenter = MarbleInputHandler::d->m_marblePresenter;
951 switch (
event->key() ) {
953 stopInertialEarthRotation();
957 stopInertialEarthRotation();
961 stopInertialEarthRotation();
965 stopInertialEarthRotation();
970 stopInertialEarthRotation();
971 marblePresenter->zoomIn();
976 stopInertialEarthRotation();
977 marblePresenter->zoomOut();
981 stopInertialEarthRotation();
982 marblePresenter->goHome();
994void MarbleDefaultInputHandler::handleMouseButtonPressAndHold(
const QPoint &)
999void MarbleDefaultInputHandler::handlePressAndHold()
1001 handleMouseButtonPressAndHold(
QPoint(d->m_leftPressedX, d->m_leftPressedY));
1004const AbstractDataPluginItem *MarbleDefaultInputHandler::lastToolTipItem()
const
1006 return d->m_lastToolTipItem;
1009QTimer* MarbleDefaultInputHandler::toolTipTimer()
1011 return &d->m_toolTipTimer;
1014QPoint MarbleDefaultInputHandler::toolTipPosition()
const
1016 return d->m_toolTipPosition;
1021#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
QRect normalized() const const
QTextStream & center(QTextStream &stream)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)