logo资料库

QT高级编程英文版.pdf

第1页 / 共554页
第2页 / 共554页
第3页 / 共554页
第4页 / 共554页
第5页 / 共554页
第6页 / 共554页
第7页 / 共554页
第8页 / 共554页
资料共554页,剩余部分请下载后查看
Contents
List of Tables
Foreword
Introduction
Acknowledgements
Chapter 1. Hybrid Desktop/Internet Applications
Internet-Aware Widgets
Using WebKit
A Generic Web Browser Window Component
Creating Web Site-Specific Applications
Embedding Qt Widgets in Web Pages
Chapter 2. Audio and Video
Using QSound and QMovie
The Phonon Multimedia Framework
Playing Music
Playing Videos
Chapter 3. Model/View Table Models
Qt’s Model/View Architecture
Using QStandardItemModels for Tables
Changing a Table Model through the User Interface
A QStandardItemModel Subclass for Tables
A QSortFilterProxyModel to Filter Out Duplicate Rows
A QSortFilterProxyModel to Filter In Wanted Rows
Creating Custom Table Models
Changing a Table Model through the User Interface
A CustomQAbstractTableModel Subclass for Tables
Chapter 4. Model/View Tree Models
Using QStandardItemModels for Trees
Changing a Tree Model through the User Interface
A QStandardItem Subclass for Tree Items
A QStandardItemModel Subclass for Trees
Creating Custom Tree Models
Changing a Tree Model through the User Interface
A Custom Item Class for Tree Items
A CustomQAbstractItemModel Subclass for Trees
Chapter 5. Model/View Delegates
Datatype-Specific Editors
Datatype-Specific Delegates
A Read–Only Column or Row Delegate
An Editable Column or Row Delegate
Model-Specific Delegates
Chapter 6. Model/View Views
QAbstractItemView Subclasses
Model-Specific Visualizing Views
The Visualizer Widget
The Visualizer’s Aggregated Header Widget
The Visualizer’s Aggregated View Widget
Chapter 7. Threading with QtConcurrent
Executing Functions in Threads
Using QtConcurrent::run()
Using QRunnable
Filtering and Mapping in Threads
Using QtConcurrent to Filter
Using QtConcurrent to Filter and Reduce
Using QtConcurrent to Map
Chapter 8. Threading with QThread
Processing Independent Items
Processing Shared Items
Chapter 9. Creating Rich Text Editors
Introducing QTextDocument
Creating CustomText Editors
Completion for Line Edits and Comboboxes
Completion and Syntax Highlighting for Text Editors
A Rich Text Single Line Editor
Multi-line Rich Text Editing
Chapter 10. Creating Rich Text Documents
Exported QTextDocument File Quality
Creating QTextDocuments
Creating QTextDocuments with HTML
Creating QTextDocuments with QTextCursor
Exporting and Printing Documents
Exporting QTextDocuments
Printing and Previewing QTextDocuments
Painting Pages
Painting PDF or PostScript
Painting SVG
Painting Pixmaps
Chapter 11. Creating Graphics/View Windows
The Graphics/View Architecture
Graphics/View Widgets and Layouts
Introducing Graphics Items
Chapter 12. Creating Graphics/View Scenes
Scenes, Items, and Actions
Creating the Main Window
Saving, Loading, Printing, and Exporting Scenes
Manipulating Graphics Items
Enhancing QGraphicsView
Creating a Dock Widget Toolbox
Creating Custom Graphics Items
Enhancing QGraphicsTextItem
Enhancing an Existing Graphics Item
Creating a Custom Graphics Item from Scratch
Chapter 13. The Animation and State Machine Frameworks
Introducing the Animation Framework
Introducing the State Machine Framework
Combining Animations and State Machines
Epilogue
Selected Bibliography
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Advanced Qt Programming ptg
This page intentionally left blank ptg
Advanced Qt Programming Creating Great Software with C++ and Qt 4 Mark Summerfield Upper Saddle River, NJ · Boston · Indianapolis · San Francisco p New York · Toronto · Montreal · London · Munich · Paris · Madrid p Capetown · Sydney · Tokyo · Singapore · Mexico City ptg
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The author 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. 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 publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 corpsales@pearsontechgroup.com For sales outside the United States, please contact: International Sales international@pearsoned.com Visit us on the Web: informit.com/aw Library of Congress Cataloging-in-Publication Data Summerfield, Mark. Advanced Qt programming : creating great software with C++ and Qt 4 / Mark Summerfield. p.mcm. Includes bibliographical references and index. ISBN 978-0-321-63590-7 (hardcover : alk. paper) 1. Qt (Electronic resource) 2. Graphical user interfaces (Computer systems) 3. C++ (Computer program language) I. Title. QA76.9.U83S88 2010 005.1’13—dc22 Copyright © 2011 Qtrac Ltd. 2010019289 All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: Pearson Education, Inc. Rights and Contracts Department 501 Boylston Street, Suite 900 Boston, MA 02116 Fax: (617) 671-3447 ISBN-13: 978-0-321-63590-7 ISBN-10: 0-321-63590-6 Text printed in the United States on recycled paper at Courier in Westford, Massachusetts. First printing, July 2010 ptg
This book is dedicated to Anna Rebecca Paterson ptg
This page intentionally left blank ptg
Contents at a Glance List of Tables . ........................................................................................... Foreword . .................................................................................................. Introduction . ............................................................................................. Chapter 1. Hybrid Desktop/Internet Applications . .............................. Chapter 2. Audio and Video . ................................................................ Chapter 3. Model/View Table Models . ................................................ xiii xv 1 5 53 87 Chapter 4. Model/View Tree Models . ................................................... 129 Chapter 5. Model/View Delegates . ...................................................... 185 Chapter 6. Model/View Views . ............................................................. 207 Chapter 7. Threading with QtConcurrent . ............................................ 245 Chapter 8. Threading with QThread . .................................................... 287 Chapter 9. Creating Rich Text Editors . ................................................... 317 Chapter 10. Creating Rich Text Documents . ....................................... 359 Chapter 11. Creating Graphics/View Windows . ................................... 389 Chapter 12. Creating Graphics/View Scenes . .................................... 409 Chapter 13. The Animation and State Machine Frameworks . ............ 469 Epilogue . .................................................................................................. 491 Selected Bibliography . ........................................................................... 495 Index . ........................................................................................................ 499 www.qtrac.eu/aqpbook.html vii ptg
分享到:
收藏