main.cpp 599 B

12345678910111213141516171819202122232425
  1. #include "Almond.h"
  2. #include <QtWidgets/QApplication>
  3. #include <QPixmap>
  4. #include <QDesktopWidget>
  5. #include <QSplashScreen>
  6. int main(int argc, char *argv[])
  7. {
  8. QApplication a(argc, argv);
  9. QRect screenDim = a.desktop()->screenGeometry();
  10. int splashW = screenDim.width() * 2 / 11;
  11. QPixmap splashImg(":/splash/splash");
  12. QPixmap splashScaled = splashImg.scaled(splashW, splashW * splashImg.height() / splashImg.width());
  13. QSplashScreen splash{ splashScaled };
  14. splash.show();
  15. a.processEvents();
  16. Almond w;
  17. w.show();
  18. splash.finish(&w);
  19. return a.exec();
  20. }