model->setTable("Users");
model->setSort(User_Id, Qt::AscendingOrder);
model->setHeaderData(User_Name,Qt::Horizontal,tr("Username"));
model->setHeaderData(User_FirstName, Qt::Horizontal, tr("First name"));
model->setHeaderData(User_LastName, Qt::Horizontal, tr("Last Name"));
model
->setRelation
(User_Mode,
QSqlRelation("UserModes",
"ID",
"Name"));
model->setHeaderData(User_Mode, Qt::Horizontal, tr("Type"));
model->select();
model->setTable("Users");
model->setSort(User_Id, Qt::AscendingOrder);
model->setHeaderData(User_Name,Qt::Horizontal,tr("Username"));
model->setHeaderData(User_FirstName, Qt::Horizontal, tr("First name"));
model->setHeaderData(User_LastName, Qt::Horizontal, tr("Last Name"));
model->setRelation(User_Mode,QSqlRelation("UserModes","ID","Name"));
model->setHeaderData(User_Mode, Qt::Horizontal, tr("Type"));
model->select();
To copy to clipboard, switch view to plain text mode
Bookmarks