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#include <QApplication>
4#include <QTextBrowser>
5
6int main(int argc, char **argv)
7{
8 QApplication app(argc, argv);
9
10//! [0]
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);
15//! [0]
16 browser.setSource(QUrl("../../../html/index.html"));
17 browser.resize(800, 600);
18 browser.show();
19
20 return app.exec();
21}
int main(int argc, char *argv[])
[ctor_close]