| 23 | |
| 24 | namespace GammaRay { |
| 25 | void showSplashScreen() |
| 26 | { |
| 27 | if (!splash) { |
| 28 | splash = new QSplashScreen; |
| 29 | QPixmap pixmap = UIResources::themedPixmap(QStringLiteral("splashscreen.png"), splash); |
| 30 | splash->setPixmap(pixmap); |
| 31 | } |
| 32 | |
| 33 | const QWidget *window = qApp->activeWindow(); |
| 34 | |
| 35 | if (window && window != splash) { |
| 36 | splash->ensurePolished(); |
| 37 | |
| 38 | const QRect windowRect = splash->screen()->availableGeometry(); |
| 39 | QRect splashRect = QRect(QPoint(), splash->size()); |
| 40 | |
| 41 | splashRect.moveCenter(windowRect.center()); |
| 42 | splash->move(splashRect.topLeft()); |
| 43 | } |
| 44 | |
| 45 | splash->show(); |
| 46 | } |
| 47 | |
| 48 | void hideSplashScreen() |
| 49 | { |
no test coverage detected