QString querystring
= "SELECT u.UserID, f.FileName, f.FileLocation, s.Size, s.Finished FROM users u JOIN stats s ON s.UserID = u.UserID JOIN file f ON s.FileID = Q.FileID WHERE u.UserID = 1";
modelquery.exec(querystring);
model->setQuery(modelquery);
model->setHeaderData(0, Qt::Horizontal, "UserID");
model->setHeaderData(1, Qt::Horizontal, "File Name");
model->setHeaderData(2, Qt::Horizontal, "File Location");
model->setHeaderData(3, Qt::Horizontal, "Size");
model->setHeaderData(4, Qt::Horizontal, "Finished");
QString querystring = "SELECT u.UserID, f.FileName, f.FileLocation, s.Size, s.Finished FROM users u JOIN stats s ON s.UserID = u.UserID JOIN file f ON s.FileID = Q.FileID WHERE u.UserID = 1";
QSqlQuery modelquery;
modelquery.exec(querystring);
QSqlQueryModel *model = new QSqlQueryModel;
model->setQuery(modelquery);
model->setHeaderData(0, Qt::Horizontal, "UserID");
model->setHeaderData(1, Qt::Horizontal, "File Name");
model->setHeaderData(2, Qt::Horizontal, "File Location");
model->setHeaderData(3, Qt::Horizontal, "Size");
model->setHeaderData(4, Qt::Horizontal, "Finished");
To copy to clipboard, switch view to plain text mode
ui->ComboBox->setModel(model);
ui->ComboBox->setModel(model);
To copy to clipboard, switch view to plain text mode
Bookmarks