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
mainwindow.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 <QTextEdit>
4#include <QTextList>
5
8{
9 void insertList();
10
11private:
12 QTextEdit *editor = nullptr;
13};
14
16{
17 QTextCursor cursor = editor->textCursor();
18 QTextList *list = cursor.currentList();
19
20//! [0]
21 QTextListFormat listFormat;
22 if (list) {
23 listFormat = list->format();
24 listFormat.setIndent(listFormat.indent() + 1);
25 }
26
27 listFormat.setStyle(QTextListFormat::ListDisc);
28 cursor.insertList(listFormat);
29//! [0]
30}
31
32} //textdocument_lists