Qt
6.x
The Qt SDK
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
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
();
18
19
sleep(5);
21
QMainWindow
window
;
22
window
.show();
23
splash
.
finish
(&
window
);
24
return
app
.
exec
();
25
}
27
29
QScreen
*
screen
=
QGuiApplication::screens
().
at
(1);
30
QPixmap
pixmap
(
":/splash.png"
);
31
QSplashScreen
splash
(
screen
,
pixmap
);
32
splash
.
show
();
QApplication
The QApplication class manages the GUI application's control flow and main settings.
Definition
qapplication.h:32
QApplication::exec
static int exec()
Enters the main event loop and waits until exit() is called, then returns the value that was set to e...
Definition
qapplication.cpp:2564
QCoreApplication::processEvents
static void processEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Processes some pending events for the calling thread according to the specified flags.
Definition
qcoreapplication.cpp:1345
QGuiApplication::screens
static QList< QScreen * > screens()
Returns a list of all the screens associated with the windowing system the application is connected t...
Definition
qguiapplication.cpp:1061
QList::at
const_reference at(qsizetype i) const noexcept
Definition
qlist.h:429
QMainWindow
The QMainWindow class provides a main application window.
Definition
qmainwindow.h:25
QPixmap
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition
qpixmap.h:27
QScreen
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition
qscreen.h:32
QSplashScreen
The QSplashScreen widget provides a splash screen that can be shown during application startup.
Definition
qsplashscreen.h:18
QSplashScreen::finish
void finish(QWidget *w)
Makes the splash screen wait until the widget mainWin is displayed before calling close() on itself.
Definition
qsplashscreen.cpp:231
QWidget::show
void show()
Shows the widget and its child widgets.
Definition
qwidget.cpp:7956
main
int main()
[0]
Definition
doc_src_objecttrees.cpp:5
pixmap
QPixmap pixmap(":/splash.png")
splash
QSplashScreen splash(screen, pixmap)
screen
QScreen * screen
[1]
Definition
main.cpp:29
app
QApplication app(argc, argv)
[0]
window
aWidget window() -> setWindowTitle("New Window Title")
[2]
qtbase
src
widgets
doc
snippets
qsplashscreen
main.cpp
Generated by
1.9.7