Qt

The place to discuss creating, porting and modifying Celestia's source code.
Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Qt

Post #1by marc » 24.02.2004, 13:29

This relates more to my project but I thought I'd post here to get some feedback.
One of the major tasks I have with Mostly Harmless is discarding Celestia's existing user interface(s) and designing a new one for the game. Rather than have three different versions I want to make it cross platform from the start. (please, Im not having a go at Celesitas UIs here, I understand how they have evolved)
I was originally planning on using Plib/Pui http://plib.sourceforge.net/pui/index.html but more recently I have been looking at trolltech's Qt http://www.trolltech.com/.
One of the nice features is that Qt has database aware widgets which will fit in nicely with my database work. Another reason for this choice is that I think that skills in Qt/SQL will be a good career move.

I understand that the KDE version of celestia already has some qt code in it so once i get hold of qt free for windows the first thing I want to try is compiling a KDE/qt version of Celestia for windows. (whether this will work or not I have no idea)
One disadvantage that I see with Qt is that the free version for windows is not widely available. ( I hope to have version 3.2 soon with a book I've ordered). This means that it will not be easy for users to compile for windows. As far as I can tell there are no problems with distributing the binaries.

Anyway, to ask some questions of the celestia developers. Has anyone had any experience with Qt? If so what are your thoughts?

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Re: Qt

Post #2by Christophe » 24.02.2004, 19:03

marc wrote:One disadvantage that I see with Qt is that the free version for windows is not widely available. ( I hope to have version 3.2 soon with a book I've ordered). This means that it will not be easy for users to compile for windows. As far as I can tell there are no problems with distributing the binaries.

Anyway, to ask some questions of the celestia developers. Has anyone had any experience with Qt? If so what are your thoughts?


There is no Qt Free edition for Windows, the package you will get with your book is most certainly the evaluation version (valid for 30 days) which you can also download from Trolltech's website.

To release Windows software linked with Qt, you need to buy a commercial licence from Trolltech, no way arround it. Qt Free used to be available from Trolltech under the GPL but there was too much abuse from companies/shareware developers using Qt Free for closed source products.

Another option is to use the Qt/X11 port to Cygwin:
See http://kde-cygwin.sourceforge.net/ That'd be fun! :-)

On the other hand GTK2 is available for Windows (native) under the LGPL, and we already have a GTK2 interface, it should be relatively easy to make it compile under Windows (at least, that's where I would start).
http://www.gimp.org/~tml/gimp/win32/
Christophe

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #3by don » 24.02.2004, 19:14

Another one to possibly look at is wxWidgets (http://www.wxwidgets.org). It's OpenSource and cross-platform.

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Post #4by marc » 24.02.2004, 22:36

Thanks for the links guys. The Qt/X11 port looks interesting and I wasn't aware of wxwindows. I've looked at GTK but I will look into it further.

I swear that a description of the book said 'contained a non-commercial version of Qt 3.2 for win available no where else' It would seem strange that they would offer a book that has software on it that only lasts 30 days.
Then again non commercial probably does not mean GPL. Wait and see I guess. :)

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #5by don » 24.02.2004, 22:43

GTK is Windows<-->Unix/Linux cross-platform, but I'm not sure if the Mac can use it or not. wxWindows / wxWidgets also includes built-in database support, on-line help support, and tons of other goodies -- along with doing GTK, Windows and Mac, in supposedly "native" fashion. Haven't used it myself though, so I can't comment on it's long, established history.

Good luck in your search!

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Post #6by marc » 24.02.2004, 23:44

Ok, some first impressions.
If there is no GTK for Mac/OS X then its out.
wxWindows only supports OpenGl on windows and unix so far. And it looks like genearal support for OS X is still in development.
Mabey ill just abondon windows all together, I've had enough grief with viruses lately to justify it. :evil: The Qt/X11 port looks good.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #7by don » 25.02.2004, 00:04

Thanks for the info marc.

I thought X11 ports were basically for hand-held devices these days, no? Or, since you will actually be creating your own GUI, it will provide a good base from which to create it?

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #8by selden » 25.02.2004, 01:46

Don,

Your comment suggests that perhaps you weren't aware that X11 is the underlying windowing technology used by all Unix and Linux systems (and VMS, too, for that matter :) )

GUIs like Motif, CDE, KDE and Gnome run on top of X11. There are several commercial vendors of X11 for Windows, and it's included in Cygwin, of course. In the Windows environment, X11 is primarily used as a way to provide interactive access to multi-user servers and supercomputers, although there is at least one project working on providing KDE as an alternative to Windows' Explorer interface.

MacOS X is somewhat similar to Windows in that it has a preferred proprietary GUI, but since it's based on Unix, X11 and alternative GUIs can be used, too.

If X11 is being used for handheld devices, too, I suspect that it's just demonstrating its flexibility.

I'm not sure this answers any question you were implying, but I just couldn't help responding... :)
Selden

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #9by don » 25.02.2004, 02:09

Thanks Selden. Yes, I knew this about X11. However, I didn't think anyone was actually using X11 by itself, as a cross-platform GUI. But rather using it as a "base" for creating one's own GUI, such as with X11-->Qt-->KDE (based on my limited understanding of KDE).

I've read a lot about X11 ports being used for handhelds lately, which is why I wondered (out loud) about it's current use.

Cheers,

-Don G.

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #10by selden » 25.02.2004, 02:21

Don,

Ok, now I understand where you're coming from :)

I think you're quite right that, by itself, X11 is not a GUI. Rather, it provides a way to transport GUIs across the network from one platform to another. Or to the same platform.

If not now, then very soon you'll be able to buy a cellphone that can act as a terminal to your local supercomputer. Running a multi-threaded version of Celestia, of course :)
Selden

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #11by don » 25.02.2004, 04:32

Cell phone? What's that? We gave ours up for Lent -- two years ago. :lol:

I don't know if a CCD for video capture and a 2" square LCD are up to the task of handling Celestia. But you're right, maybe tomorrow. :wink:

Hey, maybe someone will embed Celestia onto a chip?!

-Don G.

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Post #12by marc » 25.02.2004, 13:10

Sorry to be a smart-arse Christophe. These links confirm that the book comes with an almost fully funcitonal non-commercial version of Qt for windows. Its not quite free and open source, but I can release non-commercial software with it.
http://dot.kde.org/1076068778/addPostingForm
http://developers.slashdot.org/comments ... id=8181832
All that is is missing is ODBC and MySQL. I've been getting good at the MySQL C api so this shouldn't be a problem.

If I do it right I'll be able to hack away using MSVC and not have to worry about portablility.
Whoopee!

:D

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #13by Christophe » 25.02.2004, 14:42

marc wrote:Sorry to be a smart-arse Christophe.

Not at all, I think this is very good news for all free software developers!

The only problem I see here is that if the licence is not the GPL then it is not legal to link Celestia against it. You'll need to get Chris and all the Celestia authors to agree to add an exception clause explicitly allowing you to do it.

marc wrote:If I do it right I'll be able to hack away using MSVC and not have to worry about portablility.
Whoopee!


Hum, I sure wish you were right. But no matter what, you will have to worry about portability, if only for the build system.
Christophe

Paolo
Posts: 502
Joined: 23.09.2002
With us: 22 years 1 month
Location: Pordenone/Italy

Post #14by Paolo » 25.02.2004, 21:46

Hi Marc

My small opinion is that these kind of UI's are suitable for an application and not for a game. :wink:

Bye - Paolo
Remember: Time always flows, it is the most precious thing that we have.
My Celestia - Celui

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Post #15by marc » 26.02.2004, 00:03

Christophe, was a little confused with this, but had another read of the gpl faq and It makes perfect sense.
For any others here it is. http://www.gnu.org/licenses/gpl-faq.htm ... GuzzlerInc

I might try it out for my own educational purposes, but I will not release any windows binaries unless the Celestia developers decide to put an exception in for the Qt windows library.
I will not ask yet, as I still have plib/pui as an option. I will only decide once I have learned a bit more and properly compared the pros and cons.

I should rephrase that to 'not worry as much'. As for a cross platform build system apache ant should help, which I am already familiar with.

Paolo, I will end up having five or six windows that all have a number of widgets in them, Also I want to learn Qt as part of my self education. The styles can be changed significantly so it doesnt look like a regular app. Qt also provides other things which may be useful such and sound and multiple language support.

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #16by don » 26.02.2004, 02:18

I yi YI ! A person has to be a lawyer to read and understand all of that. Yikes!

I guess the bottom line with Celestia, is that everything else used *with* it MUST BE GPL/GNU licensed, right?

Topic author
marc
Posts: 426
Joined: 13.03.2002
With us: 22 years 8 months
Location: Outback Australia

Post #17by marc » 26.02.2004, 04:41

Let me know if I get anything wrong here Christophe.

Not everything that touches celestia needs to be GPL. ,using public domain is OK (Lua) and so is LGPL (plib). Sourceforge has a list of OpenSource approved licences.
The way I see it, long as any user can get for free all the bits required to compile a derivative work then its Ok. (however, im not sure if this specifically means source code)
Its more to prevent someone deriving a work from celestia and using a closed source library to prevent others from expanding on thier work.
Qt is a tricky one as it is has GPL'd versions for linux and mac but not so for windows. I can develop a Qt version but I cannot (and will not) release a windows binary unless the stuff to compile it on windows is freely available. (I am buying a book to get it). Or the Celesita developers agree on an exception for linking to the windows Qt library.

The other solution is the Qt/X11 port to Cygwin which Christophe pointed out. http://kde-cygwin.sourceforge.net/ I want to investigate this further to see if it is as good as the real stuff.

This is the least of my legal worries, I still have to tip-toe around Elite copyright issues, of which many elite sequels/clones have died a nasty death from.
I want players to be able to recognise Elite/Frontier elements but I dont want to infringe on copyright. Because it is free I have an advantage, I'm also lucky enough to have a smart solicitor for a sister to help me if I need it. I'm thinking way in the future here however, I may never get this far.
:wink:

don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #18by don » 26.02.2004, 07:49

Wow, sounds like you have certainly done your homework Marc! 8O ... Nice to have a lawyer in the family too. :wink:

I did not realize "Elite" was an existing space game. Just looked it up on the net and read about its long history. Shows you how little I play games anymore. :( ... You certainly don't pick easy projects, do you? 8O :lol:

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #19by Christophe » 26.02.2004, 09:08

Just some clarifications, take it with a grain of salt as I am not a lawyer.

marc wrote:Let me know if I get anything wrong here Christophe.

Not everything that touches celestia needs to be GPL., using public domain is OK (Lua)

Lua is not public domain, it is licenced under the MIT Licence, see http://www.lua.org/copyright.html.

The MIT Licence is GPL compatible, which means that you can link an MIT Licenced library in a GPL project.

marc wrote: and so is LGPL (plib).

Yes, the LGPL was explicitly designed to be GPL compatible.

marc wrote:Qt is a tricky one as it is has GPL'd versions for linux and mac but not so for windows. I can develop a Qt version but I cannot (and will not) release a windows binary unless the stuff to compile it on windows is freely available. (I am buying a book to get it). Or the Celesita developers agree on an exception for linking to the windows Qt library.

That's my understanding too.

marc wrote:The other solution is the Qt/X11 port to Cygwin which Christophe pointed out. http://kde-cygwin.sourceforge.net/ I want to investigate this further to see if it is as good as the real stuff.


You'll have to check if OpenGL is supported and if the port is fast enough for Celestia. Cygwin is not known for it's performance...
Christophe

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #20by t00fri » 26.02.2004, 15:53

Christophe wrote:
...

marc wrote:The other solution is the Qt/X11 port to Cygwin which Christophe pointed out. http://kde-cygwin.sourceforge.net/ I want to investigate this further to see if it is as good as the real stuff.

You'll have to check if OpenGL is supported and if the port is fast enough for Celestia. Cygwin is not known for it's performance...


I have Cygwin installed on my XP-Laptop since about 3 months. I love it for my professional work while I am travelling, since with an icon click I can switch between my familiar (AA'ed) X11 Linux environment and XP. Notably I can mix native Windows applications without problems within Cygwin! When I prepare a talk, for example, I do the formulae in PDF-Latex, that automatically converts my eps figures into (good quality) PDF.
The illustrations I do with 'xfig', with PDF output.
These then I import into Powerpoint via ADOBE Reader or ADOBE 6.0. This way the deficiency of Powerpoint of not handling math well is gone and I can use my many *.eps figures from UNIX.

And I can also do personel-administration tasks with Word, Exel etc while travelling, without rebooting!

Cygwin is using the latest Linux applications and is very stable. Compiling works well, including OpenGL. Still, this part is not yet entirely up-to-date and the performance is indeed slower. Also the compilation speed is definitely slower. It's quite fine for everyday work.

Bye Fridger


Return to “Development”