#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QKeyEvent>
#include <QMainWindow>
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow {
  Q_OBJECT

public:
  MainWindow(QWidget *parent = nullptr);
  ~MainWindow();

private:
  Ui::MainWindow *ui;

  //终止运算，清除数据，报错
  void abortOperation();
  //连接信号和槽
  void connectSlots();
  //储存运算结果
  double result;
  bool isFinished;
private slots:
  void on_clearBtn_clicked();

  void on_equalBtn_clicked();

  void normalClicked();

  void on_actionPaste_triggered();
  void on_actionClearHistroy_triggered();
  void on_clearLine_clicked();

  void keyPressEvent(QKeyEvent *event);
  void on_ansBtn_clicked();
  void on_actionc_triggered();
  void on_actionpi_triggered();
  void on_actionShow_History_H_triggered();
};
#endif // MAINWINDOW_H
