Home > Qt > Rapid Application Development with QT Rapid Application Development with QT Eugenia Loli 2003-11-07 Qt 41 Comments One popular Open Source RAD tool is QT Designer which is part of the QT package. If you run the KDE desktop, QT will be installed already, and QT Designer may be installed as well. DevChannel features the tutorial. About The Author Eugenia Loli Ex-programmer, ex-editor in chief at OSNews.com, now a visual artist/filmmaker. Follow me on Twitter @EugeniaLoli 41 Comments 2003-11-07 3:28 am Qt simply rocks 2003-11-07 3:37 am If only there were an updated non-commercial version for Qt… wxWindows fills this gap. 2003-11-07 4:18 am Check out the most recent dot.kde.org for an aritcle on PyQt and PyKDE. These are Python bindings for Qt and KDE. Together wth Qt Designer, it forms one of the most powerful GUI RAD frameworks out there. Python is an extremely productive programming language (thanks in large part to its suitibility to interactive development) and is very well-suited to GUIs. Plus, it has excellent C/C++ bindings (especially via Boost.Python and Pyste) which means you can design your GUI visually in Qt designer, implement the GUI logic in Python, and write any performance-sensitive back-end logic in C++. Wonderful. I only wish I got more chances to work in application-land and use it 2003-11-07 4:20 am There some things I could nit pick about Qt Designer. One of them is it creates containers and layout managers uneccessarily sometimes which leads to more code and thus larger binaries. It also overwrites my source files, removing changes I’ve made. For example, if I design my GUI app and then add app specific code to it, then go back to tweak the GUI a little, the changes I made are gone and the source file is left with just the boiler plate code. Yes I know I should be putting app specific code (message handlers) into the ui.h (or something like that) file but I prefer to take the outputted source files and put them into a KDevelop project. Luckily, GUI code in Qt is pretty straight forward so it’s possible to leave Qt Designer at some point and code the rest by hand. 2003-11-07 4:20 am Wasnt there a guy who just left MS and started his own company. The idea that this guy was to create an enviroment where people could do the programming themselves. The programmer would create the tools and users would use their knowledge and experiences to create a program with said tools. Perhaps the guys and MS have not heard of QT? I also think the article said that they would have a product for years. Hmm.. Maybe we should send him (and MS guys/gals) the link to OSNews… Just a thought. 2003-11-07 4:29 am wxWindows is nice…I am amaised at how well it uses the native display style. any pics of QT? 2003-11-07 4:37 am “Perhaps the guys and MS have not heard of QT? I also think the article said that they would have a product for years. Hmm.. Maybe we should send him (and MS guys/gals) the link to OSNews… ” You’re joking, right? QT Designer is nothing more (in basic terms) than any of the Visual Studio IDEs or Glade. That’d be like claiming that, hey, I can make a complete GNOME program in Glade without touching source code. I can, but said program won’t do much, if anything at all. QT is just another API, and frankly, one that seems rather outdated in some ways compared to GTKmm. Not their fault, since QT was started earlier, but holding up QT as an example of a great modern toolkit that everyone should be using is a joke. Microsoft and everyone else has heard of QT, but there’s not much that it provides that’s all that special. Want cross-platform? Use wxWindows. Want clean, object-oriented code that actually uses the STL? Use GTKmm. Like I said, QT ain’t bad, in fact, it’s quite nice, but it is over-rated in some ways. -Erwos 2003-11-07 4:39 am I don’t see how wxWindows or GTKmm are ebtter than the Qt package overall, besides GLADE really sucks compared to Qt Designer. 2003-11-07 5:10 am Kdevelop all the way dude… 2003-11-07 5:31 am GTKmm is nicer for C++ programmers because it actually uses the STL, but Qt is a better toolkit. More features, more well thought-out, more well-documented. Its also got better cross-platform capabilities, and in my experience anyway, performs a lot better in Linux. Qt not using the STL is irritating at first, but you get over it real quick. Most of the Qt containers have pretty STL-like interfaces anyway, so its not a huge deal. 2003-11-07 5:40 am The one thing that I never liked about QT was MOC(the QT preprocessor). Yeah, I know QT was started before c++ even had a standard and therefore didn’t use a more modern callback mechanism, such as GTKmm uses, but to me it’s always been annoying. The problem with GTKmm is that whether you like it or not its always been a second-class citizen to programming GTK/Gnome apps in straight c, which is really a shame because GTKmm seems to be a really nice toolkit. The other problem(to me even a bigger problem) is that most people aren’t going to have the gtkmm libraries installed. Anybody that uses KDE, and probably most people that use Gnome, are going to have the QT libraries. Also(and this goes for straight gtk+ too) is that the windows libraries have never been as mature as QT’s libraries for windows. I have high hopes for the new KDevelop. I haven’t used it in a while, but I always had problems with the seemingly unlimited number of dependencies that it required. I hope they have decent code-completion(intellisense) and smart indenting in it now. Previously when I tried it, and it had already been out for a few years, it didn’t even do smart-indenting. I’m sure this has been rectified by now though. One thing that has always bothered me about linux programming in general are the rather primitive development tools that they use. Yeah, some people swear by Emacs and Vim, and I’ve done a lot of c/c++ development using vim, but it’s just too painful to do say java or c# development using emacs or vim after using Eclipse, IDEA, or Visual Studio. Anyway, that’s my $0.02 2003-11-07 5:43 am There seems to be too many libraries needed to do work with pyQT at the moment. 2003-11-07 5:53 am vim and emacs aren’t primitive. They’re old, but considering that Java and C# (*) developers still haven’t figured out decades-old features like interactive development, I honestly can’t say that they’re in any position to talk about good development tools. Anyway, the stuff that the Java and C# folks are just now rediscovering, like refactoring editors and code browsers, are already available for emacs (and to a lesser extent vim). They’re not as polished as the commercial equivlients (they’re not mainstream and don’t have big development teams behind them) but they can be a lot more efficient because they ditch the inefficiency of a GUI. 2003-11-07 6:06 am The real problem with Emacs and Vim are that they are old and they are general-purpose editing tools. Look at something like intellisense, which MS, has had for ages now. Emacs just recently got it for java from XRefactory and it’s been a pain because of the way emacs was coded. Look at the mailing lists. Vim has intellisense for java on windows only because the plugin system is so limited. Using shared libraries in vim doesn’t even really work except for windows. There’s only so far you can go with the limited vim plugin system. In any case, going back to vim or emacs after working with Eclipse and IDEA is masochistic. By the way, you can leave the “Lisp had this feature before God” speeches for the slashbots. Professional developers need to get work done and not mentally masturbate about how great Lisp is. 2003-11-07 6:23 am and thit thays thawt Eclipsth runth perthect on my Gentoo systhtem. 2003-11-07 6:34 am The problem with GTKmm is that whether you like it or not its always been a second-class citizen to programming GTK/Gnome apps in straight c, which is really a shame because GTKmm seems to be a really nice toolkit. The other problem(to me even a bigger problem) is that most people aren’t going to have the gtkmm libraries installed. Anybody that uses KDE, and probably most people that use Gnome, are going to have the QT libraries. Also(and this goes for straight gtk+ too) is that the windows libraries have never been as mature as QT’s libraries for windows. Maybe that could be an issue for you to raise to the gtk release engineers in that, rather than the two libraries being released at two seperate projects, the two should combine so that there is a combined gtk/gtkmm release in one tar ball so that anyone who downloads it has c++ instantly, even those who use sourced based distros, and those who use mainstream distros automatically will get it when the gtk package is bundled. Once GTK-sharp is stablised then merge it into the main gtk tree so that there is a “grand-unified” tar ball containing all the supported languages in one ball of code. Sure, it may slow down the release dates as it would take longer for all the developers to get into sync, however, it will help the end user knowing that what every language their gtk application is written in, they don’t have to worry about downloading extra libraries. 2003-11-07 6:36 am Um, when did I use the mention Lisp? Methinks you’ve got some bitter grapes of your own. Anyway, its not just Lisp. Smalltalk did refactoring, GUI-based development, and class browsers decades ago. Apple’s Dylan was really a breakthrough IDE system — not hugely innovative, but it wrapped up a lot of previous development. Functional Developer (for Dylan) is still an excellent environment that’s very powerful considering the tiny community that supports it. Anyway, vim and emacs are extremely powerful tools. If their Java or C# support are below-par, its probably due to a lack of developer interest than anything else. Don’t know a whole lot of Java developers uisng emacs. ILISP is probably a good example of the extremely powerful interface you can get on the emacs model. Their respective C/C++ tools are pretty good too — you don’t get refactoring support, but I don’t know of any other refactoring C++ editors either. 2003-11-07 7:24 am Qt Professional: $1500 M$ Visual Studio Professional: $1079 IMHO the M$ Visual studio better investment for an average programmer who want money for his product… 2003-11-07 8:07 am @coocachoo – Your idea about bundling the libraries for the other major language bindings seems reasonable, especially since either Owen Taylor or Havoc Pennington have stated that for normal gtk+ development it’s probably wise to use another language binding. On a somewhat related note, I heard that gtk+/gnome libraries will be combined in the future. I think this is a good idea. @rayiner – Ok, maybe I was a little hash with the Lisp comments, but I know you’ve brought up Lisp before on more than one occasion when discussing programming languages. As I stated before, I’ve used vim and it’s pretty good for c/c++ development. About every 6 months or so I would try and learn emacs but I always felt that I needed a few more fingers to be effective in it;) I’d rather stick with vim than the whole emacs alt-meta-blah combo. Vim is pretty powerful in that it has powerful customizations, but I differentiate the customization with real extensibility. As I stated before, it’s next to impossible to use shared libraries for vim on non-windows systems. Yeah, I think you’re right about c++ refactoring tools for editors. I think the reason is the complexity of the language and also the GCC team hasn’t “opened” up parts of the compiler that would make it easier for IDE/editor programmers to integrate a c++ parser into the IDE/editor for things like intellisense and refactoring. 2003-11-07 8:13 am This what I call bloatware, install a desktop environment and get a full devoper environment. 😉 2003-11-07 8:31 am I agree with LC on the price issue. Qt is simply too expensive for what it offers you. Gtkmm is a good toolkit you get for free with advantages that have been mentioned here before. While programming in Qt is very comfortable, I don’t see a bright future for Qt, since most IT companies I know that develop for Linux favour Gtk over Qt simply for the hefty price tag of Qt. I mean it’s just a GUI library, you have to pay $2330,- for. Cross platform code is another issue, there I’d choose Qt as long as Gtk has not matured. But then – bye bye Qt … 2003-11-07 9:05 am Fine, VS is cheaper, now where are the VS build options for OSX, Unix and Linux 2003-11-07 9:08 am Bring the price of Qt in relation to the costs of a software designer. If the usage of Qt lets finish the project earlier due to more productivity, then the (small compared to the software designer’s costs) price is a non-issue. Take a look what other development tools cost (for example Rational tools). Qt is cheap. 2003-11-07 9:48 am I’ve been looking at Qt for some time, and I have yet to see what’s so hot about it, and how its meant to boost productivity or justify its price. Its a nice toolkit, but for a price tag of $1500~, its had better be! The poster LC mentioned that even MS VS.Net is cheaper than Qt. Use that, and a toolkit like wxWindows, and you’ve got a great IDE, with cross platform capability which costs less than the price of a license to run Qt on 1 platform. 2003-11-07 9:48 am “Qt is simply too expensive for what it offers you. Gtkmm is a good toolkit you get for free with advantages that have been mentioned here before. ” Do i need to remind you that there is a GPL version of QT fot X-11 and OS X ? If you want to mak non commercial software, there is no difference between gtkmm and QT regarding the issue. http://www.trolltech.com/download/qt/x11.html I don’t see gtkmm used in commercial environemment anyway… 2003-11-07 11:12 am One of them is it creates containers and layout managers uneccessarily sometimes which leads to more code and thus larger binaries. I would be interested in an example for that. It never created anything I didn’t tell it to. It also overwrites my source files, removing changes I’ve made. No, it overwrites its source files and this is always mentioned as a warning in the file’s header. I also don’t like the ui.h file approach so I use the standard way: I create subclasses of the designer creates classes and implement everything there. This way you have full control over the actual class source and can still modify the GUI part in designer 2003-11-07 11:15 am I don’t see a bright future for Qt, since most IT companies I know that develop for Linux favour Gtk over Qt simply for the hefty price tag of Qt. I know I won’t (again) get no answer to this question, but here we go anyway: Name three companies other than Ximian that use GTK in closed source software. So far I’ve seen far more companies use Qt, even if they used it Windows-only! 2003-11-07 11:36 am Trolltech doesn’t only provide it’s customers a good toolkit but also very good support, schoolings, etc. Which company offers professional gtkmm support? 2003-11-07 11:57 am @Wee Jin Goh: I’m a PhD student, and I regularly use QT, VB, Perl, PHP and Java. I’ve used GTK and GTKmm a bit, too. Collectively, between myself and a number of other students (at different Universities), we’ve generally agreed that we are most productive in QT. I won’t argue that GTKmm is cheaper from a commercial point of view. QT however, is a reasonable price, based on the cost of a developer’s salary. In a normal software project, a massive amount of time is spent trying to overcome language quirks, fix bugs (often due to the compiler or the vagueness of the language/documentation), make the language do what it wasn’t designed to do, or dig around to try and find out how to perform a given function. Assume your developer is paid $50K a year, then for QT to be worth it, it needs to save you roughly 10 days of productivity or less a year. The great thing about QT simply is that it generally operates in a very intuitive manner. A reasonable coder knows how they want to, for example, be able to open files. QT has a knack for being able to operate in the manner the developer wants, exactly. The classes are well-rounded, have the functions you need and most of all, are correctly named, as are their methods. This is an absolutely key point. By contrast: Java – In terms of naming, the classes and their methods are horrid. It’s daft to have to spend a dozen lines of code to read in a line from a file properly. Java has gathered a range of ‘frameworks’ and methodologies, but ultimately, that has made accessing basic functionality time-consuming. Not only that, but Java is aimed towards Enterprise-level data processing these days, and other things are becoming hard to do. A good example is trying to write a headless application that uses images. Java assumes that a headless app doesn’t need access to image objects and you need to instantiate a Toolkit in order to even load one, which is not really mentioned well in the docs and is counter-intuitive. In short, Java just takes a lot of time to use, and you are forever getting around the quirks. VB – Does simple things very quickly, but hard things which are outside of the initial language spec are a pain to do. Time to search for 3rd party components. That said, it really is good for basic interfaces. It can have naming and behaviour quirks, though. You still need to search the net for suitable examples to fix problems, quite a bit. I haven’t tried VB.Net yet, though. GTKmm – I won’t comment too much, since I haven’t used it that much. Sufficed to say that I found the naming a little confusing and it didn’t react as I expected sometimes. It felt a bit shoe-horned, to be honest. Not bad, just not *as good*. In short, QT saves you the price simply by working right. Any person who works with it for more than a few days will probably tell you that it is good because: – It covers all the features you need (such as DB access, pattern-matching, etc.) – It just doesn’t get in the way of what you want to do. Most other people posting here haven’t really coded with QT much, which doesn’t let them really experience and understand this. The QT Docs are also very good and clear, and the Designer does quite a lot for you, really. I’ve made a few UI apps, and using the dialogs to connect signals and slots made things even easier than expected. Oh, and for those saying that QT is annoying because it doesn’t use the STL, you really need to understand that the STL doesn’t work at all uniformly across compilers even now. In fact, some recent (shipped in the last year) Linux distros had g++ with STL broken. It was fun That’s not to mention cross-platform compilation, nor the fact that the QT structures are more rich than the STL and standard C++ versions. Look at the QString as a good example. oh, and RE:BLOAT: I happen to think that the inability to code for your given desktop environment in a default install is one of the criminal things that Windows has done to us. Users should be able to code, and young people should be able to take their first steps in programming that way, not have to pay £1,000 for Visual Studio to just start coding. 2003-11-07 1:03 pm … install a desktop environment and get a full development environment. No. Distros usually split Qt into two packages: qt.rpm … Qt-libraries (libqt.so, …) qt_devel.rpm … Qt-header-files, Qt-Designer, uic and further Qt-development tools. Normal desktop-users install qt.rpm only. People who want to compile Qt-using-apps install both packages. 2003-11-07 2:56 pm Qt is nice, and I’m actually liking it more than Java. I’m just struggling to see if it is $1500 better than toolkits like wxWindows. The only thing I can see in favour of Qt is the excellent documentation, and available books on it. Try looking for books on Gtkmm or wxWindows…. 2003-11-07 3:28 pm I own a QT/Trio Pack and I thank god I had enough brains to make this investment. QT just works and on almost every platform. My products are better, I can get to market faster, I have more free time! 2003-11-07 4:13 pm I just made my first QT app. 🙂 I actually modified the example give so that you can convert temperatures both ways, and have a button clear the values instead of having them clear automatically. Programming is fun! I’m not a programmer, but I almost became one (I learned Basic and APL in high school, then played around with P-Robots). It’s interesting to see how far things have come in matters of software development. Thanks for a good, low-flame-potential article! 2003-11-08 2:16 am I’m totally convinced that it’s the tools that are responsible for the commercial success of Linux. One of the main arguments against Linux (as an OS) is that “it’s lacking apps”. And how do we cure this? By making sure that developing an app is a breeze, of course! See, this is one thing that MS has understood. Where had Windows been today without VB and Visual Studio? A word to the toolkit developers (targeting GTK here): priority #1 (as soon as the toolkit/library is released) is to ship an IDE to go along with it. And don’t say GLADE is enough – if you want an explosion of apps, you need something as integrated and complete as VS. Just my €0.02. 2003-11-08 3:46 am Reading the article, I installed QT designer and was able to write a simple application in a few minutes! I have to say, QT is is very nice toolkit and easy to use. I totally agree with the previous poster that if you want linux to have commercial success, you need more professional applications and for that you need an easy to use toolkit and IDE. I would like to see more such articles on say wxWindows, python etc. and even comparisons from those who have used them. -ManK 2003-11-08 9:08 am I agree, Qt is better then wxWindows. But if you compare it to Visual Studio .NET, it is only a very nice little toy. If you start a commercial project, you must calculate the prospective costs and profit. IMHO the Qt with the $1500 / platform price and with a relative poor features (not a really RAD tool, only a C++ lib with dialog editor) not too good choice. 2003-11-08 10:03 am it is cool 2003-11-08 11:23 am Kevin: “Name three companies other than Ximian that use GTK in closed source software.” I won’t restrict myself to closed source applications, since that’s not what defines commercial use. Anway here are some companies *selling* GTK based apps: – VMWare ( http://www.vmware.com) – Ada Core Technologies ( http://www.gnat.com ) – IDS-Imaging ( http://www.ids-imaging.de ) – Softintegration ( http://www.softintegration.com ) – Ximian (now Novell) ( http://www.ximian.com ) I don’t want to do an extended web search. Try google by yourself. 2003-11-08 11:55 am The vast majority of proprietary software development is for in-house applications that are not sold to the general public. You never see the application running, let alone the source code. Just because you don’t see it doesn’t meant that it’s not there. Mailing list archives suggest that GTK+, gtkmm, and Qt are all being used quite extensively for in-house software. 2003-11-08 7:24 pm Finally someone who is up to the challenge, thank you! I won’t restrict myself to closed source applications, since that’s not what defines commercial use. But that’s the main point. The so called “licence advantage” of GTK+ applies to closed source applications, because you’ll need to buy a licence from TT for Qt for this kind of applications. Commerical but open source applications are no problem with either toolkit. <8i>Anway here are some companies *selling* GTK based apps[/i] Thanks for coming up with four besides Ximian! Usually some troll is loudly stating that companies are more into GTK than Qt because of LGPL but then fail to come up with actual companies while it is trivial to check the list of Qt using companies on TT’s website. I agree that it looks like an advantage if a toolkit is available for free for closed source development as well, but it seems that paying for a Qt licence isn’t a problem for a lot of companies either. 2003-11-09 2:52 am I really like qt and think it is way cool.