# pyQt or pyGTK or wxWidgets or QT ?



## Faun (Oct 4, 2008)

Am still confused as to which one I select for making applications. 

Though I like pyGTK but then platform independence is not there completely.

QT is platform independent bu IMO looks too fugly widowish GUI made for linux.

Tell me what to use, or learning which one will encompass others too.


----------



## CadCrazy (Oct 4, 2008)

T159 said:


> Am still confused as to which one I select for making applications.
> 
> Though I like pyGTK but then platform independence is not there completely.
> 
> ...



Agar meri mane to bhai QT seekh le phata phat. baki teri marzi hai. 
btw what app u wanna make ?


----------



## a_k_s_h_a_y (Oct 4, 2008)

QT ! But you will have open source your work. I hope that's ok with you.
Else GTK. Its also nice. And cool. But harder.


----------



## Faun (Oct 4, 2008)

yup it will be open source. Guess i have to give a try to pyGTK and QT. Then select the one as per the requirement.


----------



## MetalheadGautham (Oct 4, 2008)

QT is more developed than GTK. Select PyQT or just plain C++ QT.

The GUI is NOT fugly. It just depends on the theme you use. And the last thing it looks like on MY computer is windows. Check out the QT theme in KDE4 if you want to know what I mean.

I myself am trying to learn QT, and I must say I am already impressed after studying some of its theory part.

Many good software are written in QT, the most notable being Opera, followed by VLC Media Player. VLC actually SWITCHED from wxWidgets to QT4 because the later is easier to program with and has more features.

And yeah, for QT, you have two choices - use QtDesigner or KDevelop-Designer. The former is for general purpose apps (recommended) and the later is for KDE apps (only with KDE).

I recommend QtDesigner.

For GTK there is Glade.

QtDesigner is much better.

The coding can be done in any language once you produce the GUI source code using the interface designer.


----------



## Faun (Oct 4, 2008)

^^that was really helpful

Yup I see VLC has got qt interface change, and now its even more feature rich (there is one puzzle game too)

I will download qtdesigner now.


----------



## MetalheadGautham (Oct 4, 2008)

T159 said:


> ^^that was really helpful
> 
> Yup I see VLC has got qt interface change, and now its even more feature rich *(there is one puzzle game too)*
> 
> I will download qtdesigner now.


The puzzle part was videolan's idea of an easter egg.


----------



## Sykora (Oct 4, 2008)

@T159: Qt is one of the most mature toolkits available, far more than gtk or wx imo, and looks much better. The only drawback is that it's not exactly simple to learn. It took me quit some time to learn pyqt to any level of proficiency, but it got much simpler after I stopped coding everything and started using qtdesigner. 

Bottom line : use pyqt4


----------



## QwertyManiac (Oct 4, 2008)

I'll vote for PyQt4 too. And the UI it shows is pretty native to both KDE and GNOME for Linux, and Cleanlooks style works for other environments. (Use different styles using the -style parameter, QGtkStyle is seperate for now but will be included in Qt 4.5.0)

PyGTK was a nightmare to use, but was very easy to start with. But I liked the OOP concepts of PyQt over other styles of use as in PyGTK and WxPython. Not to mention the code's _completely_ cross-platform too.


----------



## MetalheadGautham (Oct 4, 2008)

@ Sykora and QwertyManiac:

I just finished with some basic part of QT as far as theory is concerned and I am VERY impressed. But I didn't start serious coding yet. I have a decent usable level of knowledge of C++ and no knowledge of python.

So I am not yet very sure if I should learn python first and then start serious QT or learn QT directly using my C++ knowledge.

What would you advice ? Currently, I am LOVING C++. Should I stick to it or move to Python ? I am terribly impressed with the concepts of python, though I didn't code much with it except very very basic stuff.

I have not yet started using external libraries in C++, and so far my programs have been limited to standard library code. Will I experence any difficulty when I start using external libraries like ncurses and QT4 ???


----------



## Faun (Oct 5, 2008)

So which IDE should I use for pyQT ?


----------



## QwertyManiac (Oct 5, 2008)

