Question

I have written some code that relies on the Qt4 library and was using it in some projects. It deals with displaying PDFs, printing and so on and employs the poppler library My new project is made using Qt5, and I need those functionalities in it. My qt4 library is represented by DLL that simply returns an object of QWidget-derived class. Is it possible to use this QWidget inside my new qt5 project? Maybe after some wrapping? Also, while exploring this issue I came by to Qt plugins. I haven't researched this field yet, but may be it's possible to resolve the problem using them?

Thanks in advance.

Was it helpful?

Solution

Qt 4 and Qt 5 are not binary compatible, so no, you can't use the widget directly. Using both Qt 4 and Qt 5 inside the same application sounds like a dangerous idea...

The best bet is of course porting libpoppler to Qt 5 (have you evaluated how complex such a port would be? Probably not too much). The second best would've been using QX11Embed, but those classes are currently missing from Qt 5, awaiting for someone to port them to QPA / XCB.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top