mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:10:04 +00:00
Creating reference map widget
This commit is contained in:
parent
760e8a52a1
commit
b1e00cca83
8 changed files with 631 additions and 30 deletions
56
scwx-qt/source/scwx/qt/map/map_widget.hpp
Normal file
56
scwx-qt/source/scwx/qt/map/map_widget.hpp
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#pragma once
|
||||
|
||||
#include <QMapboxGL>
|
||||
|
||||
#include <QOpenGLWidget>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QScopedPointer>
|
||||
#include <QtGlobal>
|
||||
|
||||
class QKeyEvent;
|
||||
class QMouseEvent;
|
||||
class QWheelEvent;
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
|
||||
class MapWidget : public QOpenGLWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MapWidget(const QMapboxGLSettings&);
|
||||
~MapWidget();
|
||||
|
||||
private:
|
||||
void changeStyle();
|
||||
qreal pixelRatio();
|
||||
|
||||
// QWidget implementation.
|
||||
void keyPressEvent(QKeyEvent* ev) override final;
|
||||
void mousePressEvent(QMouseEvent* ev) override final;
|
||||
void mouseMoveEvent(QMouseEvent* ev) override final;
|
||||
void wheelEvent(QWheelEvent* ev) override final;
|
||||
|
||||
// QOpenGLWidget implementation.
|
||||
void initializeGL() override final;
|
||||
void paintGL() override final;
|
||||
|
||||
QPointF lastPos_;
|
||||
|
||||
QMapboxGLSettings settings_;
|
||||
QScopedPointer<QMapboxGL> map_;
|
||||
|
||||
uint64_t frameDraws_ = 0;
|
||||
|
||||
QVariant symbolAnnotationId_;
|
||||
QVariant lineAnnotationId_;
|
||||
QVariant fillAnnotationId_;
|
||||
|
||||
bool sourceAdded_ = false;
|
||||
};
|
||||
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue