Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Way to hack qt3 ebuilds to compile against qt4/qt3_support?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
StifflerStealth
Retired Dev
Retired Dev


Joined: 03 Jul 2002
Posts: 968

PostPosted: Fri Aug 31, 2007 1:12 pm    Post subject: Way to hack qt3 ebuilds to compile against qt4/qt3_support? Reply with quote

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. :D That could mean some improvements in speed and not to mention some new graphical looks ... in some cases. :P

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
View user's profile Send private message
intmain
Apprentice
Apprentice


Joined: 14 Dec 2005
Posts: 179
Location: Austria

PostPosted: Fri Aug 31, 2007 2:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
StifflerStealth
Retired Dev
Retired Dev


Joined: 03 Jul 2002
Posts: 968

PostPosted: Fri Aug 31, 2007 3:15 pm    Post subject: Reply with quote

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? :P 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. :P

Thanks for your reply. I hope we can get to the bottom of this. :D
Back to top
View user's profile Send private message
intmain
Apprentice
Apprentice


Joined: 14 Dec 2005
Posts: 179
Location: Austria

PostPosted: Fri Aug 31, 2007 3:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
StifflerStealth
Retired Dev
Retired Dev


Joined: 03 Jul 2002
Posts: 968

PostPosted: Fri Aug 31, 2007 3:41 pm    Post subject: Reply with quote

I don't know how to. :oops: 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
View user's profile Send private message
intmain
Apprentice
Apprentice


Joined: 14 Dec 2005
Posts: 179
Location: Austria

PostPosted: Fri Aug 31, 2007 4:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
i92guboj
Bodhisattva
Bodhisattva


Joined: 30 Nov 2004
Posts: 10315
Location: Córdoba (Spain)

PostPosted: Fri Aug 31, 2007 5:00 pm    Post subject: Reply with quote

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
View user's profile Send private message
Benson
Apprentice
Apprentice


Joined: 23 Feb 2004
Posts: 156
Location: Switzerland

PostPosted: Fri Sep 14, 2007 9:00 am    Post subject: Reply with quote

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
View user's profile Send private message
enderandrew
l33t
l33t


Joined: 25 Oct 2005
Posts: 731

PostPosted: Fri Sep 14, 2007 9:25 am    Post subject: Reply with quote

I'm also quite curious about this.
_________________
Nihilism makes me smile.
Back to top
View user's profile Send private message
Belliash
Advocate
Advocate


Joined: 24 Nov 2004
Posts: 2503
Location: Wroclaw, Poland

PostPosted: Fri Sep 14, 2007 10:07 am    Post subject: Reply with quote

let me know when you manage to build kde 3 with qt4 ;]
_________________
Asio Software Technologies
Belliash IT Weblog
Back to top
View user's profile Send private message
Dumble
n00b
n00b


Joined: 31 Aug 2006
Posts: 70

PostPosted: Wed Sep 19, 2007 4:48 pm    Post subject: Reply with quote

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 :wink:
_________________
Eternity is a very long time, especially towards the end... (S. Hawking)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum