swift
src
swiftguistandard
main.cpp
1
// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
4
#include <cstdlib>
5
6
#include <QApplication>
7
8
#include "
swiftguistd.h
"
9
#include "
swiftguistdapplication.h
"
10
11
#include "
gui/enableforframelesswindow.h
"
12
#include "
gui/guiapplication.h
"
13
#include "
gui/guiutility.h
"
14
#include "
misc/crashhandler.h
"
15
16
using namespace
swift::gui
;
17
using namespace
swift::misc
;
18
using namespace
swift::misc::audio;
19
using namespace
swift::core
;
20
21
int
main
(
int
argc,
char
*argv[])
22
{
23
CGuiApplication::highDpiScreenSupport
(
CGuiApplication::scaleFactor
(argc, argv));
24
QApplication qa(argc, argv);
25
Q_UNUSED(qa)
// application init needed
26
27
CCrashHandler::instance()->init();
28
29
// at shutdown the whole application will be "deleted" outside the block
30
// that should already delete all widgets
31
int
r = 0;
32
{
33
CSwiftGuiStdApplication
a;
// application with contexts
34
if
(!a.
parseCommandLineArgsAndLoadSetup
()) {
return
EXIT_FAILURE; }
35
a.
splashScreen
(CIcons::swift256());
36
a.
setMinimumSizeInCharacters
(60, 42);
// experimental
37
if
(!a.
start
())
38
{
39
a.
gracefulShutdown
();
40
return
EXIT_FAILURE;
41
}
42
43
// show window
44
CEnableForFramelessWindow::WindowMode
windowMode = a.
getWindowMode
();
45
SwiftGuiStd
w(windowMode);
46
r = a.
exec
();
47
}
48
49
// bye
50
return
r;
51
}
CSwiftGuiStdApplication
Specialized GUI application for swift pilot client.
Definition:
swiftguistdapplication.h:22
SwiftGuiStd
swift GUI
Definition:
swiftguistd.h:63
swift::core::CApplication::parseCommandLineArgsAndLoadSetup
bool parseCommandLineArgsAndLoadSetup()
Combined function that does a startup check, parses the command line arguments and loads the setup.
Definition:
application.cpp:969
swift::core::CApplication::start
virtual bool start()
Start services, if not yet parsed call CApplication::parse.
Definition:
application.cpp:289
swift::core::CApplication::exec
int exec()
Finishes initialization and executes the event loop.
Definition:
application.cpp:199
swift::gui::CEnableForFramelessWindow::WindowMode
WindowMode
Window modes.
Definition:
enableforframelesswindow.h:36
swift::gui::CGuiApplication::scaleFactor
static QString scaleFactor(int argc, char *argv[])
Get the scale factor.
Definition:
guiapplication.cpp:474
swift::gui::CGuiApplication::getWindowMode
CEnableForFramelessWindow::WindowMode getWindowMode() const
Window mode (window flags)
Definition:
guiapplication.cpp:176
swift::gui::CGuiApplication::splashScreen
void splashScreen(const QPixmap &pixmap)
Add a splash screen based on resource, empty means remove splash screen.
Definition:
guiapplication.cpp:186
swift::gui::CGuiApplication::gracefulShutdown
void gracefulShutdown()
Graceful shutdown.
Definition:
guiapplication.cpp:1102
swift::gui::CGuiApplication::highDpiScreenSupport
static void highDpiScreenSupport(const QString &scaleFactor={})
Support for high DPI screens.
Definition:
guiapplication.cpp:290
swift::gui::CGuiApplication::setMinimumSizeInCharacters
void setMinimumSizeInCharacters(int widthChars, int heightChars)
Set minimum width/height in characters.
Definition:
guiapplication.cpp:932
crashhandler.h
enableforframelesswindow.h
guiapplication.h
guiutility.h
swift::core
Backend services of the swift project, like dealing with the network or the simulators.
Definition:
actionbind.cpp:7
swift::gui
GUI related classes.
Definition:
altitudeedit.cpp:13
swift::misc
Free functions in swift::misc.
Definition:
aircraftmatcher.h:22
main
int main(int argc, char *argv[])
main
Definition:
main.cpp:20
swiftguistd.h
swiftguistdapplication.h
Generated on Mon Mar 24 2025 16:42:23 for swift by
1.9.1