Important: Please read the Qt Code of Conduct -

Call a Qwidget outside of a non QT app

  • Hello,

    I have vs2012 dll project and I managed to integrate Qt5.4.1 library in it. I want to use QWidget to open a window or do wherever I want with it like in QtCreator but when I try to call it,

    void myfunction::callQt()
            QWidget* mywidget = new QWidget;

    I get a pop-up window saying:

    must construct a qapplication before a qwidget

    I know that I don't have a QApplication and I don't know how to create it in my dll? do you have any example?

    Thanks in advance!


  • Lifetime Qt Champion


    I haven't used it but the QtWinMigrate module might offer hints about how to do it.

    Otherwise, there this stackoverflow post that could be interesting.

    Hope it helps

Log in to reply