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
6
int
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
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:2560
QColor
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition
qcolor.h:31
QColor::name
QString name(NameFormat format=HexRgb) const
Definition
qcolor.cpp:834
QString
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition
qstring.h:129
QString::fromLatin1
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
QTextBrowser
The QTextBrowser class provides a rich text browser with hypertext navigation.
Definition
qtextbrowser.h:18
QUrl
\inmodule QtCore
Definition
qurl.h:94
main
int main()
[0]
Definition
doc_src_objecttrees.cpp:5
Qt::red
@ red
Definition
qnamespace.h:35
app
QApplication app(argc, argv)
[0]
qtbase
src
gui
doc
snippets
textdocument-css
main.cpp
Generated by
1.10.0