📄 form.h
字号:
#ifndef FORM_H#define FORM_H#include <QtGui>class Form : public QWidget{ Q_OBJECTpublic: Form(QWidget * parent = 0); enum ShapeType { Line, Polyline, Rectangle, Polygon, Arc, Pie, Chord, Ellipse, Text }; void setShape(ShapeType shape);public slots: void fontChanged(const QFont& font); void penChanged(QPen& pen); void brushChanged(QBrush& brush);protected: bool bDrawing; int x,y,w,h; void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); void paintEvent(QPaintEvent *event);private: QImage bufferImage; QImage tempImage; ShapeType curShape; QPen curPen; QBrush curBrush; QFont textFont; int thickness; void paint(QImage& image);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -