QtBase
v6.3.1
|
Go to the source code of this file.
Classes | |
class | MyModel |
[Quoting ModelView Tutorial] More... | |
class | XyzResult |
[47] More... | |
class | XyzDriver |
[47] More... | |
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] More... | |
view | show () |
[18] //! [19] More... | |
view | setEditTriggers (QAbstractItemView::NoEditTriggers) |
[16] //! [19] //! [20] More... | |
Q_UNUSED (salary) | |
[21] More... | |
for (int row=0;row< model.rowCount();++row) | |
[0] More... | |
void | QSqlTableModel_snippets () |
[23] More... | |
void | sql_intro_snippets () |
int | main (int argc, char **argv) |
[48] More... | |
Variables | |
QSqlQueryModel * | model = new QSqlQueryModel |
[16] More... | |
QTableView * | view = new QTableView |
[17] More... | |
int | salary = model.record(4).value("salary").toInt() |
for | ( | ) |
[0]
[10]
[1]
[11]
[0]
[4]
Definition at line 81 of file sqldatabase_snippet.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
[48]
[1]
[2]
Create an application and a main widget. Open the main widget for user input, and exit with an appropriate return value when it is closed.
[6]
[0]
[1]
[1] //! [2]
[2]
[3]
[3]
[4]
[4] //! [5]
[5] //! [6]
[0] [1]
[1] [2]
[0]
[1]
[1] //! [2]
[2]
[3]
[3]
[4]
[4] //! [5]
[5] //! [6]
[0]
[0]
[1]
[1]
[2]
[2]
[3]
[3]
[4]
[4]
[0]
[0]
[1]
[1]
[0]
[0]
[0]
[0]
Definition at line 375 of file sqldatabase_snippet.cpp.
Q_UNUSED | ( | salary | ) |
[21]
[22]
void QSqlTableModel_snippets | ( | ) |
[23]
[24]
[24]
[25]
[25]
Definition at line 107 of file sqldatabase_snippet.cpp.
view setEditTriggers | ( | QAbstractItemView::NoEditTriggers | ) |
[16] //! [19] //! [20]
model setHeaderData | ( | 0 | , |
Qt::Horizontal | , | ||
tr("Name") | |||
) |
model setHeaderData | ( | 1 | , |
Qt::Horizontal | , | ||
tr("Salary") | |||
) |
view show | ( | ) |
[18] //! [19]
void sql_intro_snippets | ( | ) |
[26]
[26]
[27]
[27]
[28]
[28] //! [29]
[29] //! [30]
[30]
[31]
[31]
[32]
[32]
[33]
[33]
[34]
[34]
[35]
[35]
[36]
[36]
[37]
[37]
[38]
[38]
[39]
[39]
[40]
[40]
[41]
[41]
[42]
[42]
[43]
[43]
[44]
[44]
[45]
[45] //! [46]
[46]
Definition at line 133 of file sqldatabase_snippet.cpp.
QSqlQueryModel model = new QSqlQueryModel |
int salary = model.record(4).value("salary").toInt() |
Definition at line 70 of file sqldatabase_snippet.cpp.
QTableView* view = new QTableView |
[17]
Definition at line 57 of file sqldatabase_snippet.cpp.