Qt6 topics merged with General

QWidget crash on Qt5-alpha

  • Hi,

    I've successfully build Qt5 on my ubuntu 11.10 machine by clone Qt5 from the repos and follow the build instruction on the wiki.
    But when I tried to run my hello world widget application it crashed with this message:

    No platform plugin argument was specified, defaulting to "xcb".
    QWidget: Cannot create a QWidget when no GUI is being used

    any suggestion to solve this?

  • Can you post the code (should be short if it's a "hello world" app)?

  • Ok, I found the problem. its from my code.
    I thought that I should use QGuiApplication instead of QApplication for gui app, and after debugging it appears that the crash happened when QWidget try to get QApplication instance to know the type of the application.

    Here is my first Qt5 app :)

    @#include <QtWidgets/QApplication>
    #include <QtWidgets/QWidget>

    int main(int argc, char *argv[])
    QApplication a(argc, argv);
    QWidget w;
    return a.exec();


Log in to reply