Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFileSystemModel not updating on insertion of removable disc
Forum Updated to NodeBB v4.3 + New Features

QFileSystemModel not updating on insertion of removable disc

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 584 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pmh4514
    wrote on 28 Apr 2016, 17:15 last edited by pmh4514
    #1

    Using Qt5.5.1 on Win8.1 64bit (MSVC2013), I have a QFileSystemModel attached to a QTreeView.

    It works quite well to instantly reflect changes made with Windows like deleting, adding, renaming folders and files:

       QTreeView tree = new QTreeView(this);
       QFileSystemModel dirModel = new QFileSystemModel(this);  
       dirModel->setRootPath(dirModel->myComputer().toString());
       tree->setModel(dirModel);
    

    The problem is, if I attach an external USB drive, I'd expect the file-system model to reflect the new drive. But it doesn't. What am I doing wrong?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      pmh4514
      wrote on 11 May 2016, 14:44 last edited by
      #2

      Qt support has informed me that this is a known bug in Windows and there is no solution at this time. A workaround is to destroy and recreate the model.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved