tank.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 "qt/input/data.hpp"
  11. class QtInputTank:public QFrame{
  12. Q_OBJECT
  13. private:
  14. QtInputData* data;
  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(QtInputData* data,Tank* tank=nullptr);
  45. ~QtInputTank();
  46. QWidget* validate();
  47. void setTank();
  48. void getTank();
  49. public slots:
  50. void emitRemove();
  51. signals:
  52. void remove(QtInputTank* input_tank);
  53. };
  54. inline
  55. QtInputTank::~QtInputTank(){
  56. //model->removeTank(tank);
  57. delete double_validator;
  58. }
  59. inline void
  60. QtInputTank::emitRemove(){
  61. emit remove(this);
  62. }
  63. #endif