Results 1 to 2 of 2

Thread: Server/client file manager, QFileSystemModel serialization

  1. #1
    Join Date
    Apr 2014
    Posts
    5
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Server/client file manager, QFileSystemModel serialization

    Hi guys, as you might have guessed i'm new to QT.

    I need to write a Server/client file manager, basically a file explorer as it is in Windows but for client/server.

    From my limited knowledge in QT i decided to use QFileSystemModel class on the server.
    With this in mind, i'll have to 1)send files hierarchy to a client 2)if client wants to exapand some directory all i have to do is to send QModelIndex to the server and it will reply with a new hierarchy.

    Question is, how do i send QFileSystemModel to the client? Serialization, maybe? As i understand it i can't directly serialize a QFileSystemModel object. But i can get a list of it's child objects and serialize it. Can i deserialize it on the client side and create new QFileSystemModel object using this list?

    Or maybe you could suggest a better way to write this class, or use other classes?

    Thank you in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Server/client file manager, QFileSystemModel serialization

    I don't think QFileSystemModel is going to help you there, direct usage of QDir and QFileInfo might be better.

    The best approach is to first determine what kind of data you need for each directory entry and then come up with a protocol to transport that data.
    Since you are writing both sides you could use a simple protocol based on QDataStream.

    Once you can transmit data you can always build a model on the client side to use instead of a QFileSystemModel

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    Anslem (1st June 2014)

Similar Threads

  1. Replies: 1
    Last Post: 7th May 2013, 00:34
  2. TCP Client / Server
    By bmarsden in forum Qt Programming
    Replies: 4
    Last Post: 8th October 2010, 10:18
  3. tcp QT server - .Net c# client
    By soniaerm in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2010, 22:15
  4. Client Server
    By electronicboy in forum General Programming
    Replies: 3
    Last Post: 29th October 2009, 10:10
  5. client-server how?
    By nongentesimus in forum Newbie
    Replies: 6
    Last Post: 28th November 2006, 09:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.