説明なし

mainwindow.h 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QString>
  4. #include <QModelIndex>
  5. #include <QMainWindow>
  6. #include <QStandardItemModel>
  7. #include <QGraphicsPixmapItem>
  8. #include <QGraphicsItemGroup>
  9. #include <QGraphicsSceneMouseEvent>
  10. #include <QAbstractItemModel>
  11. #include "project.h"
  12. #include "map.h"
  13. #include "editor.h"
  14. namespace Ui {
  15. class MainWindow;
  16. }
  17. class MainWindow : public QMainWindow
  18. {
  19. Q_OBJECT
  20. public:
  21. explicit MainWindow(QWidget *parent = 0);
  22. ~MainWindow();
  23. private slots:
  24. void on_action_Open_Project_triggered();
  25. void on_mapList_activated(const QModelIndex &index);
  26. void on_action_Save_Project_triggered();
  27. void undo();
  28. void redo();
  29. void onMapChanged(Map *map);
  30. void on_action_Save_triggered();
  31. void on_tabWidget_2_currentChanged(int index);
  32. void on_action_Exit_triggered();
  33. void on_comboBox_Song_activated(const QString &arg1);
  34. void on_comboBox_Location_activated(const QString &arg1);
  35. void on_comboBox_Visibility_activated(const QString &arg1);
  36. void on_comboBox_Weather_activated(const QString &arg1);
  37. void on_comboBox_Type_activated(const QString &arg1);
  38. void on_comboBox_BattleScene_activated(const QString &arg1);
  39. void on_checkBox_ShowLocation_clicked(bool checked);
  40. void on_tabWidget_currentChanged(int index);
  41. void on_actionUndo_triggered();
  42. void on_actionRedo_triggered();
  43. void on_toolButton_newObject_clicked();
  44. void on_toolButton_deleteObject_clicked();
  45. void updateSelectedObjects();
  46. void on_toolButton_Paint_clicked();
  47. void on_toolButton_Select_clicked();
  48. void on_toolButton_Fill_clicked();
  49. void on_toolButton_Dropper_clicked();
  50. void onOpenMapListContextMenu(const QPoint &point);
  51. void onAddNewMapToGroupClick(QAction* triggeredAction);
  52. private:
  53. Ui::MainWindow *ui;
  54. QStandardItemModel *mapListModel;
  55. QList<QStandardItem*> *mapGroupsModel;
  56. Editor *editor = NULL;
  57. QIcon* mapIcon;
  58. void setMap(QString);
  59. void loadDataStructures();
  60. void populateMapList();
  61. QString getExistingDirectory(QString);
  62. void openProject(QString dir);
  63. QString getDefaultMap();
  64. void setRecentMap(QString map_name);
  65. QStandardItem* createMapItem(QString mapName, int groupNum, int inGroupNum);
  66. void markAllEdited(QAbstractItemModel *model);
  67. void markEdited(QModelIndex index);
  68. void updateMapList();
  69. void displayMapProperties();
  70. void checkToolButtons();
  71. };
  72. enum MapListUserRoles {
  73. GroupRole = Qt::UserRole + 1, // Used to hold the map group number.
  74. TypeRole = Qt::UserRole + 2, // Used to differentiate between the different layers of the map list tree view.
  75. };
  76. #endif // MAINWINDOW_H