2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef LIGHTMAPS_H
|
|
|
|
#define LIGHTMAPS_H
|
|
|
|
|
|
|
|
#include <QBasicTimer>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
class SlippyMap;
|
|
|
|
|
|
|
|
class LightMaps: public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2020-10-07 11:05:48 +00:00
|
|
|
LightMaps(QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
void setCenter(qreal lat, qreal lng);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void toggleNightMode();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void activateZoom();
|
|
|
|
void resizeEvent(QResizeEvent *);
|
|
|
|
void paintEvent(QPaintEvent *event);
|
|
|
|
void timerEvent(QTimerEvent *);
|
|
|
|
void mousePressEvent(QMouseEvent *event);
|
|
|
|
void mouseMoveEvent(QMouseEvent *event);
|
|
|
|
void mouseReleaseEvent(QMouseEvent *);
|
|
|
|
void keyPressEvent(QKeyEvent *event);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void updateMap(const QRect &r);
|
|
|
|
|
|
|
|
private:
|
|
|
|
SlippyMap *m_normalMap;
|
|
|
|
SlippyMap *m_largeMap;
|
|
|
|
bool pressed;
|
|
|
|
bool snapped;
|
|
|
|
QPoint pressPos;
|
|
|
|
QPoint dragPos;
|
|
|
|
QBasicTimer tapTimer;
|
|
|
|
bool zoomed;
|
|
|
|
QPixmap zoomPixmap;
|
|
|
|
QPixmap maskPixmap;
|
|
|
|
bool invert;
|
|
|
|
};
|
|
|
|
|
2020-10-07 11:05:48 +00:00
|
|
|
#endif
|