Important: Please read the Qt Code of Conduct -

[Solved] "Widgets must be created in the GUI thread" error

  • I spend several hours trying to find out what was the reason for this error.
    My Qt/QML application was running into sigsev with this error but I was unable to backtrace its origin.

    Most of the time it happens in a QML application when you try to create a QWidget derived class in the main.cpp before calling app.exec().
    I knew that already, and I was pretty sure I was not using QWidget in the initialisation code of my main.cpp.

    However, somewhere deep inside one of the networking class I was using in my initialisation routine, a QWebView was created to retrieve the UserAgent of the device. And QWebView is a QWidget...

    I hope this will be of any help.

Log in to reply