Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved How to get to an unexpanded path's index in Treeview (with FileSystemModel) without expand the treeview?

    General and Desktop
    1
    1
    49
    Loading More Posts
    • 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.
    • C
      Crypuff last edited by

      I am using Pyqt to develop a server maintenance application.

      I use a CheckableFileSystemModel override the QFilesystemmodel as the local file modeI. It adds checkbox before the items in the treeview.

      Sometimes I want to use a list of paths to update the checkstatus of checkbox (and show them to the user). It does not work when the path has not been expanded. As QFilesystemmodel is a lazy model which means it will not walk the directory. This make me not able to update the CheckStatus of an unexpanded path, unless recursively expanding the treeview (which will make the GUI stuck for a long time).

      Is there any better way to get to an unexpanded path's index in Treeview (with FileSystemModel) without expand the treeview?Or to add node to treeview without expand it?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post