The Only Official, Best-Practice Guide to Qt 4.3 Programming Using Trolltech's Qt 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
C++ GUI Programming with Qt4
β Scribed by Jasmin Blanchette, Mark Summerfield
- Publisher
- Prentice Hall
- Year
- 2008
- Tongue
- English
- Leaves
- 884
- Edition
- 2
- Category
- Library
No coin nor oath required. For personal study only.
β¦ Synopsis
This is the eBook version of the printed book.
The Only Official, Best-Practice Guide to Qt 4.3 Programming
Using Trolltech's Qt 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.
Packed with realistic examples and in-depth advice, this is the book Trolltech uses to teach Qt to its own new hires. Extensively revised and expanded, it reveals today's best Qt programming patterns for everything from implementing model/view architecture to using Qt 4.3's improved graphics support. You'll find proven solutions for virtually every GUI development task, as well as sophisticated techniques for providing database access, integrating XML, using subclassing, composition, and more. Whether you're new to Qt or upgrading from an older version, this book can help you accomplish everything that Qt 4.3 makes possible.
- Completely updated throughout, with significant new coverage of databases, XML, and Qtopia embedded programming
- Covers all Qt 4.2/4.3 changes, including Windows Vista support, native CSS support for widget styling, and SVG file generation
- Contains separate 2D and 3D chapters, coverage of Qt 4.3's new graphics view classes, and an introduction to QPainter's OpenGL back-end
- Includes new chapters on look-and-feel customization and application scripting
- Illustrates Qt 4's model/view architecture, plugin support, layout management, event processing, container classes, and much more
- Presents advanced techniques covered in no other bookβfrom creating plugins to interfacing with native APIs
- Includes a new appendix on Qt Jambi, the new Java version of Qt
β¦ Table of Contents
Table of Contents......Page 3
Hello Qt......Page 17
Making Connections......Page 19
Laying Out Widgets......Page 20
Widget Styles......Page 22
Figure 1.6. Predefined styles......Page 23
Using the Reference Documentation......Page 24
2. Creating Dialogs......Page 32
Subclassing QDialog......Page 33
Signals and Slots in Depth......Page 39
Qt's Meta-Object System......Page 40
Rapid Dialog Design......Page 41
Shape-Changing Dialogs......Page 49
Dynamic Dialogs......Page 56
Built-in Widget and Dialog Classes......Page 57
3. Creating Main Windows......Page 67
Subclassing QMainWindow......Page 68
Creating Menus and Toolbars......Page 72
Setting Up the Status Bar......Page 77
Implementing the File Menu......Page 78
Using Dialogs......Page 85
Storing Settings......Page 90
Multiple Documents......Page 91
Splash Screens......Page 94
The Central Widget......Page 97
Subclassing QTableWidget......Page 98
Storing Data as Items......Page 102
Loading and Saving......Page 104
Implementing the Edit Menu......Page 106
Implementing the Other Menus......Page 110
Subclassing QTableWidgetItem......Page 114
Customizing Qt Widgets......Page 124
Subclassing QWidget......Page 126
Integrating Custom Widgets with Qt Designer......Page 135
Double Buffering......Page 139
Laying Out Widgets on a Form......Page 169
Stacked Layouts......Page 175
Splitters......Page 176
Scrolling Areas......Page 180
Dock Windows and Toolbars......Page 181
Multiple Document Interface......Page 184
7. Event Processing......Page 198
Reimplementing Event Handlers......Page 199
Installing Event Filters......Page 203
Staying Responsive during Intensive Processing......Page 206
8. 2D Graphics......Page 214
Painting with QPainter......Page 215
Coordinate System Transformations......Page 220
High-Quality Rendering with QImage......Page 228
Item-Based Rendering with Graphics View......Page 230
Printing......Page 250
Enabling Drag and Drop......Page 264
Supporting Custom Drag Types......Page 269
Clipboard Handling......Page 273
10. Item View Classes......Page 281
Figure 10.1. Qt's model/view architecture......Page 282
Using the Item View Convenience Classes......Page 283
Using Predefined Models......Page 289
Implementing Custom Models......Page 294
Implementing Custom Delegates......Page 307
How Implicit Sharing Works......Page 319
Sequential Containers......Page 321
How Implicit Sharing Works......Page 328
Associative Containers......Page 329
Generic Algorithms......Page 332
Strings, Byte Arrays, and Variants......Page 334
12. Input/Output......Page 347
Reading and Writing Binary Data......Page 348
Reading and Writing Text......Page 353
Traversing Directories......Page 358
Embedding Resources......Page 360
Inter-Process Communication......Page 361
13. Databases......Page 372
Connecting and Querying......Page 373
Viewing Tables......Page 379
Editing Records Using Forms......Page 381
Presenting Data in Tabular Forms......Page 387
14. Multithreading......Page 397
Creating Threads......Page 398
Synchronizing Threads......Page 401
Communicating with the Main Thread......Page 407
Using Qt's Classes in Secondary Threads......Page 413
Writing FTP Clients......Page 423
Writing HTTP Clients......Page 431
Writing TCP ClientΓ’β¬ Server Applications......Page 434
Sending and Receiving UDP Datagrams......Page 444
16. XML......Page 455
Reading XML with QXmlStreamReader......Page 456
Reading XML with DOM......Page 462
Reading XML with SAX......Page 466
Writing XML......Page 470
17. Providing Online Help......Page 475
Tooltips, Status Tips, and "What's This?" Help......Page 476
Using a Web Browser to Provide Online Help......Page 478
Using QTextBrowser as a Simple Help Engine......Page 480
Using Qt Assistant for Powerful Online Help......Page 483
Working with Unicode......Page 497
Making Applications Translation-Aware......Page 502
Dynamic Language Switching......Page 507
Translating Applications......Page 512
19. Look and Feel Customization......Page 529
Using Qt Style Sheets......Page 530
Subclassing QStyle......Page 544
QStyleOption Versioning......Page 557
Drawing Using OpenGL......Page 564
Combining OpenGL and QPainter......Page 569
Doing Overlays Using Framebuffer Objects......Page 576
21. Creating Plugins......Page 592
Extending Qt with Plugins......Page 593
Making Applications Plugin-Aware......Page 602
Writing Application Plugins......Page 605
22. Application Scripting......Page 617
Overview of the ECMAScript Language......Page 618
Extending Qt Applications with Scripts......Page 627
Implementing GUI Extensions Using Scripts......Page 631
Automating Tasks through Scripting......Page 638
Interfacing with Native APIs......Page 654
Using ActiveX on Windows......Page 658
Handling X11 Session Management......Page 670
24. Embedded Programming......Page 678
Getting Started with Qt/Embedded Linux......Page 679
Customizing Qt/Embedded Linux......Page 681
Integrating Qt Applications with Qtopia......Page 682
Using Qtopia APIs......Page 687
Installing Qt/Windows......Page 701
Installing Qt/X11......Page 702
B. Building Qt Applications......Page 709
Using qmake......Page 710
Using Third-Party Build Tools......Page 715
Using Java's Resource System......Page 722
C. Introduction to Qt Jambi......Page 724
Getting Started with Qt Jambi......Page 725
Using Java's Resource System......Page 728
Using Qt Jambi in the Eclipse IDE......Page 730
Integrating C++ Components with Qt Jambi......Page 734
D. Introduction to C++ for Java and C# Programmers......Page 745
Getting Started with C++......Page 746
Main Language Differences......Page 750
The Standard C++ Library......Page 779
Production......Page 781
Index......Page 782
Index......Page 785
Index......Page 788
Index......Page 795
Index......Page 799
Index......Page 804
Index......Page 807
Index......Page 808
Index......Page 810
Index......Page 814
Index......Page 815
Index......Page 816
Index......Page 818
Index......Page 822
Index......Page 823
Index......Page 825
Index......Page 831
Index......Page 857
Index......Page 860
Index......Page 873
Index......Page 878
Index......Page 879
Index......Page 881
Index......Page 883
π SIMILAR VOLUMES
Qt 4 is radically different from earlier versions of Qt, with lots of new features and many small changes everywhere in the API. For customers porting applications from Qt 3 to Qt 4, this is bad news; but for us, this is good news, because it means that owners of the Qt 3 book will want to buy this
<span><span><p>The Only Official, Best-Practice Guide to Qt 4.3 Programming</p><p>Using Trolltech's Qt 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
Using Trolltech's Qt 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: Q