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 <QTextEdit>
5
7{
9QTextDocument *document = edit->document();
10QTextCursor cursor(document);
11
12cursor.movePosition(QTextCursor::Start);
14
17
18cursor.mergeCharFormat(format);
20}
21
22int main(int argc, char *argv[])
23{
24QWidget *parent = nullptr;
25QString aStringContainingHTMLtext("<h1>Scribe Overview</h1>");
26
27QApplication app(argc, argv);
28
30QTextEdit *editor = new QTextEdit(parent);
31editor->setHtml(aStringContainingHTMLtext);
32editor->show();
34
35return app.exec();
36}
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...
@ Bold
Definition qfont.h:70
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void setFontWeight(int weight)
Sets the text format's font weight to weight.
\reentrant \inmodule QtGui
Definition qtextcursor.h:30
\reentrant \inmodule QtGui
The QTextEdit class provides a widget that is used to edit and display both plain and rich text.
Definition qtextedit.h:27
void setHtml(const QString &text)
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
int main()
[0]
QCursor cursor
GLint GLsizei GLsizei GLenum format
void mergeFormat(QTextEdit *edit)
Definition main.cpp:6
QApplication app(argc, argv)
[0]