1 Star 0 Fork 0

xyc/SimpleTileMapClient

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
axistiledmapview.h 979 Bytes
一键复制 编辑 原始数据 按行查看 历史
axisxy 提交于 2018-10-08 09:30 . init
#ifndef AXISTILEDMAPVIEW_H
#define AXISTILEDMAPVIEW_H
#include <QGraphicsView>
#include <QEvent>
#include <QMouseEvent>
#include <QGLWidget>
#include <QObject>
#include <QScrollBar>
#include <QPinchGesture>
class AxisTiledMapScene;
class AxisTiledMapView : public QGraphicsView
{
Q_OBJECT
public:
AxisTiledMapView(QWidget* parent = nullptr);
~AxisTiledMapView();
AxisTiledMapScene *mapScene() const;
bool handScrolling() const { return _handscrolling; }
void setHandScrolling(bool b);
protected:
void mousePressEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
void wheelEvent(QWheelEvent* event);
void handlePinchGesture(QPinchGesture* pinch);
void adjustCenterFromMousePosition(QPoint& mousepos);
bool event(QEvent* e);
protected:
QPoint _lastmousepos;
QPointF _lastmousescenepos;
bool _handscrolling = false;
};
#endif // AXISTILEDMAPVIEW_H
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/axisxy/SimpleTileMapClient.git
git@gitee.com:axisxy/SimpleTileMapClient.git
axisxy
SimpleTileMapClient
SimpleTileMapClient
master

搜索帮助