Perhaps: a program that executes Qt3 and Qt4 code?

This may be a very stupid question, but I hope you can give me some answers.

I have a commercial application that uses Qt3 for its GUI and a built-in Python (command line) interpreter for scripting. I want to write a custom plugin for this application that uses Qt4. A plugin is basically a QMainWindow subclass class that is associated with the dll (so I'm on Windows) along with the python boost shell. The python shell should be the interface between my plugin and my commercial application.

So my question is: is this possible? This is how Qt3 code works, regardless of how Qt4 code runs in the same application.

The first experiments led to the disconnection of applications, I will try to study this further ...

Thanks!

Edit: My application crashed because I did not create an qT4 qapplication instance. Therefore, when I create the instance, everything works well without the additional Qt namespace (which is suggested in the answers, so there is no need to recompile) !;)

+3
source share
2 answers

See this thread on the Trolltech forum. (Well, what about the Qt3 plugins in the Qt4 application, but I suspect the answer is almost the same).

Update: now a link to dud, but

+3
source

This may be possible by placing Qt names. From configure --help;

-qtnamespace <name>  Wraps all Qt library code in 'namespace <name> {...}'.

Theoretically, this should prevent character collisions, which are likely to hamper your current approach.

+3

Source: https://habr.com/ru/post/1709085/


All Articles