KShots
13th November 2009, 21:06
I've been scouring the docs looking for a means of running a QFileDialog locally on a remote filesystem, obtaining its data from a QTcpSocket from an application on the other end that can pump FS data back.
It looks like my best shot would be to re-implement the model that the QFileDialog operates off of with a proxy model on the local side, and run a QFileSystemModel on the remote end, and somehow serialize any requests/responses from the two over the QTcpSocket.
Is this even possible/feasible? Looking at the QAbstractProxyModel, it looks like I'd need to call 'setSourceModel' on yet another model, that would actually do the legwork to query the socket from the remote QFileSystemModel, so it would look like this:
+----------------+ +----------+ +----------+ +----------+ +----------+ +------------------+ +-------------------+ +-----------+
|QFileSystemModel|----|serializer|----|QTcpSocket|----|QTcpSocket|----|serializer|----|QAbstractItemModel|----|QAbstractProxyModel|----|QFileDialog|
+----------------+ +----------+ +----------+ +----------+ +----------+ +------------------+ +-------------------+ +-----------+
Am I totally off-base with this? Is there an easier way?
It looks like my best shot would be to re-implement the model that the QFileDialog operates off of with a proxy model on the local side, and run a QFileSystemModel on the remote end, and somehow serialize any requests/responses from the two over the QTcpSocket.
Is this even possible/feasible? Looking at the QAbstractProxyModel, it looks like I'd need to call 'setSourceModel' on yet another model, that would actually do the legwork to query the socket from the remote QFileSystemModel, so it would look like this:
+----------------+ +----------+ +----------+ +----------+ +----------+ +------------------+ +-------------------+ +-----------+
|QFileSystemModel|----|serializer|----|QTcpSocket|----|QTcpSocket|----|serializer|----|QAbstractItemModel|----|QAbstractProxyModel|----|QFileDialog|
+----------------+ +----------+ +----------+ +----------+ +----------+ +------------------+ +-------------------+ +-----------+
Am I totally off-base with this? Is there an easier way?