[QT 4.6.3] QtreeView: where to put a wait cursor during data search?



  • Hi,
    I have a QTreeView that uses my own QFileModel. In my QFileModel the function data(...) need to perform complex and (quite long) process to be able to determine what to display. So, I want to display a wait cursor so that the user be informed that the computer works.

    I tried to display the wait cursor in data(...). But, when I try to expand a directory, this function is called a lot of time. Then the result is horrible. The numerous switchs between the wait cursor and the normal one are clearly visible.

    I have searched for signals able to help me (emitted of the beginning and end of the display). But I found none of them. It is why I request your help for this problem.

    Thanks a lot in advance.


  • Moderators

    You can create your own signals for that, and use them in your code.



  • Hi,
    Creating my own signals will change nothing. The problem is to be able to known when QT start displaying data in a QTreeView, and when it stops.



  • Hi,
    finally I found a better solution. I have overridden the paintEvent of myQtreeView. Qnd it is in this function that I am managing the cursor.


  • Moderators

    Nice to hear that, thanks for updating.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.