diff options
| author | Oleksii Zbykovskyi <Oleksii.Zbykovskyi@qt.io> | 2025-08-06 14:53:56 +0200 |
|---|---|---|
| committer | Oleksii Zbykovskyi <Oleksii.Zbykovskyi@qt.io> | 2025-08-06 20:26:58 +0200 |
| commit | 1cf7d9f34f1bc3ddc5fa97ff57a95dd8083f9ae8 (patch) | |
| tree | 17fd4c4f1ee5437abb40b12acac566d90b62cd87 /src/widgets/doc/snippets/itemselection/main.cpp | |
| parent | 1ad8e33ef2500cba7e83cb7248f0f554def610ab (diff) | |
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 <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/doc/snippets/itemselection/main.cpp')
| -rw-r--r-- | src/widgets/doc/snippets/itemselection/main.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/widgets/doc/snippets/itemselection/main.cpp b/src/widgets/doc/snippets/itemselection/main.cpp index c514e1e6775..31908076055 100644 --- a/src/widgets/doc/snippets/itemselection/main.cpp +++ b/src/widgets/doc/snippets/itemselection/main.cpp @@ -41,27 +41,29 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); -//! [0] + //! [0] TableModel *model = new TableModel(8, 4, &app); QTableView *table = new QTableView(0); table->setModel(model); QItemSelectionModel *selectionModel = table->selectionModel(); -//! [0] //! [1] + //! [0] + + //! [1] QModelIndex topLeft; QModelIndex bottomRight; topLeft = model->index(0, 0, QModelIndex()); bottomRight = model->index(5, 2, QModelIndex()); -//! [1] + //! [1] -//! [2] + //! [2] QItemSelection selection(topLeft, bottomRight); selectionModel->select(selection, QItemSelectionModel::Select); -//! [2] + //! [2] -//! [3] + //! [3] QItemSelection toggleSelection; topLeft = model->index(2, 1, QModelIndex()); @@ -69,9 +71,9 @@ int main(int argc, char *argv[]) toggleSelection.select(topLeft, bottomRight); selectionModel->select(toggleSelection, QItemSelectionModel::Toggle); -//! [3] + //! [3] -//! [4] + //! [4] QItemSelection columnSelection; topLeft = model->index(0, 1, QModelIndex()); @@ -91,7 +93,7 @@ int main(int argc, char *argv[]) selectionModel->select(rowSelection, QItemSelectionModel::Select | QItemSelectionModel::Rows); -//! [4] + //! [4] table->setWindowTitle("Selected items in a table model"); table->show(); |
