Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. update the model?
Qt 6.12 LTS is out! See what's new in the release blog

update the model?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 555 Views 2 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.
  • U Offline
    U Offline
    user4592357
    wrote on last edited by user4592357
    #1

    i have a treeview which gets populated with data. also, i have a widget that displays info about a treeview node. so, for example, if a treeview folder doesn't contain anything, the widget shows nothing, and if it does, the data is displayed.

    now, the thing is: when i decide whether or not to populate the widget, i check the number of the items the node has. now, if i run a script that displays info for all nodes, for empty nodes i get the some data displayed (like, the data of the previous iteration node). however, when i manually select the nodes i need info for, the widget gets updated appropriately.

    so i think the model somehow doesn't get to get updated in time and my code for checking whether it has children, returns false. well the pseudo-code is basically:

    if the folder doesn't have children
        show a blank widget
    

    so for some empty node, the if has_children returns true which is negated, so a blank widget doesn't get a chance to be displayed.

    the code is too long so i can't put it here but i'll answer if anything is needed for helping.

    thanks in advance

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What type of model are you talking about ?
      How is it populated ?
      How is it updated ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2

      • Login

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