-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.cpp
56 lines (46 loc) · 1.39 KB
/
main.cpp
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
54
55
56
/*
*
* MashBerry Homebrewing-controller
*
* Copyright (C) 2013 Sebastian Duell
* <mail@sebastian-duell.de>
*
* This file is licensed under the terms of the GNU General Public
* License version 3. This program is licensed "as is" without any
* warranty of any kind, whether express or implied.
*/
#include "mainwindow.h"
#include <QApplication>
#include <QSplashScreen>
#include <QNetworkInterface>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QPixmap pixmap(":/MashBerryLogo.PNG");
QSplashScreen splash(pixmap);
splash.show();
splash.showFullScreen();
QFont splashFont;
splashFont.setFamily("Arial");
// splashFont.setBold(true);
splashFont.setPixelSize(11);
splash.setFont(splashFont);
QList<QHostAddress> ips = QNetworkInterface::allAddresses();
QString ipstr("");
for (int i = 0; i < ips.size(); ++i)
{
if(ips[i].protocol() == QAbstractSocket::IPv4Protocol && ips[i] != QHostAddress::LocalHost)
{
ipstr += ips[i].toString();
ipstr += " ";
}
}
splash.showMessage("MashBerry version V1.2\n\nIP-address:\n"+ipstr, Qt::AlignBottom|Qt::AlignHCenter);
a.processEvents();
MainWindow w;
QTimer::singleShot(10000, &splash, SLOT(close()));
QTimer::singleShot(10000, &w, SLOT(showFullScreen()));
// splash.finish(&w);
// w.show();
return a.exec();
}