2016-06-14 00:52:17 +00:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2016-06-17 13:49:49 +00:00
|
|
|
#include <QPushButton>
|
|
|
|
#include <QtCore/QVariant>
|
|
|
|
#include <QtWidgets/QAction>
|
|
|
|
#include <QtWidgets/QApplication>
|
|
|
|
#include <QtWidgets/QButtonGroup>
|
|
|
|
#include <QtWidgets/QHeaderView>
|
|
|
|
#include <QtWidgets/QMainWindow>
|
|
|
|
#include <QtWidgets/QPushButton>
|
|
|
|
#include <QtWidgets/QVBoxLayout>
|
|
|
|
#include <QtWidgets/QWidget>
|
2016-06-25 18:32:54 +00:00
|
|
|
#ifndef ANDROID
|
|
|
|
#include <QSystemTrayIcon>
|
|
|
|
#include <QCloseEvent>
|
|
|
|
#include <QMenu>
|
|
|
|
#endif
|
2016-06-14 00:52:17 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MainWindow(QWidget *parent = 0);
|
|
|
|
~MainWindow();
|
|
|
|
|
2016-06-25 18:32:54 +00:00
|
|
|
//#ifndef ANDROID
|
|
|
|
// void setVisible(bool visible);
|
|
|
|
//#endif
|
|
|
|
|
2016-06-17 13:49:49 +00:00
|
|
|
private slots:
|
|
|
|
void handleQuitButton();
|
2016-06-24 19:37:59 +00:00
|
|
|
void handleGracefulQuitButton();
|
|
|
|
void handleGracefulQuitTimerEvent();
|
2016-06-25 18:32:54 +00:00
|
|
|
#ifndef ANDROID
|
|
|
|
void setIcon();
|
|
|
|
void iconActivated(QSystemTrayIcon::ActivationReason reason);
|
|
|
|
void toggleVisibilitySlot();
|
|
|
|
#endif
|
2016-06-17 13:49:49 +00:00
|
|
|
|
2016-06-14 00:52:17 +00:00
|
|
|
private:
|
2016-06-25 18:32:54 +00:00
|
|
|
#ifndef ANDROID
|
|
|
|
void createActions();
|
|
|
|
void createTrayIcon();
|
|
|
|
#endif
|
|
|
|
|
2016-06-17 13:49:49 +00:00
|
|
|
QWidget *centralWidget;
|
|
|
|
QWidget *verticalLayoutWidget;
|
|
|
|
QVBoxLayout *verticalLayout1;
|
|
|
|
QPushButton *quitButton;
|
2016-06-24 19:37:59 +00:00
|
|
|
QPushButton *gracefulQuitButton;
|
2016-06-25 18:32:54 +00:00
|
|
|
|
|
|
|
#ifndef ANDROID
|
|
|
|
bool quitting;
|
|
|
|
QAction *toggleWindowVisibleAction;
|
|
|
|
QSystemTrayIcon *trayIcon;
|
|
|
|
QMenu *trayIconMenu;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
|
|
|
#ifndef ANDROID
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
#endif
|
2016-06-14 00:52:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|