C++ GUI Programming with Qt4

by ;
  • ISBN13:


  • ISBN10:


  • Edition: 2nd
  • Format: Hardcover
  • Copyright: 2/4/2008
  • Publisher: Prentice Hall
  • Purchase Benefits
  • Free Shipping On Orders Over $59!
    Your order must be $59 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $69.99 Save up to $10.50
  • Buy New
    Add to Cart Free Shipping


Supplemental Materials

What is included with this book?

  • The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
  • The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.


Using Qt from Trolltech you can build industrial-strength C++ applications that run natively on Windows, Linux/Unix, Mac OS X, and embedded Linux without source code changes. Now, two Trolltech insiders have written a start-to-finish guide to getting outstanding results with the latest version of Qt: Qt 4.3.

Author Biography

Jasmin Blanchette is a Trolltech senior software engineer and is writing his M.Sc. thesis in computer science at the University of Oslo.

Mark Summerfield works as an independent trainer and consultant specializing in C++, Qt, Python, and PyQt, and is the author of Rapid GUI Programming with Python and Qt. Blanchette and Summerfield coauthored C++ GUI Programming with Qt 3 and the first edition of C++ GUI Programming with Qt 4.

Table of Contents

Series Editor's Notep. xi
Forewordp. xiii
Prefacep. xv
Acknowledgmentsp. xvii
A Brief History of Qtp. xix
Basic Qt
Getting Startedp. 3
Hello Qtp. 3
Making Connectionsp. 5
Laying Out Widgetsp. 6
Using the Reference Documentationp. 10
Creating Dialogsp. 13
Subclassing QDialogp. 13
Signals and Slots in Depthp. 20
Rapid Dialog Designp. 23
Shape-Changing Dialogsp. 31
Dynamic Dialogsp. 38
Built-in Widget and Dialog Classesp. 39
Creating Main Windowsp. 45
Subclassing QMainWindowp. 46
Creating Menus and Toolbarsp. 50
Setting Up the Status Barp. 55
Implementing the File Menup. 57
Using Dialogsp. 63
Storing Settingsp. 69
Multiple Documentsp. 71
Splash Screensp. 74
Implementing Application Functionalityp. 77
The Central Widgetp. 77
Subclassing QTableWidgetp. 78
Loading and Savingp. 84
Implementing the Edit Menup. 87
Implementing the Other Menusp. 91
Subclassing QTableWidgetItemp. 95
Creating Custom Widgetsp. 105
Customizing Qt Widgetsp. 105
Subclassing QWidgetp. 107
Integrating Custom Widgets with Qt Designerp. 117
Double Bufferingp. 121
Intermediate Qt
Layout Managementp. 141
Laying Out Widgets on a Formp. 141
Stacked Layoutsp. 147
Splittersp. 149
Scrolling Areasp. 152
Dock Windows and Toolbarsp. 154
Multiple Document Interfacep. 157
Event Processingp. 167
Reimplementing Event Handlersp. 167
Installing Event Filtersp. 172
Staying Responsive during Intensive Processingp. 175
2D Graphicsp. 179
Painting with QPainterp. 180
Coordinate System Transformationsp. 185
High-Quality Rendering with QImagep. 193
Item-Based Rendering with Graphics Viewp. 195
Printingp. 217
Drag and Dropp. 227
Enabling Drag and Dropp. 227
Supporting Custom Drag Typesp. 232
Clipboard Handlingp. 237
Item View Classesp. 239
Using the Item View Convenience Classesp. 240
Using Predefined Modelsp. 247
Implementing Custom Modelsp. 252
Implementing Custom Delegatesp. 266
Container Classesp. 273
Sequential Containersp. 274
Associative Containersp. 282
Generic Algorithmsp. 285
Strings, Byte Arrays, and Variantsp. 287
Input/Outputp. 295
Reading and Writing Binary Datap. 296
Reading and Writing Textp. 301
Traversing Directoriesp. 307
Embedding Resourcesp. 308
Inter-Process Communicationp. 309
Databasesp. 315
Connecting and Queryingp. 316
Viewing Tablesp. 322
Editing Records Using Formsp. 324
Presenting Data in Tabular Formsp. 330
Multithreadingp. 339
Creating Threadsp. 340
Synchronizing Threadsp. 343
Communicating with the Main Threadp. 349
Using Qt's Classes in Secondary Threadsp. 356
Networkingp. 359
Writing FTP Clientsp. 359
Writing HTTP Clientsp. 368
Writing TCP Client-Server Applicationsp. 371
Sending and Receiving UDP Datagramsp. 381
XMLp. 387
Reading XML with QXmlStreamReaderp. 388
Reading XML with DOMp. 395
Reading XML with SAXp. 400
Writing XMLp. 404
Providing Online Helpp. 407
Tooltips, Status Tips, and "What's This?" Helpp. 407
Using a Web Browser to Provide Online Helpp. 409
Using QTextBrowser as a Simple Help Enginep. 411
Using Qt Assistant for Powerful Online Helpp. 414
Advanced Qt
Internationalizationp. 419
Working with Unicodep. 420
Making Applications Translation-Awarep. 423
Dynamic Language Switchingp. 429
Translating Applicationsp. 435
Look and Feel Customizationp. 439
Using Qt Style Sheetsp. 439
Subclassing QStylep. 454
3D Graphicsp. 471
Drawing Using OpenGLp. 471
Combining OpenGL and QPainterp. 477
Doing Overlays Using Framebuffer Objectsp. 484
Creating Pluginsp. 491
Extending Qt with Pluginsp. 492
Making Applications Plugin-Awarep. 502
Writing Application Pluginsp. 505
Application Scriptingp. 509
Overview of the ECMAScript Languagep. 510
Extending Qt Applications with Scriptsp. 519
Implementing GUI Extensions Using Scriptsp. 523
Automating Tasks through Scriptingp. 530
Platform-Specific Featuresp. 543
Interfacing with Native APIsp. 543
Using ActiveX on Windowsp. 547
Handling X11 Session Managementp. 559
Embedded Programmingp. 567
Getting Started with Qt/Embedded Linuxp. 568
Customizing Qt/Embedded Linuxp. 570
Integrating Qt Applications with Qtopiap. 571
Using Qtopia APIsp. 576
Obtaining and Installing Qtp. 589
Building Qt Applicationsp. 593
Introduction to Qt Jambip. 605
Introduction to C++ for Java and C# Programmersp. 623
Indexp. 665
Table of Contents provided by Ingram. All Rights Reserved.


