Quote Originally Posted by gutiory View Post
I can't do what you've said, because the long operation comes from a GUI operation. I've a QTableView and I asign it a model that contains one hundred columns and fifteen rows. The asignment of the model to the view makes the app slow.
GUI operations can never take long! If they do, you're making a mistake, and the most common mistake with big lists is that all the items get drawn, even if they are not on screen. Thus: only draw those items that are on the screen. If you need to process the data, and it is a lot of data, then make sure you seperate the user interface and the data. Process the data in a seperate thread.

Even if your list is small, seperate the processing from the viewing. If you need to read data from a file or a socket, make sure it is at least done asynchronous or in a seperate thread. You can even add a signal or function to that thread to report progress so you can add a progressdialog or progressbar and link it to that signal or function.

Populate your model via a thread. You do not need to process your data inside the model, the model is just a container for your data, nothing more.