From 1cf7d9f34f1bc3ddc5fa97ff57a95dd8083f9ae8 Mon Sep 17 00:00:00 2001 From: Oleksii Zbykovskyi Date: Wed, 6 Aug 2025 14:53:56 +0200 Subject: Fix indentation issues in the widgets snippets folder Most of the snippets in widgets have indentation problems. So I refactored them to have a consistent indentation. Change-Id: I94422c222aa7a72cb2352f8cfb41ffe207c74904 Reviewed-by: Volker Hilsheimer --- src/widgets/doc/snippets/reading-selections/window.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/widgets/doc/snippets/reading-selections/window.cpp') diff --git a/src/widgets/doc/snippets/reading-selections/window.cpp b/src/widgets/doc/snippets/reading-selections/window.cpp index 23b45917f54..1400f500d03 100644 --- a/src/widgets/doc/snippets/reading-selections/window.cpp +++ b/src/widgets/doc/snippets/reading-selections/window.cpp @@ -64,14 +64,14 @@ MainWindow::MainWindow(QWidget *parent) void MainWindow::fillSelection() { -//! [0] + //! [0] const QModelIndexList indexes = selectionModel->selectedIndexes(); for (const QModelIndex &index : indexes) { QString text = QString("(%1,%2)").arg(index.row()).arg(index.column()); model->setData(index, text); } -//! [0] + //! [0] } void MainWindow::clearSelection() @@ -84,16 +84,18 @@ void MainWindow::clearSelection() void MainWindow::selectAll() { -//! [1] + //! [1] QModelIndex parent = QModelIndex(); -//! [1] //! [2] + //! [1] + + //! [2] QModelIndex topLeft = model->index(0, 0, parent); QModelIndex bottomRight = model->index(model->rowCount(parent)-1, model->columnCount(parent)-1, parent); -//! [2] + //! [2] -//! [3] + //! [3] QItemSelection selection(topLeft, bottomRight); selectionModel->select(selection, QItemSelectionModel::Select); -//! [3] + //! [3] } -- cgit v1.2.3