input_tank.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef QT_INPUT_TANK_HPP
  2. #define QT_INPUT_TANK_HPP
  3. #include <QFrame>
  4. #include <QVBoxLayout>
  5. #include <QHBoxLayout>
  6. #include <QLabel>
  7. #include <QLineEdit>
  8. #include <QPushButton>
  9. #include <QDoubleValidator>
  10. #include "initial_state.hpp"
  11. class QtInputTank:public QFrame{
  12. Q_OBJECT
  13. private:
  14. InitialState* initial_state;
  15. Tank* tank;
  16. QWidget* saturation_widget;
  17. QWidget* left_right_widget;
  18. QWidget* bottom_top_widget;
  19. QVBoxLayout* main_layout;
  20. QHBoxLayout* saturation_layout;
  21. QHBoxLayout* left_right_layout;
  22. QHBoxLayout* bottom_top_layout;
  23. QPushButton* remove_button;
  24. QLabel* saturation_label;
  25. QLabel* left_label;
  26. QLabel* right_label;
  27. QLabel* top_label;
  28. QLabel* bottom_label;
  29. QLabel* delta_left_label;
  30. QLabel* delta_right_label;
  31. QLabel* delta_top_label;
  32. QLabel* delta_bottom_label;
  33. QLineEdit* saturation_input;
  34. QLineEdit* left_input;
  35. QLineEdit* right_input;
  36. QLineEdit* top_input;
  37. QLineEdit* bottom_input;
  38. QLineEdit* delta_left_input;
  39. QLineEdit* delta_right_input;
  40. QLineEdit* delta_top_input;
  41. QLineEdit* delta_bottom_input;
  42. QDoubleValidator* double_validator;
  43. public:
  44. QtInputTank(InitialState*);
  45. ~QtInputTank();
  46. QWidget* validate();
  47. public slots:
  48. void emitRemove();
  49. signals:
  50. void remove(QtInputTank* input_tank);
  51. };
  52. inline
  53. QtInputTank::~QtInputTank(){
  54. initial_state->removeTank(tank);
  55. delete double_validator;
  56. }
  57. inline void
  58. QtInputTank::emitRemove(){
  59. emit remove(this);
  60. }
  61. #endif