Qt is an object oriented toolkit for developing graphical user interfaces (GUI). It is developed by Trolltech and uses native libraries on each of the platforms that it supports. On Linux platforms, Qt is written to interface directly with X11. Since it is developed privately by Trolltech, it does not enjoy the benefit of being developed by the open source community. However, it is still a very powerful and popular toolkit. KDE, one of the desktop options on Novell SuSE distributions is implemented on the free edition of Qt. This raises the issue that always seems to come up when talking about Qt. It is free when used in non-commercial applications, however, it is not free when developing commercial, proprietary or non-free software. Likewise it is not free if developing for Windows or embedded systems. Before using Qt to develop your application, it would be important to understand it's licensing model.
Qt uses the notion of âsignalsâ? and âslotsâ? for event it's mechanism. The visual elements in Qt are called widgets and are derived from the QWidget class. These widgets emit signals when an event occurs. For example, a button will emit a âclickedâ? signal after it has been clicked by a user. If a developer wants to perform an action when the event occurs, they âconnectâ? to the signal by creating a function called a âslotâ?. Since these are not static mappings the developer can connect and disconnect to various symbols at anytime in their application. In the following example, the developer has connected the clicked signal from the login button to a slot (LoginUser() method) in his application.
connect( loginButton, SIGNAL(clicked()), qApp, SLOT(LoginUser() );
The Trolltech people have made considerable efforts to ease the pain of porting a Microsoft MFC application to Qt. They have created a library called the âWindows Migration Frameworkâ?, that makes it possible to use Qt widgets and events within the MFC message map model. The premise is that if you already have an MFC application you can leave the existing controls as they are initially. However, when you add new controls you would use Qt widgets rather the MFC controls. Over time the MFC controls in the application could be replaced with Qt widgets.
For more information go to Trolltech's home page
© 2008 Novell, Inc. All Rights Reserved.