aircraftwidget.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. *openPilot Log - A FOSS Pilot Logbook Application
  3. *Copyright (C) 2020 Felix Turowsky
  4. *
  5. *This program is free software: you can redistribute it and/or modify
  6. *it under the terms of the GNU General Public License as published by
  7. *the Free Software Foundation, either version 3 of the License, or
  8. *(at your option) any later version.
  9. *
  10. *This program is distributed in the hope that it will be useful,
  11. *but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. *GNU General Public License for more details.
  14. *
  15. *You should have received a copy of the GNU General Public License
  16. *along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. #ifndef AIRCRAFTWIDGET_H
  19. #define AIRCRAFTWIDGET_H
  20. #include <QWidget>
  21. #include <QItemSelection>
  22. #include <QSqlTableModel>
  23. #include <QDebug>
  24. #include <QTableView>
  25. #include "src/classes/asettings.h"
  26. #include "src/gui/dialogues/newtaildialog.h"
  27. #include "src/classes/aircraft.h"
  28. #include "src/database/db.h"
  29. namespace Ui {
  30. class AircraftWidget;
  31. }
  32. class AircraftWidget : public QWidget
  33. {
  34. Q_OBJECT
  35. public:
  36. explicit AircraftWidget(QWidget *parent = nullptr);
  37. ~AircraftWidget();
  38. private slots:
  39. void tableView_selectionChanged();
  40. void tableView_headerClicked(int column);
  41. void on_deleteButton_clicked();
  42. void on_newButton_clicked();
  43. void acft_editing_finished();
  44. void on_aircraftSearchLineEdit_textChanged(const QString &arg1);
  45. private:
  46. Ui::AircraftWidget *ui;
  47. QSqlTableModel *model;
  48. QTableView *view;
  49. qint32 sortColumn;
  50. QVector<qint32> selectedTails;
  51. void setupModelAndView();
  52. };
  53. #endif // AIRCRAFTWIDGET_H