@MetalheadGautham - As long as you know your pointers and references, along with major Object-Oriented concepts like Inheritance, etc. you should do just fine with Qt and C++. Afterall it was built from scratch with the same language. The *assistant* would be more handy. 

@T159 - You could check out Eric4, its developed for PyQt4 specially and is free. I prefer a simple editor though, since *designer* and *pyuic4* does most of the GUI work for me, gedit/vim for the rest suffices.

Eclipse has a Qt 4 plugin too, but I haven't tried that out yet.

And its Qt, not QT, nor pyQt but PyQt. P's always been capital when reffering to Python-based tools.


----------



## MetalheadGautham (Oct 5, 2008)

QwertyManiac said:


> @MetalheadGautham - As long as you know your pointers and references, along with major Object-Oriented concepts like Inheritance, etc. you should do just fine with Qt and C++. Afterall it was built from scratch with the same language. The *assistant* would be more handy.


Yeah I know all those to a good enough extent. So shall I jump into Qt4 or first study python ? And would studying ncurses before studying Qt4 help me in any way ? Is ncurses easier than Qt4 ? 



> @T159 - You could check out Eric4, its developed for PyQt4 specially and is free. I prefer a simple editor though, since *designer* and *pyuic4* does most of the GUI work for me, gedit/vim for the rest suffices.


I hope Eric4 is made in Qt4 ?



> And its Qt, not QT, nor pyQt but PyQt. P's always been capital when reffering to Python-based tools.


/me kills QwertyM. TO HELL WITH SPELLING


----------



## QwertyManiac (Oct 5, 2008)

*@Metalhead-Goth-am* - Eric4 is written in PyQt4 itself, also uses the QScintillla editor widget.


----------



## MetalheadGautham (Oct 6, 2008)

And when I design GUI for my apps in QtDesigner, how do I go about editing it to make it a REAL app ? I am using C++ instead of Python since I am already familiar with it.

Does QtDesigner sport an in-built C++ IDE for its apps or is the editing done by editing the resultant source code ?


----------



## QwertyManiac (Oct 6, 2008)

There are two ways.

1. To generate appropriate source files of the GUI via *uic*. (Or by including the form files into the .pro file to let qmake do so automatically)
2. To use the *QUiLoader* class and load the .ui file directly and load it into a QWidget*.


----------



## MetalheadGautham (Oct 6, 2008)

Is there an IDE to directly code the widgets in GUI mode ? Somewhat similar to Visual C++ ?


----------



## QwertyManiac (Oct 7, 2008)

Not any I know of. But there's Eclipse and Visual Studio integration tools offered by Trolltech themselves which *might* allow that, or maybe not since Qt's philosophy differs from these click and code policies. Once you actually try Qt 4.4, you will know how that actually makes sense. There's a lot of inheritance and overloading involved in making Widgets work as you desire.


----------



## MetalheadGautham (Oct 7, 2008)

Really ?

Well, the problem is, I am kinda n00bish at reading someone else's code in C++.
So, the readability of QT 4.4 generated code worries me.

You mean to say QtDesigner outputs code which is full of empty functions in place of dialogue boxes which I need to use the "normal" way assuming they are any other function ?


----------



## Faun (Oct 7, 2008)

aye aye better learn VB then 

@QM

I found glade to be quite easy  may be I will love to work on PyQt4 and PyGTK

thanks for correcting the syntax


----------



## QwertyManiac (Oct 7, 2008)

