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
QApplication
qa(argc, argv);
24
Q_UNUSED(qa)
// application init needed
25
26
CCrashHandler::instance()->init();
27
28
// at shutdown the whole application will be "deleted" outside the block
29
// that should already delete all widgets
30
int
r = 0;
31
{
32
CSwiftGuiStdApplication
a;
// application with contexts
33
if
(!a.
parseCommandLineArgsAndLoadSetup
()) {
return
EXIT_FAILURE; }
34
a.
splashScreen
(CIcons::swift256());
35
a.
setMinimumSizeInCharacters
(60, 42);
// experimental
36
if
(!a.
start
())
37
{
38
a.
gracefulShutdown
();
39
return
EXIT_FAILURE;
40
}
41
42
// show window
43
CEnableForFramelessWindow::WindowMode
windowMode = a.
getWindowMode
();
44
SwiftGuiStd
w(windowMode);
45
r = a.
exec
();
46
}
47
48
// bye
49
return
r;
50
}
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:963
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::getWindowMode
CEnableForFramelessWindow::WindowMode getWindowMode() const
Window mode (window flags)
Definition:
guiapplication.cpp:166
swift::gui::CGuiApplication::splashScreen
void splashScreen(const QPixmap &pixmap)
Add a splash screen based on resource, empty means remove splash screen.
Definition:
guiapplication.cpp:176
swift::gui::CGuiApplication::gracefulShutdown
void gracefulShutdown()
Graceful shutdown.
Definition:
guiapplication.cpp:994
swift::gui::CGuiApplication::setMinimumSizeInCharacters
void setMinimumSizeInCharacters(int widthChars, int heightChars)
Set minimum width/height in characters.
Definition:
guiapplication.cpp:824
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
QApplication
main
int main(int argc, char *argv[])
main
Definition:
main.cpp:20
swiftguistd.h
swiftguistdapplication.h
Generated on Wed Sep 3 2025 21:41:22 for swift by
1.9.1