[Solved] The “QtRunWork“ task returned false but did not log an error

Recently in business development need to update the UI in the QThread, if the UI handle through the direct update will make the program reported an error, because the update of the UI in the thread will not be captured by the original thread of the EXEC event, will lead to message event blockage generated ERROR, so the use of the signal and slot mechanism, and then I declared a signals signal in the QThread, the compilation reported this error.

The "QtRunWork" task returned false but did not log an error

No detailed warning was given, and I later checked the relevant QT instructions to solve the problem.

Solution: Add a line of macro definition to the class where you use signals and slots.

Q_OBJECT

This will work, the signal and slotted based on Q_OBJECT, we need to declare it module to our class so that the QT compiler can instantiate it, otherwise it will be exception ERROR.

Read More: