View previous topic :: View next topic |
Author |
Message |
StifflerStealth Retired Dev
Joined: 03 Jul 2002 Posts: 968
|
Posted: Fri Aug 31, 2007 1:12 pm Post subject: Way to hack qt3 ebuilds to compile against qt4/qt3_support? |
|
|
I was reading the notes for QT 4.3 and they mention that there is a way to compile QT3 apps with QT4 using a feature called QT3 Support. That use flag is available for QT4 and this really got me wondering. I am posting this in Unsupported since I am hacking on the official ebuilds and it would not be supported by the devs.
Would I need to change the ebuilds at all or would I just need an enviromental flag? Though, I am thinking I need to a compile option in the ebuild and change it so that looks for QT4 with the QT3 flag.
The reason I want to do do this is that QT is a _really_ big package and takes a long time to compile, so having only one installed would be a big advantage for me. That and the all QT3 Support does in QT4 is change the headers, so you would still be using QT4. That could mean some improvements in speed and not to mention some new graphical looks ... in some cases.
If someone could point me in the right direction, I would appreciate it.
EDIT: Here is the link to the article: http://doc.trolltech.com/4.0/qt4-intro.html#qt-3-support-layer
Does this mean that all I need to do is install autopatcher, and set it up to patch all programs with that line? Though I would still need to edit out the QT3 depend.
Thanks. |
|
Back to top |
|
|
intmain Apprentice
Joined: 14 Dec 2005 Posts: 179 Location: Austria
|
Posted: Fri Aug 31, 2007 2:45 pm Post subject: |
|
|
I don't think that it's so easy to compile Qt3 apps with Qt4. The main problem are not the ebuilds but the source code of the applications.
When Qt 4.0 was released I played around with my applications I have written in Qt3 and it was hardly possible to get the code compiling only by using qt3to4 and the qt3support library. I had to rewrite many parts to get it working with Qt4.
Although there are the Qt3 support classes in Qt4, there also are many classes/functions/... which don't have anything equivalent in Qt4.
Maybe just using the qt3support library will work for some (small) applications, but compiling any larger Qt3 applications with Qt4 requires much more porting work. |
|
Back to top |
|
|
StifflerStealth Retired Dev
Joined: 03 Jul 2002 Posts: 968
|
Posted: Fri Aug 31, 2007 3:15 pm Post subject: |
|
|
hmmm. But the way that article sounds about qt3support is that in version 4.3 they added in all the missing qt3 functions, so it would be possible to compile any qt3 program with qt4/qt3support. That's the way I make of it. The documentation is really vague on how to do all this though. They just mention you need to add qt+=qt3support. :S I think more information is needed about this new support in QT v4.3. Maybe I should go bug the developers at trolltec about this? Because, if the way I am reading this is right that all of the missing functions are now in QT4, then QT3 apps can be ported to use QT4. I think this will be a fun experiment.
Thanks for your reply. I hope we can get to the bottom of this. |
|
Back to top |
|
|
intmain Apprentice
Joined: 14 Dec 2005 Posts: 179 Location: Austria
|
Posted: Fri Aug 31, 2007 3:28 pm Post subject: |
|
|
Have you already tried compiling any specific Qt3 application with Qt4?
I think this will be the best way to see how well it works. |
|
Back to top |
|
|
StifflerStealth Retired Dev
Joined: 03 Jul 2002 Posts: 968
|
Posted: Fri Aug 31, 2007 3:41 pm Post subject: |
|
|
I don't know how to. The documentation for QT4 say this:
Add the line QT += qt3support to your .pro file if you use qmake; otherwise, edit your makefile or project file to link against the Qt3Support library and add -DQT3_SUPPORT to your compiler flags. (You might also need to specify other libraries. See What's New in Qt 4 for details.)
It gives the example for qmake,but not automake, even though they mention it in passing. -_-
And then it's not clear if I need to add this line to all the source code: #include <Qt3Support>
If I modify the makefile, do I still need to use that define?
Then, once I figure that out, I can test. Though, what is the smallest qt3 program in portage? I want to start with the small and then work my way on up.
Thanks for all your help ^^ |
|
Back to top |
|
|
intmain Apprentice
Joined: 14 Dec 2005 Posts: 179 Location: Austria
|
Posted: Fri Aug 31, 2007 4:36 pm Post subject: |
|
|
I think you should start with an qmake based application because then you can use qt3to4 program which is included in Qt4. qt3to4 adjusts the .pro files and also changes the includes and classnames in the source code.
I don't know which qt application is the smallest available in portage, I think it also will not be easy to find a "pure" Qt application which does not depend on KDE. Maybe this is a good place to start. |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Fri Aug 31, 2007 5:00 pm Post subject: |
|
|
intmain wrote: | I think you should start with an qmake based application because then you can use qt3to4 program which is included in Qt4. qt3to4 adjusts the .pro files and also changes the includes and classnames in the source code.
I don't know which qt application is the smallest available in portage, I think it also will not be easy to find a "pure" Qt application which does not depend on KDE. Maybe this is a good place to start. |
There are quite a lot.
Right now, I can think of psi, qsynth or mailody, for example. Probably, mailody is small enough to start looking into its source. I think its not in portage, but there are ebuils around. Qsynth is also small, but the fluidsynth api probably is more complicated to understand. I don't really know.
You can also look into:
http://qt-apps.org/ |
|
Back to top |
|
|
Benson Apprentice
Joined: 23 Feb 2004 Posts: 156 Location: Switzerland
|
Posted: Fri Sep 14, 2007 9:00 am Post subject: |
|
|
Did anyone actually try?
What are the benefits of compiling an app which was written for qt3 with qt4? It will use the compatibility libs, so isn't it bether to rewrite the program or parts of it? _________________ If it compiles, commit to CVS.
If it links, ship to customer.
If it runs without bugs, ..., nah, never had that case. |
|
Back to top |
|
|
enderandrew l33t
Joined: 25 Oct 2005 Posts: 731
|
Posted: Fri Sep 14, 2007 9:25 am Post subject: |
|
|
I'm also quite curious about this. _________________ Nihilism makes me smile. |
|
Back to top |
|
|
Belliash Advocate
Joined: 24 Nov 2004 Posts: 2503 Location: Wroclaw, Poland
|
|
Back to top |
|
|
Dumble n00b
Joined: 31 Aug 2006 Posts: 70
|
Posted: Wed Sep 19, 2007 4:48 pm Post subject: |
|
|
Compile Qt3 app with Qt4 is not just about linking with Qt3 support in Qt4 because you must change a lot of thing in the code : the classes used to do the compatibility are named "Q3...", so in your whole code, you must rename your classes.
I do not think that the KDE guys will lost their time to do this. But you are free to lose your own time _________________ Eternity is a very long time, especially towards the end... (S. Hawking) |
|
Back to top |
|
|
|