trikRuntime
trikGuiApplication.h
Go to the documentation of this file.
1 /* Copyright 2013 Roman Kurbatov
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  *
15  * This file was modified by Yurii Litvinov to make it comply with the requirements of trikRuntime
16  * project. See git revision history for detailed changes. */
17 
18 #pragma once
19 
20 #include <QtCore/qglobal.h>
21 #include <QtCore/QTimer>
22 #include <QtWidgets/QApplication>
23 
24 namespace trikGui {
25 
28 class TrikGuiApplication : public QApplication
29 {
30  Q_OBJECT
31 
32 public:
34  TrikGuiApplication(int &argc, char **argv);
35 
36  bool notify(QObject *receiver, QEvent *event) override;
37 
38 private slots:
41  void refreshWidgets();
42 
43  void shutdownSoon();
44  void shutdown();
45 
46 private:
47  QTimer mPowerButtonPressedTimer;
48  QTimer mShutdownDelayTimer;
49  QString mSavedStyleSheet;
50  bool mIsShuttingDown = false;
51  bool mIsShutdownRequested = false;
52 };
53 
54 }
Application main class, to translate events from robot buttons into more convenient events (like pres...
Definition: trikGuiApplication.h:28
TrikGuiApplication(int &argc, char **argv)
Constructor with command-line arguments.
Definition: trikGuiApplication.cpp:28
Definition: abstractIndicator.h:21
bool notify(QObject *receiver, QEvent *event) override
Definition: trikGuiApplication.cpp:41