Tuesday, March 30, 2010

Qt is Cute, Among Other Things

I'm currently enrolled in CSE 3345, GUI, which apparently is the only GUI development exposure that CSE students get. We've talked about lots of theory, which is fun (and interesting), and lots of design aspects. Our final project is to develop a GUI, but it doesn't require anything close to a fully functional backend. What surprises me is that, given that GUIs are associated with all standard software, why is it that we don't have hardly any education when it comes to the rubber meeting the road: the implementation of a backend with a GUI frontend?

From here I suppose it's a matter of taste as far as what language a GUI should be implemented in. Sure, you can do it in HTML, but that's no good for desktop applications. As far as I know, we get some Java exposure in 1340 (1341?), but then the remaining programming courses are all taught in C++! It seems to me that we should be learning about Qt, a cross-platform development framework widely used for the development of GUI programs. It is currently produced by Nokia's Qt Development Frameworks division, and is free for noncommercial use under GNU LGPL.

Qt is based on signals-slots, where signals are emitted whenever an action takes place in the program, and those signals are sent to slots, which give other objects in the program information about the signal being emitted (and a chance to perform some function, such as updating the UI). This is based on the observer pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.

Qt has many advantages over Swing. It's compiled, not interpreted, which means that it's going to run much faster than it's ugly Java counterpart. Like Swing, Qt is cross-platform and can draw GUIs in a variety of styles, including the native OS look for Windows and OS X. Qt also provides a framework for SQL database access, XML parsing, thread management, network support and a unified cross-platform API for file-handling.

Wikipedia links to C++ GUI Programming with Qt 4/first edition, which is an excellent resource for an introduction to Qt. To me it seems like it's much more practical than the small GUI exposure we get via Java, and would be at least worth mentioning in the upper level programming classes at SMU.

No comments:

Post a Comment