22 lines
562 B
C++
22 lines
562 B
C++
#ifndef QIMAGEVIEW_H
|
|
#define QIMAGEVIEW_H
|
|
|
|
#include <QGraphicsView>
|
|
#include <QBrush>
|
|
#include <QPen>
|
|
#pragma execution_character_set("utf-8")
|
|
//QGraphics绘图
|
|
//自定义QGraphicsView,添加网格背景
|
|
class QImageView :public QGraphicsView
|
|
{
|
|
public:
|
|
QImageView(QWidget* parent = nullptr);
|
|
public:
|
|
QColor BackgroundColor = QColor(53, 53, 53);
|
|
QColor FineGridColor = QColor(60, 60, 60);
|
|
QColor CoarseGridColor = QColor(25, 25, 25);
|
|
protected:
|
|
void drawBackground(QPainter* painter, const QRectF& r) override;
|
|
};
|
|
#endif // QIMAGEVIEW_H
|