Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Go to the source code of this file.
Classes | |
class | MyModel |
Functions | |
model | setQuery ("SELECT name, salary FROM employee") |
model | setHeaderData (0, Qt::Horizontal, tr("Name")) |
model | setHeaderData (1, Qt::Horizontal, tr("Salary")) |
view | setModel (model) |
[17] //! [18] | |
view | show () |
[18] //! [19] | |
view | setEditTriggers (QAbstractItemView::NoEditTriggers) |
[16] //! [19] //! [20] | |
Q_UNUSED (salary) | |
for (int row=0;row< model.rowCount();++row) | |
[13] | |
void | QSqlTableModel_snippets () |
int | main (int argc, char **argv) |
[48] | |
Variables | |
QSqlQueryModel * | model = new QSqlQueryModel |
[16] | |
QTableView * | view = new QTableView |
[17] | |
int | salary = model.record(4).value("salary").toInt() |
|
new |
int main | ( | int | argc, |
char ** | argv ) |
[48]
[dynamic_tooltip]
[5]
[2]
[0]
[6]
[48]
[48]
[6]
[0]
[0]
[1]
[1]
[2]
[2]
[3]
[3]
[0]
[0]
[1]
[1]
[2]
[2]
[3]
[3]
[0]
[0]
[1]
[1]
[2]
[2]
[3]
[3]
[0]
[0]
[0]
[0]
[1]
[1]
[1]
[1]
[0]
[0]
[0]
[0]
[0]
[0]
[0]
[0]
Definition at line 72 of file sqldatabase_snippet.cpp.
References QSqlTableModel_snippets().
Q_UNUSED | ( | salary | ) |
void QSqlTableModel_snippets | ( | ) |
view setEditTriggers | ( | QAbstractItemView::NoEditTriggers | ) |
[16] //! [19] //! [20]
model setHeaderData | ( | 0 | , |
Qt::Horizontal | , | ||
tr("Name") | ) |
model setHeaderData | ( | 1 | , |
Qt::Horizontal | , | ||
tr("Salary") | ) |
splash show | ( | ) |
[18] //! [19]
QAbstractItemModel * model = new QSqlQueryModel |
int salary = model.record(4).value("salary").toInt() |
Definition at line 22 of file sqldatabase_snippet.cpp.
QTableView* view = new QTableView |
[17]
Definition at line 10 of file sqldatabase_snippet.cpp.