66 lines
1.5 KiB
C
66 lines
1.5 KiB
C
|
|
#ifndef MAINWINDOW_H
|
||
|
|
#define MAINWINDOW_H
|
||
|
|
|
||
|
|
#include <QMainWindow>
|
||
|
|
#include <QTimer>
|
||
|
|
|
||
|
|
#include "utilities/StdOutRedirector.h"
|
||
|
|
#include "json/cJSON.h"
|
||
|
|
|
||
|
|
namespace Ui
|
||
|
|
{
|
||
|
|
class MainWindow;
|
||
|
|
}
|
||
|
|
|
||
|
|
class GUIMessageDialog;
|
||
|
|
class QTabWidget;
|
||
|
|
class QGestureEvent;
|
||
|
|
class QSwipeGesture;
|
||
|
|
class QPanGesture;
|
||
|
|
class QDockWidget;
|
||
|
|
class LoginDialog;
|
||
|
|
|
||
|
|
class MainWindow : public QMainWindow
|
||
|
|
{
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
public:
|
||
|
|
explicit MainWindow(QWidget* aParent = nullptr);
|
||
|
|
~MainWindow();
|
||
|
|
static void QMessageOutput(QtMsgType aType, const QMessageLogContext& aContext, const QString& aMessage);
|
||
|
|
void centerWidgetHide();
|
||
|
|
void centerWidgetShow();
|
||
|
|
void requestLogin();
|
||
|
|
QTextEdit* getEdit();
|
||
|
|
void debugConsoleOn();
|
||
|
|
void grabGestures(const QList<Qt::GestureType>& aGestures);
|
||
|
|
|
||
|
|
public slots:
|
||
|
|
void triggerError(const QString&);
|
||
|
|
|
||
|
|
protected:
|
||
|
|
void changeEvent(QEvent* aEvent);
|
||
|
|
bool event(QEvent* aEvent) override;
|
||
|
|
|
||
|
|
private:
|
||
|
|
void initializeTabWidget();
|
||
|
|
void initializeLayout();
|
||
|
|
bool gestureEvent(QGestureEvent* aGestureEvent);
|
||
|
|
void swipeTriggered(QSwipeGesture* aSwipeGesture);
|
||
|
|
void panTriggered(QPanGesture* aPanGesture);
|
||
|
|
void loadStyleSheet(const QString& aSheetName);
|
||
|
|
|
||
|
|
private:
|
||
|
|
Ui::MainWindow* mUI;
|
||
|
|
QDockWidget* mDebugConsoleWidget;
|
||
|
|
GUIMessageDialog* mMessageDialog;
|
||
|
|
QTextEdit* mDebugMessageConsole;
|
||
|
|
QTabWidget* mTabWidget;
|
||
|
|
int mAdminTabIndex;
|
||
|
|
LoginDialog* mLoginDialog;
|
||
|
|
QThread* mThread;
|
||
|
|
bool mIsDebugMode;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // MAINWINDOW_H
|