diff options
author | Topi Reinio <[email protected]> | 2020-11-18 13:58:40 +0100 |
---|---|---|
committer | Topi Reinio <[email protected]> | 2020-11-19 12:28:45 +0100 |
commit | 5669351bdf45acc8ca2e1334b9f53ebd2a541b6b (patch) | |
tree | 1d0b9a343f9de030a2b2e5401504cabace7176e5 /src/gui/doc/snippets/textdocument-frames/mainwindow.cpp | |
parent | 3c525f2a21d0e010f0a33128d032cbef8553d3cc (diff) |
Doc: Fix documentation warnings for Qt GUI
- Remove obsolete dependencies and references.
- Restore previously deleted snippet code referenced in
richtext.qdoc.
- Add widgets snippets path to exampledirs; some classes
were moved from QtWidgets to QtGUI and related \snippet
commands were broken.
- Mark internal functions under QNativeInterface::Private
as \internal.
Task-number: QTBUG-86295
Change-Id: I9c165c860c7191dac65972d702698a1745bff77f
Reviewed-by: Paul Wicking <[email protected]>
Diffstat (limited to 'src/gui/doc/snippets/textdocument-frames/mainwindow.cpp')
-rw-r--r-- | src/gui/doc/snippets/textdocument-frames/mainwindow.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/doc/snippets/textdocument-frames/mainwindow.cpp b/src/gui/doc/snippets/textdocument-frames/mainwindow.cpp index 96b84fe61a2..2608fb9f00d 100644 --- a/src/gui/doc/snippets/textdocument-frames/mainwindow.cpp +++ b/src/gui/doc/snippets/textdocument-frames/mainwindow.cpp @@ -65,6 +65,12 @@ MainWindow::MainWindow() menuBar()->addMenu(fileMenu); editor = new QTextEdit; +//! [rootframe] + QTextDocument *editorDocument = editor->document(); + QTextFrame *root = editorDocument->rootFrame(); +//! [rootframe] + processFrame(root); + QTextCursor cursor(editor->textCursor()); cursor.movePosition(QTextCursor::Start); @@ -151,3 +157,23 @@ void MainWindow::saveFile() } } +void MainWindow::processBlock(QTextBlock) +{ +} + +void MainWindow::processFrame(QTextFrame *frame) +{ +//! [4] + QTextFrame::iterator it; + for (it = frame->begin(); !(it.atEnd()); ++it) { + + QTextFrame *childFrame = it.currentFrame(); + QTextBlock childBlock = it.currentBlock(); + + if (childFrame) + processFrame(childFrame); + else if (childBlock.isValid()) + processBlock(childBlock); + } +//! [4] +} |