C++ Qt设计模式.pdf

所需积分/C币:16 2013-09-17 09:14:15 10.98MB PDF

《C++Qt设计模式(第2版)》是美国萨福克大学已使用十余年的经典教程,利用跨平台开源软件开发框架Qt阐释了C++和设计模式中的主要思想。全书共分四个部分:第一部分介绍C++、UML、Qt、模型-视图、SQL、XML、设计模式等基础知识,目的是为零基础的C++初学者铺垫一条学习面向对象编程的快捷之路;第二部分讲解内存访问、继承等重要的C++特性,是前一部分的延伸和拓展;第三部分使用Phonon编写了一个多媒体播放器,展示了主要技术理念的应用方法;附录部分给出了C++保留关键字、Debian和Qt程序开发环境的配置等内容。每节的练习题和各章后面的复习题,既可作为课堂上的讨论题,也可进一步启发读者
An Introduction to Design Patterns in C++ with Qt TM 2nd Edition Alan Ezust and paul ezust PRENTICE HALL Upper Saddle River, NJ. Boston Indianapolis. San Francisco New york· Toronto· Montreal· London· Munich· Paris· Madrid Cape Town Sydney. Tokyo. Singapore Mexico City 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 authors 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 arisi ng 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 (800382-3419 corpsales@pearsontechgroup.com For sales outside the United States please contact International Sales international@pearson.com Visit us on the Web: informit. com/ph Library of Congress Cataloging-in-Publication Data Ezust, Alan An introduction to design patterns in C++ with QT / Alan Ezust, Paul Ezust --2nd ed P cm. Includes bibliographical references and index IsBN 978-0-13-282645-7(hardback: alk. paper) 1. C++( Computer program language)2. Software patterns. 3. Computer software--Reusability. I. Ezust, Paul. II. Title QA76.73.C153E942011 005.133-dc23 201101837 Copyright@ 2012 Alan and Paul ezust 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 y any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to Pearson education Inc Rights and Contracts Departmen 01 Boylston Street, Suite 900 Boston MA 02116 Fax(617)671-3447 Tux is created by Larry Ewing, lewing@isc. tamu.edu, using GIMP. Qt and the Qt logo are trademarks of Nokia Corporation and/or its subsidiaries in Finland and other countries ISBN-13:978-0-132-82645-7 ISBN-10:0-132-82645-3 Text printed in the United States on recycled paper at Courier in Westford, Massachusetts First printing September 2011 Editor-in-Chief: Mark Taub Acquisitions Editor: Debra Williams Cauley Managing Editor: Kristy Hart Project Editor: Jovana San Nicolas-Shirley Editor: A he editing service Proofreader: Gill Editorial Services Publishing Coordinator: Kim Boedighe elmer Compositor: Nonie Ratcliff This book is dedicated to Miriam ezust, without whom none of our work would have been possible This page intentionally left blank Contents Foreword ●a。a。。Xv XIX Preface to the Second edition 。XXK11 Acknowledgments…… 。。a。XXV About the authors Part I Design Patterns and Qt 4 ●●●鲁·●。●●·●·●。·●·●●●●··●·●鲁●●·●●●●·●。●●●●●●····●●。·●●●●●·● Chapter1:C++ Introduction…....,,,… 3 1.1 Overview of C++ 1.2 A Brief History of C++ 1.3C+ First Example……………………5 1.4 Standard Input and Output 8 1.5 Introduction to Functions 1.6 qmake, Project Files, and Makefile 17 1.7 Getting Help Online…… 24 1. 8 Strins 24 1.9 Streams 1.10 File Streams 69 1.11 Qt Dialogs for User Input/ Output…… 34 1.12 Identifiers, Types, and Literals 37 1.13 C++ Simple Types 40 1. 14 The Keyword const 52 1. 15 Pointers and memory access.....................54 vii An Introduction to Design Patterns in C++ with Qt 2nd Edition 1.16 Reference variables 音音音 160 1.17 const* and *const 61 1. 18 Review questions 64 Chapter 2 Top of the class 67 2.1 First There Was struct..........................................67 2.2 Class Definitions...........................69 2.3 Member Access Specifiers 71 2.4 Encapsulation .................................74 2.5 Introduction to UML 75 2.6 Friends of a class 2.7 Constructors… 17 2. 8 Destructors 80 2.9 The Keyword static ∴81 2. 10 Class Declarations and Definitions 86 2.11 Copy Constructors and Assignment Operators 音音垂音垂垂 88 2.12 Conversions… …92 2.13 const Member Functions ∴95 2. 14 Subobjects 垂垂 97 2. 15 Exercise: Classes 98 2.16 Review Questions…… 10 Chapter3: Introduction to Qt……………113 3.1 Style guidelines,, Naming Conventions……… 114 3.2 The Qt Core Module…… 116 3.3 QtCreator-An IDE for Qt Programming …119 3.4 Exercises: Introduction to Qt 120 3.5 Review Questions ∴……121 Chapter 4: Lists 122 4.1 Introduction to Containers 122 4.2Ⅰ terators 123 4.3 Relationships…… 129 Contents 4.4 Exercise: Relationships 132 4.5 Review Questions…… 134 Chapter5;: Functions………… 135 5. 1 Overloading Functions 135 5.2 Optional arguments.. ………138 5.3 Operator Overloading 111 5.4 Parameter Passing by value 16 5.5 Parameter Passing by reference …18 5.6 References to const 152 5.7 Function Return values 154 8 Returning References from Functions…… 154 5.9 Overloading on const 155 5.10 inline Functions 158 5.11 Functions with variable- Length Argument Lists……… 162 5.12 Exercise: Encryption 164 5.13 Review Questions 167 Chapter 6: Inheritance and polymorphism 168 6.1 Simple derivation……… 168 62 Derivation with Polymorphism…… 177 6.3 Derivation from an abstract Base Class 184 6.4 Inheritance Design........................................189 6.5 Overloading, Hiding, and Overriding…… 191 66 Constructors, Destructors, and Copy Assignment Operators……… 193 6.7 Processing Command-Line Arguments …198 6. 8 Containers 204 6.9 Managed Containers, Composites, and aggregates 206 6. 10 Containers of pointers 210 6.11 Review Questions... 228 Chapter 7: Libraries and Design Patterns 234 7. 1 Building and reusing libraries …236 7. 2 Exercise: Installing libraries..........................244 An Introduction to Design Patterns in C++ with Qt 2nd Edition 7. 3 Frameworks and Components 247 7.4 Design Patterns 248 7.5 Review Questions.....................................257 Chapter8: QObject; APplication, Signals, and slots……… 259 8.1 Values and Objects...........................263 8.2 Composite Pattern: Parents and Children 264 8.3 QApplication and the Event Loop 272 8.4 Q OBJECT and moc: A checklist 274 8.5 Signals and Slots 275 8.6 QObject Lifecycle 277 8.7 QTestLib 277 8.8 Exercises: QObject, QApplication, Signals, and Slots 282 8.9 Review Questions… .282 Chapter 9: Widgets and designer 283 9.1 Widget Categories……… 284 9.2 Designer Introduction 286 9.3 Dialogs… …290 9.4 Form layout 292 9.5 Icons, Images, and resources .295 9.6 Layout of Widgets 298 9.7 Designer Integration with Code…… 306 9.8 Exercise: Input Forms .................. .313 9.9 The Event Loop: Revisited .314 9.10 Paint Events, Drawing Images 1323 9. 11 Review Questions Chapter 10: Main Windows and Actions 326 10.1 QActions, QMenus, and QMenuBars 327 10.2 Regions and QDockWidgets 37 10.3 SEttings: Saving and Restoring Application State 339 10.4 Clipboard and Data Transfer Operations. .341

...展开详情

评论 下载该资源后可以进行评论 50

冰冰动 非常棒,赞一个
2016-09-22
回复
ppyang395942297111 整体来说还可以。学习一下,顺便学习专业英语
2016-05-07
回复
iriscat 这书其实没什么好看的,学QT建议看QT4 UI编程,学C++……还是看点别的吧
2015-10-07
回复
KevinTao 书还是不错的,就是与设计模式搭在一起有点不合适
2015-05-25
回复
snowtigerzxj 计算机方面的书籍还是老外厉害
2015-04-20
回复
img
Linux菜_鸟

关注 私信 TA的资源

上传资源赚积分,得勋章
最新资源