Not Only the Best Book on Qt I Have Ever Seen, but Also the Best Book Presenting Any Programming Framework
Total Page:16
File Type:pdf, Size:1020Kb
[ Team LiB ] • Table of Contents • Index C++ GUI Programming with Qt 3 By Jasmin Blanchette, Mark Summerfield Publisher : Prentice Hall PTR Pub Date : January 15, 2004 ISBN : 0-13-124072-2 Pages : 464 "...not only the best book on Qt I have ever seen, but also the best book presenting any programming framework. Every sentence appears to be carefully worded, and every chapter has a sound concept, and so does the work as a whole." -Matthias Ettrich, Trolltech's lead developer, founder of the KDE project "The 'Tao of Qt'.... The Qt system is a beautiful example of object oriented design, and the authors take advantage of this.... The authors have done an excellent job of presenting the subject in an interesting and engaging way...." -Ron McCarty, Instructor and Chair of the Department of Computer Science, Penn State Erie, The Behrend College The first official Trolltech guide to Qt 3.2 programming! Straight from Trolltech, this book covers all you need to build industrial-strength applications with Qt 3.2.x and C++-applications that run natively on Windows, Linux/Unix, Mac OS X, and embedded Linux with no source code changes! The book teaches solid Qt programming practices; it is not a rehash of the documentation. You'll find start-to-finish coverage packed with examples, plus a CD with the Qt 3.2 toolset and Borland C++ compilers-including a non- commercial Qt 3.2 for Windows available nowhere else! z Build powerful C++ GUI applications quickly and easily z Design dialogs and main windows visually and in code z Learn Qt's innovative typesafe signals and slots mechanism z Use layouts to create forms that automatically size and scale z Create custom signals, slots, events, and controls z Program the ''Qt way'' with techniques for Qt 3.2 that'll work with Qt 4 z Code applications with menus, toolbars, dialogs, and drag and drop z Utilize 2D and 3D graphics, multithreading, and networking z Write database and XML applications z Internationalize to reach foreign markets z Exploit platform-specific-features like ActiveX Already using Qt or just starting out? Evaluating Qt or managing it? Building open source applications-or commercial applications? Want to develop for Windows without buying an expensive compiler? Whatever your goal, this is the only book you need! CD-ROM: Everything you need to write great GUI programs! z Qt 3.2 Non-Commercial Edition for Windows z Borland C++ 5.5 Non-Commercial Edition z Borland C++ 6.0 Trial Edition z Qt 3.2 Free Editions for Unix/Linux/Mac OS X z SQLite database z The book's code examples [ Team LiB ] [ Team LiB ] • Table of Contents • Index C++ GUI Programming with Qt 3 By Jasmin Blanchette, Mark Summerfield Publisher : Prentice Hall PTR Pub Date : January 15, 2004 ISBN : 0-13-124072-2 Pages : 464 Copyright Bruce Perens' Open Source Series Foreword Preface Acknowledgments A Brief History of Qt About the Authors Production About the CD-ROM Part I: Basic Qt Chapter 1. Getting Started Hello Qt Making Connections Using the Reference Documentation Chapter 2. Creating Dialogs Subclassing QDialog Signals and Slots in Depth Rapid Dialog Design Shape-Changing Dialogs Dynamic Dialogs Built-in Widget and Dialog Classes Chapter 3. Creating Main Windows Subclassing QMainWindow Creating Menus and Toolbars Implementing the File Menu Setting Up the Status Bar Using Dialogs Storing Settings Multiple Documents Splash Screens Chapter 4. Implementing Application Functionality The Central Widget Subclassing QTable Loading and Saving Implementing the Edit Menu Implementing the Other Menus Subclassing QTableItem Chapter 5. Creating Custom Widgets Customizing Qt Widgets Subclassing QWidget Integrating Custom Widgets with Qt Designer Double Buffering Part II: Intermediate Qt Chapter 6. Layout Management Basic Layouts Splitters Widget Stacks Scroll Views Dock Windows Multiple Document Interface Chapter 7. Event Processing Reimplementing Event Handlers Installing Event Filters Staying Responsive During Intensive Processing Chapter 8. 2D and 3D Graphics Painting with QPainter Graphics with QCanvas Printing Graphics with OpenGL Chapter 9. Drag and Drop Enabling Drag and Drop Supporting Custom Drag Types Advanced Clipboard Handling Chapter 10. Input/Output Reading and Writing Binary Data Reading and Writing Text Handling Files and Directories Inter-Process Communication Chapter 11. Container Classes Vectors Lists Maps Pointer-Based Containers QString and QVariant Chapter 12. Databases Connecting and Querying Presenting Data in Tabular Form Creating Data-Aware Forms Chapter 13. Networking Using QFtp Using QHttp TCP Networking with QSocket UDP Networking with QSocketDevice Chapter 14. XML Reading XML with SAX Reading XML with DOM Writing XML Chapter 15. Internationalization Working with Unicode Making Applications Translation-Aware Dynamic Language Switching Translating Applications Chapter 16. Providing Online Help Tooltips, Status Tips, and "What's This?" Help Using QTextBrowser as a Simple Help Engine Using Qt Assistant for Powerful Online Help Chapter 17. Multithreading Working with Threads Communicating with the GUI Thread Using Qt's Classes in Non-GUI Threads Chapter 18. Platform-Specific Features Interfacing with Native APIs Using ActiveX Session Management Appendix A. Installing Qt A Note on Licensing Installing Qt/Windows Installing Qt/Mac Installing Qt/X11 Appendix B. Qt's Class Hierarchy Index [ Team LiB ] [ Team LiB ] Copyright Library of Congress Cataloging-in-Publication Data A CIP catalog record for this book can be obtained from the Library of Congress Editorial/Production Supervision: Kathleen M. Caren Cover Design Director: Jerry Votta Art Director: Gail Cocker-Bogusz Manufacturing Buyer: Maura Zaldivar Acquisitions Editor: Jill Harry Editorial Assistant: Brenda Mulligan Marketing Manager: Dan Depasquale Copyright © 2004 Trolltech AS Published by Pearson Education, Inc. Publishing as Prentice Hall Professional Technical Reference Upper Saddle River, New Jersey 07458 This material may only be distributed subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is available at http://www.opencontent.org/openpub/). Prentice Hall PTR offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information, please contact: U.S.Corporate and Government Sales, 1-800-382-3419, [email protected]. For sales outside of the U.S., please contact: International Sales, 1-317-581-3793, [email protected]. Trolltech®, Qt®, and the Trolltech logo are registered trademarks of Trolltech. OpenGL™is a trademark of Silicon Graphics, Inc. in the United States and other countries. All other company and product names mentioned herein are the trademarks or registered trademarks of their respective owners. The authors, copyright holder, and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. The information in this book is furnished for informational use only, is subject to change without notice, and does not represent a commitment on the part of the copyright holder or the publisher. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The software described in this book is furnished under a license agreement or non-disclosure agreement. The software may be used or copied only in accordance with the terms of the agreement. Printed in the United States of America First Printing Pearson Education Ltd. Pearson Education Australia Pty., Limited Pearson Education Singapore, Pte. Ltd. Pearson Education North Asia Ltd. Pearson Education Canada, Ltd. Pearson Educación de Mexico, S.A. de C.V. Pearson Education-Japan Pearson Education Malaysia, Pte. Ltd. [ Team LiB ] [ Team LiB ] Bruce Perens' Open Source Series z C++ GUI Programming with Qt 3 Jasmin Blanchette, Mark Summerfield z Managing Linux Systems with Webmin: System Administration and Module Development Jamie Cameron z Understanding the Linux Virtual Memory Manager Mel Gorman z Implementing CIFS: The Common Internet File System Christopher R. Hertel z Embedded Software Development with eCos Anthony J. Massa z Rapid Application Development with Mozilla Nigel McFarlane z The Linux Development Platform: Configuring, Using, and Maintaining a Complete Programming Environment Rafeeq Ur Rehman, Christopher Paul z Intrusion Detection Systems with Snort: Advanced IDS Techniques with Snort, Apache, MySQL, PHP, and ACID Rafeeq Ur Rehman z The Official Samba-3 HOWTO and Reference Guide John H. Terpstra, Jelmer R. Vernooij, Editors [ Team LiB ] [ Team LiB ] Foreword Why Qt? Why do programmers like us choose Qt? Sure, there are the obvious answers: Qt's single-source compatibility, its feature richness, its C++ performance, the availability of the source code, its documentation, the high-quality technical support, and all the other items mentioned in Trolltech's glossy marketing materials. This is all very well, but it misses the most important point: Qt is successful because programmers like it. How come programmers like one technology, but dislike another? Personally, I believe software engineers enjoy technology that feels right, but dislike everything that doesn't. How else can we explain that some of the brightest programmers need help to program a VCR, or that most engineers seem to have trouble operating the company's phone system? I for one am perfectly capable of memorizing sequences of random numbers and commands, but if these are required to control my answering machine, I'd prefer not to have one. At Trolltech, our phone system forces us to hold the '*' key pressed down for two seconds before we are allowed to type in the other person's extension number. If you forget to do this but start typing the extension immediately, you have to dial the entire number again. Why '*'? Why not '#', or '1', or '5', or any of the other twenty keys on the phone? Why two seconds and not one, or three, or one and a half? Why anything at all? I find the phone so irritating that I avoid using it whenever I can.