-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (39 loc) · 1.48 KB
/
Copy pathmain.cpp
File metadata and controls
53 lines (39 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "language.h"
#include "mainwindow.h"
#include <QApplication>
#include <QImageReader>
#include <QDebug>
#include <QThread>
#include <QObject>
#include <QCoreApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QCoreApplication::setApplicationName("QuickImport");
// Single source of truth: the version is set in CMakeLists.txt (project VERSION)
QCoreApplication::setApplicationVersion(QUICKIMPORT_VERSION);
QCoreApplication::setOrganizationName("HJ Steehouwer");
// Uses the "language" setting, falling back to the system locale.
AppLanguage::install();
// QPixmap image("://QuickImportLogo-klein.png");
// a.setWindowIcon(image);
MainWindow w;
// w.setWindowIcon(image);
qDebug() << "From main thread: " << QThread::currentThreadId();
QDeviceWatcher *watcher;
watcher = new QDeviceWatcher(&w);
watcher->appendEventReceiver(&w);
QObject::connect(watcher, &QDeviceWatcher::deviceAdded,
&w, &MainWindow::slotDeviceAdded,
Qt::QueuedConnection);
QObject::connect(watcher, &QDeviceWatcher::deviceChanged,
&w, &MainWindow::slotDeviceChanged,
Qt::QueuedConnection);
QObject::connect(watcher, &QDeviceWatcher::deviceRemoved,
&w, &MainWindow::slotDeviceRemoved,
Qt::QueuedConnection);
watcher->start();
w.show();
qDebug() << "started";
return a.exec();
}