Please let me answer the question myself (in parts). First of all, you need to understand that Qt itself is very much built around its own concept of signal and slot. Therefore, you cannot expect a real-time update of QTextView from the moment you add text to it (maybe with a text cursor or just add it), it simply triggers a signal. So, no matter what you do, when you have only one thread, all you do is trigger signals to update your widgets. Corresponding slots will be processed with a much lower priority, and, therefore, after the completion of the locking work cycle. All this can be eliminated by calling QCoreApplication :: processEvents (), as noted in Idan K.'s comments. This ensures that all unprocessed events are processed sequentially and returns later. With this function, QTextEdit can be used as a real-time output console. However, as Idan and Greg point out, the best solution uses a separate workflow that emits signals to the GUI stream. Since these are separate threads, the GUI can process the corresponding slots while the worker continues to work. Thus, the output in theory may be slightly delayed. to the above solution, but the whole application will remain responsive.
I also want to add that my problems with using QThread together with mono, where they are solved by creating a global application domain outside ththread and using mono_thread_attach (), as suggested. It works well on both Mac OS X and Windows 7.
source share