qt notes

Upload: vedavyas4fun

Post on 02-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Qt Notes

    1/2

    www.linuxforu.com | L INUX FOR YOU | NOVEMBER 2005 79

    Developers

    Q t (pronounced cu-tee or cute)is the C++ applicationdevelopment framework thatforms the basis of KDEthe KDesktop Environmentand it is

    used by Linux applications such as Scribusand Skype. It is developed by Trolltech, aNorway-based software company whoseproduct line is centered around Qt. AlthoughQt mainly focuses on GUI (graphical user

    interface) functionality, it also providesexcellent support for various programmingdomains, such as internationalization,networking, multithreading, SQL and XML.

    From day one, Qt was a fully object-oriented cross-platform toolkit, with supportfor both Linux/UNIX and Windows. In 2000,Trolltech released Qt/Embedded, which wasdesigned to run on embedded Linux devicesand provided its own window system as alightweight alternative to X11. And with therelease of Qt 3.0 in 2001, support was added

    for Mac OS X.

    Who can use Qt?Trolltechs business model, based on the ideaof dual-licensing, works as follows:

    Developers who want to give away theirsource code to the Open Sourcecommunity can use the Open Source(GPL) edition.Customers who make money on theirsoftware or use it in a commercial contextmust purchase a commercial Qt license.

    The open source edition is first andforemost a gift to the open source community.Many developers at Trolltech have their rootsin that community, and most of them useopen-source and free software every day todo their work.

    From a Linux perspective, it means that ahigh-quality professional tool, developed by adedicated team of paid developers and used bythousands of paying customers, is available foropen-source software development. Whatsmaybe less obvious is that Qts single sourceapproach to cross-platform development and

    Windows-to-LinuxMigration with QtCombine the power of Qt with the ability to write one application that runs on Windows,Linux and Macintosh, and you get a bright future for Linux on the desktop.

    Developers

  • 8/10/2019 Qt Notes

    2/2

    80 NOVEMBER 2005 | L INUX FOR YOU | www.linuxforu.com

    Developers

    its dual-licensing model accelerate the migration of Qt-based commercial Windows applications to Linux.

    A better MFC than MFC Although Qt is cross-platform, many companies use it forsingle-platform development. These companies use Qtbecause they find the Qt API (application programinterface) superior to that of the Windows-specific toolkits.They also find that Qt insulates them from differences inthe Windows APIs. For example, with Qt, the sameexecutable works on Windows 95 to XP; Qt performs acheck at runtime and uses the most advanced capabilitiesavailable. Microsofts library of tools for the Windows APIis called Microsoft Foundation Classes (MFC). With MFC,this is not possible without creating two executables.

    Rowley Associates based their CrossStudio IDE on Qt/ Windows. They have now ported their application to Linuxat the request of some of their customers. The port was

    done by a developer who had no previous Linux/UNIXexperience and took only a couple of days, showing how easy it is to transform a well-written Windows Qtapplication into a native Linux application.

    Toolkit confusion on WindowsMicrosoft has practically given up MFC and is preparing toreplace its successor, Windows Forms, with the Avalonframework. The uncertainty surrounding these three APIshas alienated many Windows developers, who are now looking at Qt as a more stable alternative.

    JMPa division of SASwho previously used MFC in

    statistical data visualization software, found themselves inthat situation. JMP software is widely used in industrialcompaniesnotably Dow Chemical, HoneywellInternational and Aventis Pasteur.

    Richard C. Potter, Senior Software Manager at JMP,summarizes the search for an alternative to MFC asfollows: We needed to find a class library that would becompatible with our existing architecture. We brieflyconsidered using GTK+, but we quickly realized that itwould not be acceptable. Qt was a better fit with theexisting architecture of our product. Since Qt classesmatch closely with those in MFC, converting our existingMFC-based source code into Qt-based source code wasstraightforward.

    Another example is Firstlogic, which provides customerrelationship management (CRM) solutions to more than6,000 businesses around the world. When they set out todevelop IQ8, their next-generation data quality solution,they decided to move away from MFC to Qt because theyneeded a more modern and flexible toolkit. Now, IQ8 isavailable for Linux and commercial UNIX systems.

    How MAC OS is helping Linux

    Although the uncertainty surrounding Windows Forms and Avalon is an important factor playing in Linuxs favor,another factor is that software companies increasingly

    need to target both Windows and Mac OS X. They chooseQt because of its cross-platform capabilities.

    BMPi, the interactive version of Birds of the WesternPalearctic, developed by Skylark Associates, is such anapplication. Other examples include PerfectTablePlan byOryx Digital and Mindawn by theKompany.com. As Linuxbecomes more popular as a desktop platform, theproviders of these cross-platform applications are likely toport their software to Linux as well as Mac OS X.

    The open source factorInterestingly enough, many companies consider theexistence of an Open Source (GPL) edition of Qt as anadvantage over other toolkits.

    For them, this means that the product is widely testedby hoards of open-source software users, including KDEusers. Mailing lists, on-line forums, books and certaincomponents (for example, the Qwt plotting library) are

    available on the Internet to both open-source andcommercial developers. Finally, when it comes to hiring,there is a large talent pool of open-source developers withQt skills out there.

    About this topic, Rainer Goebel, who is Chief SoftwareDesigner at Brain Innovation, a company that migratedfrom MFC to Qt, says, We ended up choosing Qt due to itsconsistent object-oriented approach combined with itselegant signal-slot mechanism. The knowledge that Qt wasused to develop KDE, one of the two major Linux/UNIXdesktops, also helped in the decision process.

    The futureEven though Qt was originally designed as a cross-platformGUI toolkit, there is an increasing number of companieswho adopt Qt for single-platform development onWindows, rather than Microsofts half-baked solutions.With the emergence of Linux on the desktop, thesecompanies will be in a position where they can port theirapplications to Linux in very little time, which in turn willhelp user adoption of Linux. It also may be noted inpassing that Qt is helping Linux adoption on embeddeddevices. Qtopia, Trolltechs application suite for smartphones and PDAs, is based on Qt/Embedded, which in turnis based on Linux.

    With the growing popularity of Linux and Mac OS X,companies are becoming increasingly concerned aboutportability, even when they have no immediate plans toport their applications. They dont want to be locked in toan unsupported technology, such as MFC or WindowsForms, and prefer to turn to a widely used and activelydeveloped cross-platform toolkit. For many of them, Qt isthat toolkit.

    By: Jasmin Blanche tte . By: Jasmin Blanche tte . By: Jasmin Blanche tte . By: Jasmin Blanche tte . By: Jasmin Blanche tte . The author is documentation manager at Trolltech in Oslo, Norway. You can reach himat [email protected]: The Tux MagazineCourtesy: The Tux MagazineCourtesy: The Tux MagazineCourtesy: The Tux MagazineCourtesy: The Tux Magazine