-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (28 loc) · 778 Bytes
/
main.cpp
File metadata and controls
29 lines (28 loc) · 778 Bytes
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
#include "mainwindow.h"
#include <QApplication>
#include <QSplashScreen>
#include <QPixmap>
#include <QTimer>
#include <QLabel>
Q_DECLARE_METATYPE(Customer*)
Q_DECLARE_METATYPE(Item*)
//Displays the mainwindow and implements a timed splashscreen.
//Sets a window icon.
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
qRegisterMetaType<Customer*>("Customer*");
qRegisterMetaType<Item*>("Item*");
app.setWindowIcon(QIcon(":/icon.png"));
QPixmap pixmap(":/splash.png");
QSplashScreen splash(pixmap);
splash.show();
app.processEvents();
QTimer::singleShot(2000, &splash, &QSplashScreen::close);
MainWindow w;
QTimer::singleShot(2000, [&]() {
splash.finish(&w);
w.show();
});
return app.exec();
}