-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathopenQminGUI.cpp
40 lines (34 loc) · 1.12 KB
/
openQminGUI.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
#include <QApplication>
#include <QMainWindow>
#include <QSplashScreen>
#include <QScreen>
#include <QTimer>
#include <QGuiApplication>
#include <QPropertyAnimation>
#include "mainwindow.h"
int main(int argc, char*argv[])
{
MPI_Init(&argc, &argv);
QApplication a(argc, argv);
QSplashScreen *splash = new QSplashScreen;
string dir=DIRECTORY;
string assetName="/assets/splashWithText.jpeg";
string splashPath = dir+assetName;
splash->setPixmap(QPixmap(splashPath.c_str()).scaled(876,584));
splash->show();
MainWindow w;
// Get the primary screen's geometry
QScreen *screen = a.primaryScreen();
QRect screenGeometry = screen->geometry();
// Calculate center position
int x = (screenGeometry.width() - w.width()) / 2;
int y = (screenGeometry.height() - w.height()) / 2;
// Move the window to the center
w.move(x, y);
QTimer::singleShot(750, splash, &QWidget::close);
QTimer::singleShot(750, &w, &QWidget::show);
/*QTimer::singleShot(750,splash,SLOT(close()));*/
/*QTimer::singleShot(750,&w,SLOT(show()));*/
return a.exec();
MPI_Finalize();
};