简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM