PDA

View Full Version : Wrapping Qt into a dll



spatten
29th June 2010, 15:20
We have some legacy applications written in Qt3.3.7 which we need to maintain. We also have a roadmap for our future products which we are developing in Qt4. We are wanting to develop a sort of graphing screen component in Qt which we can use within our Qt4 application - no problems here. However as part of the maintenance of our legacy application we now have a requirement for the same screen to be implemented in our Qt3 application.
So my question is: is there a way to write this component code once only in Qt 4 and then make use of this component from a Qt 3 application. We are running on windows XP.
Our current thinking is to try and wrap this component (once it is written) into a dll which can then be utilised from a Qt 3 application, but we have never tried this and are not sure if it is the correct decision or if there is a better way to try and do this.

tbscope
29th June 2010, 19:09
You can mix and match Qt3 code with Qt4 code, only and only if you compile one or both Qt libraries in distinct namespaces.
Use qtnamespace to set a namespace name.

Otherwise you will get problems with for example QString. Is it Qt3, or is it Qt4?