Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4
#
include
<
QtGui
>
5
#
include
<
stdlib
.
h
>
6
7
#
include
"mainwindow.h"
8
9
//! [0]
10
int
main
(
int
argc,
char
*argv[])
11
{
12
QApplication app(argc, argv);
13
QPixmap pixmap(
":/splash.png"
);
14
QSplashScreen splash(pixmap);
15
splash.show();
16
app.processEvents();
17
//! [0]
18
19
sleep(5);
20
//! [1]
21
QMainWindow window;
22
window.show();
23
splash.finish(&window);
24
return
app.exec();
25
}
26
//! [1]
27
28
//! [2]
29
QScreen
*
screen
= QGuiApplication::screens().at(1);
30
QPixmap
pixmap
(
":/splash.png"
);
31
QSplashScreen
splash
(
screen
, pixmap);
32
splash.show();
33
//! [2]
main
int main(int argc, char *argv[])
[2]
Definition
buffer.cpp:77
screen
QScreen * screen
[1]
Definition
main.cpp:29
splash
QSplashScreen * splash
Definition
src_gui_widgets_qsplashscreen.cpp:6
pixmap
QPixmap pixmap(":/splash.png")
[0]
qtbase
src
widgets
doc
snippets
qsplashscreen
main.cpp
Generated on Mon Mar 10 2025 00:41:14 for Qt by
1.13.2