PDA

View Full Version : [Help me] add new record into Sqlite using QSqlRelationalModel & QTableView



nvthao.cntt
11th March 2010, 07:41
Hi, all.
I'm a rookie in Qt and I have an problem when using QSqlRelationalModel and edit data on QTableView
I have two table :
tableSong : SongID<Pk>,SongName,ArtistID and more field
tableArtist : ArtistID<PK>,ArtistName and more field
now I want using QSqlRelationalModel and show data like this
SongID | SongName | ArtistName |...and more
but when I insert new row and using model->submitall(); <---it not works !
i think it's possible but i don't know how to do that
i hope everybody help me to solve this problem.
thank a lot.