Qt is a comprehensive C++ application development framework for creating cross-platform GUI applications using a "write once, compile anywhere" approach. Qt lets programmers use a single source tree for applications that will run on Windows 98 to Vista, Mac OS X, Linux, Solaris, HP-UX, and many other versions of Unix with X11. The Qt libraries and tools are also part of Qt/Embedded Linux, a product that provides its own window system on top of embedded Linux.The purpose of this book is to teach you how to write GUI programs using Qt 4. The book starts with "Hello Qt" and quickly progresses to more advanced topics, such as creating custom widgets and providing drag and drop. The text is complemented by a set of examples that you can download from the book's web site, http://www.informit.com/title/0132354160 . Appendix A explains how to download and install the software, including a free C++ compiler for those using Windows.The book is divided into three parts. Part I covers all the fundamental concepts and practices necessary for programming GUI applications using Qt. Knowledge of this part alone is sufficient to write useful GUI applications. Part II covers central Qt topics in greater depth, and Part III provides more specialized and advanced material. You can read the chapters of Parts II and III in any order, but they assume familiarity with the contents of Part I. The book also includes several appendixes, with Appendix B showing how to build Qt applications and Appendix C introducing Qt Jambi, the Java version of Qt.The first Qt 4 edition of the book built on the Qt 3 edition, although it was completely revised to reflect good idiomatic Qt 4 programming techniques and included new chapters on Qt 4's model/view architecture, the new plugin framework, embedded programming with Qt/Embedded Linux, and a new appendix. This extended and revised second edition has been thoroughly updated to take advantage of features introduced in Qt versions 4.2 and 4.3, and includes new chapters on look and feel customization and application scripting as well as two new appendixes. The original graphics chapter has been split into separate 2D and 3D chapters, which between them now cover the new graphics view classes and QPainter's OpenGL back-end. In addition, much new material has been added to the database, XML, and embedded programming chapters.This edition, like its predecessors, emphasizes explaining Qt programming and providing realistic examples, rather than simply rehashing or summarizing Qt's extensive online documentation. Because the book teaches solid Qt 4 programming principles and practices, readers will easily be able to learn the new Qt modules that come out in Qt 4.4, Qt 4.5, and later Qt 4.x versions. If you are using one of these later versions, be sure to read the "What's New in Qt 4.x" documents in the reference documentation to get an overview of the new features that are available.We have written the book with the assumption that you have a basic knowledge of C++, Java, or C#. The code examples use a subset of C++, avoiding many C++ features that are rarely needed when programming Qt. In the few places where a more advanced C++ construct is unavoidable, it is explained as it is used. If you already know Java or C# but have little or no experience with C++, we recommend that you begin by reading Appendix D, which provides sufficient introduction to C++ to be able to use this book. For a more thorough introduction to object-oriented programming in C++, we recommendC++ How to Programby P. J. Deitel and H. M. Deitel (Prentice Hall, 2007), andC++ Primerby Stanley B. Lippman, Jos┐Lajoie, and Barbara E. Moo (Addison-Wesley, 2005).Qt made its reputation as a cross-platform framework, but thanks to its intuitive and powerful API, many organizations use Qt for single-platfor

Rewards Program

Write a Review