25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
659 B

  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QMainWindow>
  4. #include <QGraphicsScene>
  5. #include <QTreeWidget>
  6. #include <QMouseEvent>
  7. QT_BEGIN_NAMESPACE
  8. namespace Ui { class MainWindow; }
  9. QT_END_NAMESPACE
  10. class MainWindow : public QMainWindow
  11. {
  12. Q_OBJECT
  13. public:
  14. MainWindow(QWidget *parent = nullptr);
  15. ~MainWindow();
  16. private slots:
  17. void onHmiItemClicked(QTreeWidgetItem *item);
  18. protected:
  19. bool eventFilter(QObject *obj, QEvent *event) override;
  20. private:
  21. Ui::MainWindow *ui;
  22. bool canDrawCircle;
  23. bool canDrawRectangle;
  24. QGraphicsScene *scene; // QGraphicsScene,用于容纳图形项
  25. };
  26. #endif // MAINWINDOW_H