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#include <QApplication>
4#include <QTextBrowser>
5
6int main(int argc, char **argv)
7{
8 QApplication app(argc, argv);
9
11 QTextBrowser browser;
12 QColor linkColor(Qt::red);
13 QString sheet = QString::fromLatin1("a { text-decoration: underline; color: %1 }").arg(linkColor.name());
14 browser.document()->setDefaultStyleSheet(sheet);
16 browser.setSource(QUrl("../../../html/index.html"));
17 browser.resize(800, 600);
18 browser.show();
19
20 return app.exec();
21}
22
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...
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
QString name(NameFormat format=HexRgb) const
Definition qcolor.cpp:834
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5871
The QTextBrowser class provides a rich text browser with hypertext navigation.
\inmodule QtCore
Definition qurl.h:94
int main()
[0]
@ red
Definition qnamespace.h:35
QApplication app(argc, argv)
[0]