5 #include <QActionGroup>
6 #include <QFileSystemWatcher>
11 class Window : public QMainWindow
15 explicit Window(QWidget* parent=0);
16 bool load_stl(const QString& filename, bool is_reload=false);
21 void dragEnterEvent(QDragEnterEvent* event) override;
22 void dropEvent(QDropEvent* event) override;
23 void keyPressEvent(QKeyEvent* event) override;
30 void on_missing_file();
31 void on_confusing_stl();
36 void set_watched(const QString& filename);
39 void on_projection(QAction* proj);
40 void on_drawMode(QAction* mode);
41 void on_watched_change(const QString& filename);
43 void on_autoreload_triggered(bool r);
44 void on_clear_recent();
45 void on_load_recent(QAction* a);
46 void on_loaded(const QString& filename);
47 void on_save_screenshot();
50 void rebuild_recent_files();
51 void sorted_insert(QStringList& list, const QCollator& collator, const QString& value);
52 void build_folder_file_list();
53 QPair<QString, QString> get_file_neighbors();
55 QAction* const open_action;
56 QAction* const about_action;
57 QAction* const quit_action;
58 QAction* const perspective_action;
59 QAction* const orthogonal_action;
60 QAction* const shaded_action;
61 QAction* const wireframe_action;
62 QAction* const reload_action;
63 QAction* const autoreload_action;
64 QAction* const save_screenshot_action;
66 QMenu* const recent_files;
67 QActionGroup* const recent_files_group;
68 QAction* const recent_files_clear_action;
69 const static int MAX_RECENT_FILES=8;
70 const static QString RECENT_FILE_KEY;
72 QString lookup_folder;
73 QStringList lookup_folder_files;
75 QFileSystemWatcher* watcher;