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. [Solved] Error handling on async tree model loading

[Solved] Error handling on async tree model loading

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.6k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    mikedld
    wrote on last edited by
    #1

    I have a model implementing incremental data loading methods (canFetchMore/fetchMore/hasChildren/rowCount). When fetchMore() is called, I add "loading..." item as a child, send asynchronous request to the service (running in another thread) to give me real children, and return false. Sometimes user expands node which should totally have children, but does not at the moment. In that case, service returns me an error. I then need to show a message box, delete "loading..." child and let user expand the item once again later. The problem is that, when I remove the "loading..." child Qt also removes [+] branch decoration, making the item non-expandable.
    What's the correct way of doing this?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mikedld
      wrote on last edited by
      #2

      Solution was to not remove "loading..." child and just collapse the item.

      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