source: subsurface/subsurface-desktop-helper.cpp

Last change on this file was 59ed9ea3, checked in by Dirk Hohndel <dirk@…>, 8 weeks ago

Add SPDX header to top level files

Signed-off-by: Dirk Hohndel <dirk@…>

  • Property mode set to 100644
File size: 1.1 KB
Line 
1// SPDX-License-Identifier: GPL-2.0
2/* qt-gui.cpp */
3/* Qt UI implementation */
4#include "core/dive.h"
5#include "core/display.h"
6#include "desktop-widgets/mainwindow.h"
7#include "core/helpers.h"
8#include "core/pluginmanager.h"
9
10#include <QApplication>
11#include <QDesktopWidget>
12#include <QNetworkProxy>
13#include <QLibraryInfo>
14
15#include "core/qt-gui.h"
16
17#ifdef SUBSURFACE_MOBILE
18#include <QQuickWindow>
19#include <QQmlApplicationEngine>
20#include <QQmlContext>
21#include <QSortFilterProxyModel>
22#include "mobile-widgets/qmlmanager.h"
23#include "qt-models/divelistmodel.h"
24#include "mobile-widgets/qmlprofile.h"
25QObject *qqWindowObject = NULL;
26#endif
27
28static MainWindow *window = NULL;
29
30void init_ui()
31{
32        init_qt_late();
33
34        PluginManager::instance().loadPlugins();
35
36        window = new MainWindow();
37        if (existing_filename && existing_filename[0] != '\0')
38                window->setTitle(MWTF_FILENAME);
39        else
40                window->setTitle(MWTF_DEFAULT);
41}
42
43void run_ui()
44{
45        window->show();
46        qApp->exec();
47}
48
49void exit_ui()
50{
51        delete window;
52        delete qApp;
53        free((void *)existing_filename);
54}
55
56double get_screen_dpi()
57{
58        QDesktopWidget *mydesk = qApp->desktop();
59        return mydesk->physicalDpiX();
60}
61
62
Note: See TracBrowser for help on using the repository browser.