Mercurial > retraceit
comparison src/mainwindow.h @ 0:147b08bc7d64
Initial commit of a basic Application framework.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 23 Mar 2015 12:41:52 +0100 |
parents | |
children | 97d2c8869c39 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:147b08bc7d64 |
---|---|
1 /* Copyright (C) 2014 by Intevation GmbH | |
2 * | |
3 * This file is Free Software under the GNU GPL (v>=2) | |
4 * and comes with ABSOLUTELY NO WARRANTY! | |
5 * See LICENSE.txt for details. | |
6 */ | |
7 | |
8 | |
9 /** @file The Main UI class. | |
10 * | |
11 * Parent class of all dialogs and graphical user interaction. | |
12 */ | |
13 #include <QMainWindow> | |
14 #include <QSettings> | |
15 | |
16 class QPushButton; | |
17 class QDropEvent; | |
18 class QDragLeaveEvent; | |
19 class QDragMoveEvent; | |
20 class QDragEnterEvent; | |
21 | |
22 class MainWindow : public QMainWindow | |
23 { | |
24 Q_OBJECT | |
25 | |
26 public: | |
27 MainWindow(); | |
28 | |
29 protected: | |
30 /** @brief UI setup */ | |
31 void setupGUI(); | |
32 | |
33 /** @brief Cleanup and save the current state */ | |
34 virtual void closeEvent(QCloseEvent *event); | |
35 | |
36 /** @brief Restores the last window state */ | |
37 void readSettings(); | |
38 | |
39 /* The drag drop actions */ | |
40 void dragEnterEvent(QDragEnterEvent *event); | |
41 void dragMoveEvent(QDragMoveEvent *event); | |
42 void dragLeaveEvent(QDragLeaveEvent *event); | |
43 void dropEvent(QDropEvent *event); | |
44 | |
45 public slots: | |
46 /** @brief set an absolute folder to read a metadata.csv from. */ | |
47 void setFolder(const QString &folder); | |
48 | |
49 protected slots: | |
50 /** @brief Show an error dialog to the user. */ | |
51 void showErrorMessage(const QString& errMsg); | |
52 | |
53 private: | |
54 QSettings mSettings; | |
55 | |
56 bool mHasValidFolder; | |
57 QString mCurFolder; | |
58 }; |