@MetalheadGautham - No one ever reads the code Designer auto-generates. Its part of your work its doing, visually. And no, it does not work that way, it is not part of the Microsoft SDK frameworks, it has its own set of styles and rules. And these IMO are much cleaner. Qt was not developed to help a newbie programmer code easily, but rather for a good programmer to develop better code. ( And that's from #qt  )

@T159 - GTK's Glade with its (now horrid to me) Box packing style was nice, until I chanced upon QLayout in Qt's Designer 

But yep, worth knowing both. Qt's bad for commercial targets however. They charge a lot...


----------



## MetalheadGautham (Oct 8, 2008)

QwertyManiac said:


> @MetalheadGautham - No one ever reads the code Designer auto-generates. Its part of your work its doing, visually. And no, it does not work that way, it is not part of the Microsoft SDK frameworks, it has its own set of styles and rules. And these IMO are much cleaner. Qt was not developed to help a newbie programmer code easily, but rather for a good programmer to develop better code. ( And that's from #qt  )


Question #1: Microsoft ? When did it come in ?
Question #2: Then HOW do I use QtDesigner generated code ?
Question #3: Newbie ? Well, then I ask again, should I try to learn ncurses first ?


----------



## Sykora (Oct 8, 2008)

@MHG :

Q #2 :
In the case of PyQt, first you use designer to design your interface. You save that as a .ui file, which is an xml format. After that, you use pyuic to convert ui files to py files which contain classes representing the ui you created. These classes can then be subclassed to do whatever you want.


----------



## QwertyManiac (Oct 8, 2008)

#1 - Your obsession with double-click and code. Its not so flexible here, more low-level since it allows you to change the widget's behavior and the screen painting involved than just properties. You can say its more _open_ in an easy way.

#2 - Same as Sykora said applies for C++ too. Here is a simple QWidget example .ui file and its generated output you can subclass to add methods, etc, etc. I'd already explained about the two ways earlier in my posts (uic and QUiLoader)

#3 - I don't know about ncurses, it seemed pretty simple to use (esp. via Python) and what it does is way different from what Qt does. If you are interested in developing command line window applications, then do learn ncurses, nothing better than it. If its X, go for Qt. Using Qt in KDE is much more fun however, if you don't mind the dependencies.


----------



## MetalheadGautham (Oct 9, 2008)

QwertyManiac said:


> #1 - Your obsession with double-click and code. Its not so flexible here, more low-level since it allows you to change the widget's behavior and the screen painting involved than just properties. You can say its more _open_ in an easy way.
> 
> #2 - Same as Sykora said applies for C++ too. Here is a simple QWidget example .ui file and its generated output you can subclass to add methods, etc, etc. I'd already explained about the two ways earlier in my posts (uic and QUiLoader)
> 
> #3 - I don't know about ncurses, it seemed pretty simple to use (esp. via Python) and what it does is way different from what Qt does. If you are interested in developing command line window applications, then do learn ncurses, nothing better than it. If its X, go for Qt. Using Qt in KDE is much more fun however, if you don't mind the dependencies.


1. I am NOT obsessed with double click and code. I just want the output to be readable enough so that I can code comfortably. Infact, I have NEVER EVER used double click code in my life, and I don't want to try new things in a time when I already know some other way (text code) which is anyway the recommended way to code.

2. Hmm... appears neat. Atleast, it appears simple enough, such that even a n00b like me is able to read it and understand it. I guess I might start coding in it afterall...

3. Well, I just LOVE ncurses based GUIs. Because that doesn't need much dependencies and can be run even on a bare bones distro. I have used several ncurses programs myself and I feel that given the right purpose, they needn't be inferior to X programs at all. And yeah, I too like Qt in KDE, but I want it to be runnable on Gnome as well, since my user base might also consist of gnome/gtk fanboys.


----------



## QwertyManiac (Oct 9, 2008)

You perhaps didn't quite get what I meant by Qt in KDE. Try for yourself and see. 

Why was curses named so anyway? The answer keeps me away from it. *elouai.com/images/yahoo/54.gif


----------



## MetalheadGautham (Oct 9, 2008)

QwertyManiac said:


> You perhaps didn't quite get what I meant by Qt in KDE. Try for yourself and see.


You mean Kwin-composite effects ? Or KDE themes ? Or something I missed out ?


----------



## aditya_v (Oct 10, 2008)

There is somethin i would like to add to this topic:
I had to face this debate last yr too. I choose GTK because its more widely used and all the Linux mobile platforms are based/derivatives of Gtk. Since the x86 mobile market is going to rapidly develop by next year, i started developin apps using Gtk + clutter for UI.


----------

