3 Star 3 Fork 0

ZZUFC/Pixel Coordinates

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mygraphicsview.h 1.41 KB
一键复制 编辑 原始数据 按行查看 历史
yunke120 提交于 2022-08-03 14:29 . remove showEvent
#ifndef MYGRAPHICSVIEW_H
#define MYGRAPHICSVIEW_H
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QGraphicsSimpleTextItem>
#include <QWheelEvent>
#include <QTimer>
#include <QMenu>
#include <QAction>
#include <QFileDialog>
#include <QColorDialog>
class MyGraphicsView : public QGraphicsView
{
public:
MyGraphicsView(QWidget *parent = nullptr);
~MyGraphicsView();
enum COORD_TYPE{
REALTIVE,
ABSOLUTE
};
void showImage(const QString &filename);
protected:
virtual void wheelEvent(QWheelEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event) ;
virtual void mouseReleaseEvent(QMouseEvent *event) ;
private slots:
void slotChangeImgTriggered();
void slotCoordTypeTriggered();
void slotTextColorTriggered();
void slotClearTriggered();
private:
void menuInit();
QMenu *pMenu;
QAction *pChangeImg;
QAction *pCoordType;
QAction *pTextColor;
QAction *pClear;
QString mFileName;
bool IS_RELATIVE;
bool IS_Translate;
bool IS_Translate2;
bool IS_Menu;
QTimer *pTimer;
QGraphicsScene *pScene;
QGraphicsPixmapItem *pixmapItem;
QList<QGraphicsSimpleTextItem *> mSimpleTextItemList;
QColor mTextColor;
QPoint mLastPos;
QSize imgSize;
COORD_TYPE mCoordType;
};
#endif // MYGRAPHICSVIEW_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/zzufc/pixel-coordinates.git
git@gitee.com:zzufc/pixel-coordinates.git
zzufc
pixel-coordinates
Pixel Coordinates
gview_dev

搜索帮助