Loki
Loki

Reputation: 11

Qt GUI in a library?

I have a non-Qt library "A" that is used by different non-Qt c++ applications "x,y,z".

Now I want to add the same Qt GUI to these applications. May I implement a library "B" that contains the Qt GUI and use this library in my applications "x,y,z"? Or do I have to create new Qt applications "xGUI,yGUI,zGUI"?

I am using Qt5.4.0 and MVS 2013.

Thank you very much for your help.

Upvotes: 1

Views: 941

Answers (1)

Jeka
Jeka

Reputation: 1384

To use Qt library in non Qt application you have to use MFC Migration framework. https://github.com/kbinani/qt-solutions/tree/master/qtwinmigrate

The reason why you have to use this is event loop. Each Qt application use QEventLoop inside QApplication. Since your non-Qt application haven't it and use it's own event dispacther you need a way to merge it.

Upvotes: 1

Related Questions