source: trunk/doc/src/snippets/code/doc_src_model-view-programming.qdoc@ 244

Last change on this file since 244 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 646 bytes
Line 
1//! [0]
2QAbstractItemModel *model = index.model();
3//! [0]
4
5
6//! [1]
7QModelIndex index = model->index(row, column, ...);
8//! [1]
9
10
11//! [2]
12QModelIndex indexA = model->index(0, 0, QModelIndex());
13QModelIndex indexB = model->index(1, 1, QModelIndex());
14QModelIndex indexC = model->index(2, 1, QModelIndex());
15//! [2]
16
17
18//! [3]
19QModelIndex index = model->index(row, column, parent);
20//! [3]
21
22
23//! [4]
24QModelIndex indexA = model->index(0, 0, QModelIndex());
25QModelIndex indexC = model->index(2, 1, QModelIndex());
26//! [4]
27
28
29//! [5]
30QModelIndex indexB = model->index(1, 0, indexA);
31//! [5]
32
33
34//! [6]
35QVariant value = model->data(index, role);
36//! [6]
Note: See TracBrowser for help on using the repository browser.