main.cpp 647 B

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