Only as an idea. As you said, derive QSqlQueryModel or similar, the one you need.Then, you have to implement a protocol between client and server, so you can "proxy" calls between them.
A method might look like this ( as an example ) :
int MyClientModel::rowCount ( void ) const
{
// Call to TCP Server
return myRemoteServerManager.requestRowCount ( myID );
}
int MyClientModel::rowCount ( void ) const
{
// Call to TCP Server
return myRemoteServerManager.requestRowCount ( myID );
}
To copy to clipboard, switch view to plain text mode
myRemoteServerManager is an object that wraps the implementation of interchange protocol.
myID is used to allow more than one connection for the same server with different models attached at the same time.
On server's side, you can derive also the same model, but simply adding the ID ( to search it easily ), and the TCP server must proxy the calls for client to the corrsponding server's model.
I don't know if it's a clear explanation or it's confusing... But the basic idea is : you have to wrap every call to the server's model.
Bookmarks