Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
10int main(int argc, char *argv[])
11{
12 QApplication app(argc, argv);
13 QPixmap pixmap(":/splash.png");
15 splash.show();
18
19 sleep(5);
22 window.show();
24 return app.exec();
25}
27
30QPixmap pixmap(":/splash.png");
The QApplication class manages the GUI application's control flow and main settings.
static int exec()
Enters the main event loop and waits until exit() is called, then returns the value that was set to e...
static void processEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Processes some pending events for the calling thread according to the specified flags.
static QList< QScreen * > screens()
Returns a list of all the screens associated with the windowing system the application is connected t...
The QMainWindow class provides a main application window.
Definition qmainwindow.h:25
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
The QScreen class is used to query screen properties. \inmodule QtGui.
Definition qscreen.h:32
The QSplashScreen widget provides a splash screen that can be shown during application startup.
void finish(QWidget *w)
Makes the splash screen wait until the widget mainWin is displayed before calling close() on itself.
void show()
Shows the widget and its child widgets.
Definition qwidget.cpp:7875
int main()
[0]
QPixmap pixmap(":/splash.png")
QSplashScreen splash(screen, pixmap)
QScreen * screen
[1]
Definition main.cpp:29
QApplication app(argc, argv)
[0]
aWidget window() -> setWindowTitle("New Window Title")
[2]