Results 1 to 3 of 3

Thread: QFileSystemModel with network drives not connected

  1. #1

    Default QFileSystemModel with network drives not connected

    Hi,

    I use QFileSystemModel with QTreeView, and i make setRootPath on the model, like below :

    Qt Code:
    1. QFileSystemModel* model = new QFileSystemModel;
    2. model->setRootPath(QDir::currentPath());
    3. ui->treeView->setModel(model);
    To copy to clipboard, switch view to plain text mode 

    And when my network drives are not connected it takes long time to display the QTreeView the first time.

    Is there a way to avoid that? Or to detect the drives which are not connected and not display them in the tree view ?

    Thanks for the help,

    Hugo.

  2. #2

    Default Re: QFileSystemModel with network drives not connected

    More precisions from the tests i did today :
    - there is no problem when my pc is not connected to a network.
    - there is no problem when my pc is connected to the network used to mount the drives (P: , ...)
    - there is a problem when the pc is connected to another network than the one i used to mount the drives

    In this last case, my application starts very slowly. It must try to access the network drives and fail.

    I launched the DirView Qt example, and there is exactly the same problem. I use Windows Xp.

    Any ideas??

    Thanks,

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QFileSystemModel with network drives not connected

    Qt does not control how long Windows attempts to contact an absent server. Windows says drive P: exists and AFAICT Qt believes it.

Similar Threads

  1. Replies: 1
    Last Post: 6th March 2011, 13:44
  2. find connected network devices
    By Remco in forum Qt Programming
    Replies: 4
    Last Post: 9th September 2010, 09:03
  3. Replies: 2
    Last Post: 16th July 2010, 19:14
  4. QFileSystemModel and network resources
    By Talei in forum Newbie
    Replies: 0
    Last Post: 5th May 2010, 19:02
  5. Getting informed about newly connected network adapters
    By RThaden in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2010, 15:51

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.