This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/SoftwareDesign/Lab5/lab5_1_painter/mainwindow.h
2022-05-31 17:21:56 +08:00

40 lines
775 B
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QPainter>
enum DS { idle, line, circle, rec, tri, set, clr };
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
protected:
void paintEvent(QPaintEvent *event);
void drawLineTriger();
int num1, num2, num3, num4;
void mousePressEvent(QMouseEvent *);
// void mouseMoveEvent(QMouseEvent *);
// void mouseReleaseEvent(QMouseEvent *);
private slots:
void on_styCor_triggered();
void on_drawLine_triggered();
private:
QPixmap pix;
QPoint lastPoint;
QPoint endPoint;
DS drawStatus = idle;
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H