HI,

I'd like some advice on best-practice ( if possible with a small code example ).
This is what I am trying to achieve:

In Mainwindow the user clicks the ActionTrigger (a button in the toolbar).
The code in the on_action_triggered stub opens a dialog with .exec()
In the constructor of the called dialog I call a function which takes a long time, thus it appears that nothing is happening (after clicking the button in the toolbar).

I'd like to inform the user with a custom progress dialog about the loading progress of the dialog with the long taking function.

I need to take into account that moving the function (that takes so long) - to a seperate thread is probably "not the way to do it" because it is generating objects (QTreeWidgetItems) on the main thread. The function generates them QTreeWidgetItems based on reading XML (via QDom), processing each toplevel element while comparing them to a QVector<QVector<Int> > which contains +2000 rows.

I have looked into many solutions proposed on forums, books and Qt class references about using QThread, QProcess, QProgressDialog, QFutureWatcher... but I can't seem to get it right that is.

Can anyone shed some brighter light on this topic please?