2001 10 Choosing a Graphical Toolkit for Kde Programming


KNOW HOW QT
ON THE QT
JONO BACON
When the KDE project was started by Mathias Ettrich, he needed to decide
on which graphical toolkit to use to base the environment on. There were
some options available, but one of the most capable toolkits was Qt by
Trolltech in Oslo, Norway.
One of the great things about Linux is the sheer
Getting to know Qt
number of available options and choices you can
make. There are often multiple solutions for a single To start with, it is a good idea that we get a grasp of
problem. An example is in windowing environments; what Qt can do and what facilities are available. In
we have KDE, Gnome, fvwm, Afterstep, this issue we will look at these features and get a
Enlightenment etc. good grounding of Qt s facilities.
One of the most popular windowing environments Firstly, Qt is a very portable toolkit. Qt has been
on Linux and UNIX-based systems is the K Desktop made available and ported to the following platforms:
Environment (KDE). KDE has been around for
approximately five years and has developed into a Linux (all major distributions)
mature project with hundreds of developers and UNIX (all major UNIXes)
some very competent, stable releases. Microsoft Windows
A graphical toolkit is a number of buttons, Mac
checkboxes, scrollbars etc and other facilities to Embedded Devices (Casiopeia, iPAQ etc)
write graphical software with. There are a few
toolkits available but Qt is one of the most capable, There are also some other ports, so Qt always
if not the most capable. remains a portable toolkit.
From those early days five years ago, Qt has Not only is Qt portable, it is licensed to your
developed into an incredible piece of software with needs in a very flexible way. Qt is available in
thousands of users using the toolkit around the three versions; Free, Professional and Enterprise.
world on a number of platforms and operating The free version involves Qt for X11, Embedded
systems. This series of articles is going to look at Qt, (and recently Windows). The free versions for
what it can do and what kind of software you can X11 are licensed under the GPL and include full
write with it. source code. The free version of Qt/Windows is
binary only and does not contain the source
code of the toolkit. For those wishing to write
closed source or commercial software there is
the Professional and Enterprise editions, which
have different licensing to enable this. This
licensing scheme makes Qt a very flexible toolkit,
and as it is maintained by a company full time it
always remains competent, competitive and, in
our case, free.
What can it do?
In these articles I am going to be focusing my efforts
on the newly available Qt 3.0 version. There are
previous editions such as the 2.x.x series and the
1.4.x series that are floating about, but I suggest you
use the most current version available.
Qt Designer
main window Although at first glance Qt looks like a number of
34 LINUX MAGAZINE 13 · 2001
QT KNOW HOW
widgets (controls) that you can use to develop
software, it is much more than that. Qt not only
offers you a number of pre-designed widgets, but
also the capability to roll your own widgets. Qt also
includes a number of classes for managing data such
as strings, numbers, vectors, linked lists, stacks, XML,
DOM trees etc. On top of this Qt offers a number of
networking features, support for multiple image
formats and international text support.
Qt does not stop there, there s also the following:
Multiple monitor support
Qt allows applications to utilise multiple screens.
On UNIX, this will support both Xinerama and the
traditional multi-screen technology.
New Component model
Qt provides a platform-independent API for
runtime loading of shared libraries and
accessing of their functionality using a COM-like
interface concept.
Support for the latest evolutions in GUIs
Qt supports the docking/floating window
QCAD application written with Qt
concept of modern, complex GUIs. It also adds a
GUI control for interactive editing of rich text. included in Qt 3.0. The Qt Designer has full support
Regular Expressions for these new controls, resulting in a RAD solution
Qt-3.0 features a new and powerful regular for database applications.
expression engine greatly simplifying complex
text manipulation operations. The syntax is
C++ support
compatible to, and as powerful as, Perl regular
expressions while at the same time including full Qt itself is written in and natively supports C++ as a
support for Unicode. language. You don t need to hunt far on the Net for
Accessibility Support a raging debate on whether C or C++ is better for
Qt controls provide information for accessibility GUI development, but it is acknowledged in a
architectures, so that visually or mobile-impaired number of places that C++ is inherently better for
people can use applications written in Qt with the GUI development. Qt is a good example of a well-
standard tools provided (eg the Windows crafted toolkit C++ and object orientated paradigms.
Magnifier and Narrator). In the coming months I will be giving tutorials on
64-bit Safety using Qt, and some C++ knowledge is assumed. If
The emerging, next generation of 64-bit you are unfamiliar with C++, there are a number of
hardware is supported by Qt 3.0. tutorials and good books available on the Net.
Database Programming Qt Designer
Qt 3.0 includes a platform and database- Qt includes a graphical interface building tool called
independent API for accessing SQL databases. The Qt Designer which can be used to build dialog
API has both ODBC support and database-specific boxes, interfaces and more. Qt Designer is an
drivers for Oracle, PostgreSQL and MySQL important component in your software
databases, and custom drivers may be added. development with Qt and can save a lot of time in
Database-aware controls that provide automatic creating your software.
synchronisation between GUI and database are Qt designer also has support for KDE widgets if
cRadio for controlling PCI Radio Cards
13 · 2001 LINUX MAGAZINE 35
KNOW HOW QT
Internationalisation
If you want to write software in multiple languages
(natural languages, not programming languages),
then you are going to need to translate strings of
text across your programs. Trolltech has developed
Qt Linguist to assist in this process. Qt Linguist
provides a number of features for making your
programs more internationally aware.
Uses for Qt
For those of you new to Qt, you may be reading this
article and wondering just what kind of software you
can write with Qt? Well basically you can write any
kind of software that you need to. Qt provides most
of the visual GUI elements that you will need and Qt
also provides the backend and internal facilities.
Remember that Qt is a commercial product with a
free edition that is not restricted or cut away at. You
are getting an industry-strength toolkit for free.
MuX2d music typesetting package for TeX
KDE Integration
desired and can be compiled with this support. I will
be covering installation of Qt in the next issue. Many people are starting use KDE as their standard
interface for Linux. This has been due to a number
of solid KDE releases, an easy to use interface, and
Documentation
good quality application software.
One of the great benefits of Qt as a development KDE itself is written in Qt. This is a major benefit
tool is its incredible documentation. Qt includes as it means that you have a massive wealth of code
documentation on all of the classes included in it as already written for KDE that is available for a
well as a tutorial, information on Qt modules and reference. KDE has also developed extensive
other information. This documentation is essential features on top of the Qt features and making a
when coding to look up method names and details. KDE-aware program out of a Qt program is a
Trolltech has built an application to support this nominal job.
documentation called Qt Assistant. Qt Assistant This means that by learning Qt, you are also
provides an interface to the documentation making yourself skilled enough to write software
provided by Qt, and also enables more that is compatible with one of the most popular
documentation to be added. desktops for Linux.
Where to now?
Now we have had a brief look at Qt, we will be
taking a look at writing some software with it. This
will begin in the next issue, but before then, there
are some preparations I suggest you take.
Qt is written in C++ and uses C++ as the language
to write Qt software in (although there are other
unofficial bindings). If you are unfamiliar with
C++, I suggest you take a look at it and get to
grips with it. It is a powerful language and needs
some practice to get to use properly. There are
plenty of good books and tutorials available to get
you started.
Qt is a powerful, flexible toolkit for professional
grade software development. Qt has been written
from the ground up as a capable toolkit for
development of free and commercial software,
and using it is very satisfying. Next issue we will
begin using Qt to write some software. I will
Qt GUI Designer running in a Solaris environment hopefully see you then! %
36 LINUX MAGAZINE 13 · 2001


Wyszukiwarka

Podobne podstrony:
2001 08 Installing 3D Support for Nvidia Graphics Cards
10 6 3 Ustanawianie sesji konsoli przy u yciu programu Minicom
Graphic Design For Everyone 01
2001 10 Customizing the Desktop Wit Hthe Control Center
SAP Business One Integration Toolkit for mySAP Business Suite 1 5 Administration Guide
2001 08 Creating Boot Cds for a Quick Recovery
2001 10 Using the Gimp Plugin Tool Gimpressionist
2001 10 Szkoła konstruktorów klasa II
2001 10 How to Run Linux on a Mac
PMI WB SemPP! 10 09 PRINCE2 Overview for PMI
Graphic Design For The Web
Learning Center Graphic Design for Everyone 05
2001 10 Laser Printers on Test Linux Lab Tested to the Extreme
2001 10 Installing Software Form the Source
Fluorescent proteins as a toolkit for in vivo imaging 05 Trends in Biotechnology
CSharp Introduction to C# Programming for the Microsoft NET Platform (Prerelease)

więcej podobnych podstron