Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pedrolcl/splashwindow
Qt splash window recipe replacing QSplashScreen without using the widgets module
https://github.com/pedrolcl/splashwindow
c-plus-plus gui qml qt splash
Last synced: 2 months ago
JSON representation
Qt splash window recipe replacing QSplashScreen without using the widgets module
- Host: GitHub
- URL: https://github.com/pedrolcl/splashwindow
- Owner: pedrolcl
- License: gpl-3.0
- Created: 2019-12-03T15:18:40.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-23T12:59:24.000Z (almost 4 years ago)
- Last Synced: 2023-03-08T19:42:57.193Z (almost 2 years ago)
- Topics: c-plus-plus, gui, qml, qt, splash
- Language: C++
- Homepage:
- Size: 70.3 KB
- Stars: 8
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SplashWindow
Splash window for Qt, replacing `QSplashScreen`
This `SplashWindow` class can be used instead of `QSplashScreen` in applications using
`QGuiApplication` instead of `QApplication`. It needs only the `gui` module, but not
the `widgets` module as `QSplashScreen`, so it may be useful in QML apps.It is derived from the [Raster Window](https://doc.qt.io/qt-5/qtgui-rasterwindow-example.html) Qt example code.
## Usage
* close after a fixed amount of time:
```
SplashWindow splash;
splash.show();
QTimer::singleShot(2500, &splash, SLOT(close()));
```* close when another window is shown:
```
SplashWindow splash;
splash.show();
QQuickView *view = new QQuickView;
splash.finish(view);
view->show();
```view may be an instance of any `QWindow` derived class (like `QQuickView`)
Since the splash screen is typically displayed before the event loop has started running,
it is necessary to periodically call `QCoreApplication::processEvents()`.You may also call `splash.close()` after completing the application initialization.
A new method `centerInScreen(QScreen *s)` has been added to control the positioning of the splash window.