LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 02-13-2009, 02:38 AM   #16
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Original Poster
Rep: Reputation: 32

But why does it need GTK libraries instead of Qt libraries???
 
Old 02-13-2009, 03:53 AM   #17
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
?? Do you know programing? Gtk has its own API, Qt has its own API, and they are different…
Or did I not understand the question?
 
Old 02-13-2009, 04:27 AM   #18
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Original Poster
Rep: Reputation: 32
Then is Firefox made on GTK+? And why isn't it made on Qt?

and if i make a Qt application then i need to install Qt libraries on ubuntu to run my qt application?
 
Old 02-13-2009, 05:04 AM   #19
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
Exactly yes. As for why… Why is Colin McRae Rally done on win32 and directX instead of glibc and SDL? Who knows… Each developer/company has their preferences.

Yves.
 
Old 02-13-2009, 06:11 AM   #20
QueenZ
Member
 
Registered: Sep 2008
Distribution: openSUSE, Ubuntu
Posts: 372
Blog Entries: 2

Original Poster
Rep: Reputation: 32
OK, so you guys said that most distros have gtk+ libraries already installed with them? Right? Do most distros also have Qt libraries installed with them? Is GTK+ more popular than Qt? (That's 3 questions..)
 
Old 02-13-2009, 06:21 AM   #21
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by QueenZ View Post
Then is Firefox made on GTK+? And why isn't it made on Qt?
Ask firefox developers.

Quote:
Originally Posted by QueenZ View Post
and if i make a Qt application then i need to install Qt libraries on ubuntu to run my qt application?
Only if application isn't statically linked with Qt.

Quote:
Originally Posted by QueenZ View Post
OK, so you guys said that most distros have gtk+ libraries already installed with them? Right? Do most distros also have Qt libraries installed with them? Is GTK+ more popular than Qt? (That's 3 questions..)
Yes, most distros have distributions have gtk.
There is two version of Qt - Qt 3 and Qt 4. Qt 3 is installed if distribution uses KDE 3 or if there are packages that require it, Qt 4 is installed if distribution uses Kde 4, or if there are applications that require it. Normally distributions has both libraries installed.

Anyway, I wouldn't rely on popularity to pick GUI toolkit. Qt 4 is best known (to me) gui toolkit for C++. Gtk is suitable for C programming. Use library you most comfortable with.

Stop worrying about dependencies.
Your distribution have automatic dependency checking - i.e. if you make *.deb that specifies that your software requires Qt 4, package manager will download and install Qt 4 if necessary. Use whatever library you want, just specify dependencies in README or INSTALL document (for people that build from source), and within your *.deb package, and you will be fine.
 
Old 02-13-2009, 08:35 AM   #22
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Quote:
Originally Posted by ErV View Post
Normally distributions has both libraries installed.

Stop worrying about dependencies.
Your distribution have automatic dependency checking - i.e. if you make *.deb that specifies that your software requires Qt 4, package manager will download and install Qt 4 if necessary. Use whatever library you want, just specify dependencies in README or INSTALL document (for people that build from source), and within your *.deb package, and you will be fine.
Finally, I get a chance to say: You're wrong.

You should worry about dependencies especially with qt, because as ErV says there is qt3 and qt4. Many distributions have only one installed, and although there exist packages for the other consider the fact that a full install of qt4 is about 900 MB in size. Please do take into account these factors, because it will dictate your user base. Personally I will not install qt4 just to run 1 program, nor will I install qt3 if most programs have already been ported to qt4. IMO, qt is not the best option, unless you want to make KDE-specific programs.

I would use GTK+ because it doesn't have any correlation with a window manager (unlike KDE-QT). I can say that 99 % of desktop Linux users have GTK+ installed. You can't get around it because so many programs depend on GTK+. If you want to program in C++, then use gtkmm, most people will have that installed as well.

Note: I am biased against KDE and QT, they are bloated s***, IMO.
 
Old 02-13-2009, 09:38 AM   #23
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by H_TeXMeX_H View Post
Finally, I get a chance to say: You're wrong.
I'm not.
Unless newbie will go berzerk and gather few hundreds of external dependencies (which is unlikely), it isn't important. The more important thing is to pick reasonable gui toolkit which won't drive you nuts later.

Quote:
Originally Posted by H_TeXMeX_H View Post
You should worry about dependencies especially with qt, because as ErV says there is qt3 and qt4. Many distributions have only one installed, and although there exist packages for the other consider the fact that a full install of qt4 is about 900 MB in size.
900 megabytes is installation size for developer, not end user.
By removing documents, examples, demos and debug versions of libraries, installation size can be easily reduced to 79 megabytes (and probably even further - by killing Qt assistant, designer, stripping all binaries and so on). This is uncompressed size, in *.tar.bz2 it will be 23 megabytes. This is the size it will take for user package. Another thing is that Qt application can be deployed with all required Qt 4 libraries (on Windows platform, for example), and basic app will need only three or four of them. Or you could use static linking, as Opera did. See installation size of opera static package on linux, for example - no installation of Qt is required to run opera.
Also Qt 3 and Qt 4 don't conflict.

Quote:
Originally Posted by H_TeXMeX_H View Post
Please do take into account these factors, because it will dictate your user base. Personally I will not install qt4 just to run 1 program, nor will I install qt3 if most programs have already been ported to qt4. IMO, qt is not the best option, unless you want to make KDE-specific programs.
It is best option for developer. Most sane GUI development toolkit I know.
It is more flexible, and it allows to create nicer-looking applications (which is important in certain situation). Take a look at qtdemo (included in full installation - example of all available technologies), for example. I never seen anything even close to that being developed in GTK. Qt 4 doesn't limit what you can do. You can make any widget you can think of. And it is fast, and has opengl support.

Quote:
Originally Posted by H_TeXMeX_H View Post
I would use GTK+ because it doesn't have any correlation with a window manager (unlike KDE-QT).
Have you ever wrote program for Qt 4?
Qt 4 doesn't have correlation with window manager. To develop KDE application you use another set of libraries. Qt != KDE, as GTK != Gnome. You can make purely KDE or purely Gnome application, and it will be hell to build on some systems (example: GnuCash on slackware), but they won't be purely Qt or purely GTK applications. Besides, upgrading GTK+ is much more "fun" than upgrading Qt. GTK has 3 or 4 external dependencies that has to be built in certain order (pango, cairo and something else). Qt 4 has no such dependencies. Besides certain gtk plugins make life even funnier (gdkpixelbuf, I think?). I wouldn't use GTK unless i have to develop GUI using pure C only.

No offfence, but it doesn't look to me like you have much experience in Qt 4 programming. So I'd recommend to keep aside.

Last edited by ErV; 02-13-2009 at 09:53 AM.
 
Old 02-13-2009, 11:14 AM   #24
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
I know QT != KDE, but all KDE apps use qt. GNOME uses GTK but also a ton of other dependencies.

You're right I have never used qt4, but then I never made any quality-based comment on it.
 
Old 02-13-2009, 02:14 PM   #25
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by H_TeXMeX_H View Post
but then I never made any quality-based comment on it.
If you have 900 megabyte installation of Qt 4, then you have qtdemo application (located in /usr/local/Trolltech/Qt-4.*/bin/ folder). Launch it, scroll through menu, check examples, and it will be obvious which toolkit is more powerful. With all due respect to other toolkits, I haven't see anything like it implemented with another toolkit (non-Qt).
From programmer's point of view - even if they have made custom preprocessor, their signal/slot model makes a lot of sense, and whole library is pretty clean/easy to use.

The only problem with Qt 4 is its' license - you can't create closed-source application with it for free (but I heard something about Nokia changing licensing term to LGPL in future, so this problem might soon disappear), only GPL-licensed software. Several other toolkits have less restrictive licenses (wxWidgets, fox toolkit), but they don't even stand close to Qt in terms of quality.
 
Old 02-13-2009, 03:22 PM   #26
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Quote:
Originally Posted by ErV View Post
If you have 900 megabyte installation of Qt 4, then you have qtdemo application (located in /usr/local/Trolltech/Qt-4.*/bin/ folder). Launch it, scroll through menu, check examples, and it will be obvious which toolkit is more powerful. With all due respect to other toolkits, I haven't see anything like it implemented with another toolkit (non-Qt).
From programmer's point of view - even if they have made custom preprocessor, their signal/slot model makes a lot of sense, and whole library is pretty clean/easy to use.
Thanks, didn't even see it till now. Indeed, I haven't seen anything like this either from a GUI toolkit. I'm just wondering when would this normally be used ? Now I know why hedgewars uses it ... they made a game with it.
 
  


Reply

Tags
desktops, kdevelop, programming


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: The cross-platform option: Developing Web applications for smartphones LXer Syndicated Linux News 0 01-21-2009 08:20 AM
Cross Linux From Scratch 5.7: Problems Making binutils-2.18 Yaro Linux From Scratch 3 11-12-2008 04:00 AM
Developing cross platform applications Principher Programming 7 08-27-2006 02:35 PM
Cross-platform, the road to Linux applications wyo Linux - Software 9 12-27-2005 10:10 AM
Static Bind Applications to Kernel; cross compilation Alybyzrp Linux - Newbie 0 11-25-2003 02:38 PM


All times are GMT -5. The time now is 04:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration