Results 1 to 2 of 2

Thread: QTreeView: Creating an animated busy icon whilst loading data

  1. #1
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QTreeView: Creating an animated busy icon whilst loading data

    I have a QTreeView where the contents is loaded from a network. This network can be slow, so I'd like place an animated graphic in the middle of the control to show that the data is being updated rather than the user not knowing when the load is complete. I don't want to disable the control as I want the user to be able to use it whilst the data is being updated. By 'Updated' I mean that new items will be added to the view.

    I don't know whether to just have another widget sit in the middle of the control which animates, or to subclass QTreeView and do some drawing in there. The former doesn't lend itself to a layout manager very well (If the window is resized and resizes the QTreeView control, I would have to manually updated the internal animated widget too).

    Any suggestions?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTreeView: Creating an animated busy icon whilst loading data

    You may use delegates to show the busy animation.
    Or -
    You can show a QLabel loaded with busy.gif on screen position of the item. I guess you can map the item coordinates to scene coordinates. But you will need to update the label's position if the tree view size changes or is moved.

    Subclassing the QTreeView might also be a good idea, since you can easily calculate the items position, and show QLabel at that point. You also wont need to worry about using timer or updates for animation if you go for delegates.

Similar Threads

  1. Creating an Icon-Editor
    By Nedec in forum Qt Programming
    Replies: 5
    Last Post: 22nd March 2012, 06:58
  2. Animated icon on QTabWidget title
    By ramazangirgin in forum Qt Programming
    Replies: 4
    Last Post: 15th July 2010, 12:44
  3. QTreeWidgetItem animated icon
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2010, 18:09
  4. QSplashScreen loading icon
    By talk2amulya in forum Qt Programming
    Replies: 7
    Last Post: 16th February 2009, 09:46
  5. Animated icon on SystemTray
    By arbi in forum Qt Programming
    Replies: 2
    Last Post: 11th September 2008, 14:35

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.