Hi,
For some reason, i cannot access the QSqlRelationalDelegate method, either in my code or with the sample code.
For example this code from the sample:
view->setModel(model);
QTableView *view = new QTableView;
view->setModel(model);
view->setItemDelegate(new QSqlRelationalDelegate(view));
To copy to clipboard, switch view to plain text mode
i get a syntax error : identifier 'QSqlRelationalDelegate' error when compliing with VS2005.
Or with:
model->setTable(tableName);
model
->setRelation
(18,
QSqlRelation("Category",
"mCategoryID",
"mCategoryName"));
model->select();
m_pMusicTableView->setModel(model);
m_pMusicTableView->show();
model = new QSqlRelationalTableModel(this, m_pPrimarydb);
model->setTable(tableName);
model->setEditStrategy(QSqlTableModel::OnManualSubmit);
model->setRelation(18, QSqlRelation("Category", "mCategoryID", "mCategoryName"));
model->select();
m_pMusicTableView->setModel(model);
m_pMusicTableView->setItemDelegate(new QSqlRelationalDelegate(m_pMusicTableView));
m_pMusicTableView->show();
To copy to clipboard, switch view to plain text mode
All other sql functions seem to be working with no problem. (qsqldatabase, qsqlquery.. etc)
I have no clue what I have forgotten to include to get this to compile, any help appreciated.
Thanks,
Johnny
Bookmarks