100% found this document useful (1 vote)
27 views41 pages

Buy Ebook Rapid GUI Programming With Python and QT 1st Edition Mark Summerfield Cheap Price

The document provides links to various programming and educational ebooks available for download, including titles on Python programming and GUI development with PyQt. It features books by authors such as Mark Summerfield and Boudewijn Rempt, along with details about their content and structure. Additionally, it includes information about bulk purchasing options and contact details for sales inquiries.

Uploaded by

borzalucusv6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
27 views41 pages

Buy Ebook Rapid GUI Programming With Python and QT 1st Edition Mark Summerfield Cheap Price

The document provides links to various programming and educational ebooks available for download, including titles on Python programming and GUI development with PyQt. It features books by authors such as Mark Summerfield and Boudewijn Rempt, along with details about their content and structure. Additionally, it includes information about bulk purchasing options and contact details for sales inquiries.

Uploaded by

borzalucusv6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Download the Full Version of the Ebook with Added Features ebookname.

com

Rapid GUI Programming with Python and Qt 1st


Edition Mark Summerfield

https://ebookname.com/product/rapid-gui-programming-with-
python-and-qt-1st-edition-mark-summerfield/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

GUI Programming with Python QT Edition Boudewijn Rempt

https://ebookname.com/product/gui-programming-with-python-qt-edition-
boudewijn-rempt/

ebookname.com

Programming in Python 3 A Complete Introduction to the


Python Language 2nd Edition Summerfield

https://ebookname.com/product/programming-in-python-3-a-complete-
introduction-to-the-python-language-2nd-edition-summerfield/

ebookname.com

Programming Python 4th Edition Mark Lutz

https://ebookname.com/product/programming-python-4th-edition-mark-
lutz/

ebookname.com

Learning and Teaching in the Chinese Classroom Responding


to Individual Needs 1st Edition Shane N. Phillipson

https://ebookname.com/product/learning-and-teaching-in-the-chinese-
classroom-responding-to-individual-needs-1st-edition-shane-n-
phillipson/
ebookname.com
The Critique of Instrumental Reason from Weber to Habermas
1st Edition Darrow Schecter

https://ebookname.com/product/the-critique-of-instrumental-reason-
from-weber-to-habermas-1st-edition-darrow-schecter/

ebookname.com

Practical Obstetrics and Gynecology 2nd Edition Richa


Saxena

https://ebookname.com/product/practical-obstetrics-and-gynecology-2nd-
edition-richa-saxena/

ebookname.com

Water Encyclopedia Domestic Municipal and Industrial Water


Supply and Waste Disposal 1st Edition Jay H. Lehr

https://ebookname.com/product/water-encyclopedia-domestic-municipal-
and-industrial-water-supply-and-waste-disposal-1st-edition-jay-h-lehr/

ebookname.com

Discrete Mechanics 1st Edition Jean-Paul Caltagirone

https://ebookname.com/product/discrete-mechanics-1st-edition-jean-
paul-caltagirone/

ebookname.com

Imperial Ascent Mountaineering Masculinity and Empire


First Edition Peter L. Bayers

https://ebookname.com/product/imperial-ascent-mountaineering-
masculinity-and-empire-first-edition-peter-l-bayers/

ebookname.com
100 Q A About Alcoholism Drug Addiction 1st Edition
Charles Herrick

https://ebookname.com/product/100-q-a-about-alcoholism-drug-
addiction-1st-edition-charles-herrick/

ebookname.com
Rapid GUI Programming
with Python and Qt
The Definitive Guide to PyQt Programming

Mark Summerfield

Upper Saddle River, NJ · Boston · Indianapolis · San Francisco


New York · Toronto · Montreal · London · Munich · Paris · Madrid
Capetown · 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 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
[email protected]
For sales outside the United States, please contact:
International Sales
[email protected]
Visit us on the Web: www.prenhallprofessional.com

Library of Congress Cataloging-in-Publication Data


Summerfield, Mark
Rapid GUI programming with Python and Qt : the definitive guide to PyQt programming / Mark
Summerfield.
p. cm.
Includes bibliographical references and index.
ISBN 978-0-13-235418-9 (hardcover : alk. paper)
1. Qt (Electronic resource) 2. Graphical user interfaces (Computer systems) 3. Python (Computer
program language) I. Title.
QA76.9.U83S89 2007
005.1’2—dc22
2007034852
Copyright © 2008 Pearson Education, Inc.
All rights reserved. Printed in the United States of America.
Trolltech®, Qt® and the Trolltech logo are registered trademarks of Trolltech ASA.
ISBN-13: 978-0-13-235418-9
ISBN-10: 0-13-235418-7
Text printed in the United States on recycled paper at Edwards Brothers in Ann Arbor, Michigan.
First printing, October 2007
This book is dedicated to
Andrea Summerfield
This page intentionally left blank
Contents

Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Part I: Python Programming

Chapter 1. Data Types and Data Structures . . . . . . . . . . . . . . . . . . . . . 9


Executing Python Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Variables and Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Numbers and Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Integers and Long Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Floats and Decimals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Bytestrings, Unicode Strings, and QStrings . . . . . . . . . . . . . . . . . . 20
Collections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Tuples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Dictionaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Built-in Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

Chapter 2. Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45


Conditional Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Looping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
List Comprehensions and Generators . . . . . . . . . . . . . . . . . . . . . . . 53
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Generator Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Using Keyword Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Lambda Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Dynamic Function Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Partial Function Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Exception Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

vii
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

Chapter 3. Classes and Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75


Creating Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Methods and Special Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Static Data, and Static Methods and Decorators . . . . . . . . . . . . . 85
Example: The Length Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Collection Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Example: The OrderedDict Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Inheritance and Polymorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Modules and Multifile Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Using the doctest Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

Part II: Basic GUI Programming

Chapter 4. Introduction to GUI Programming . . . . . . . . . . . . . . . . . . 111


A Pop-Up Alert in 25 Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
An Expression Evaluator in 30 Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
A Currency Converter in 70 Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Signals and Slots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

Chapter 5. Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139


Dumb Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Standard Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Modal OK/Cancel-Style Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Smart Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Modeless Apply/Close-Style Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . 155
Modeless “Live” Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163

Chapter 6. Main Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165


Creating a Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Actions and Key Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Resource Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

viii
Creating and Using Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Restoring and Saving the Main Window’s State . . . . . . . . . . . . . . 181
Handling User Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Handling File Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Handling Edit Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Handling Help Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202

Chapter 7. Using Qt Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205


Designing User Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Implementing Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Testing Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

Chapter 8. Data Handling and Custom File Formats . . . . . . . . . . . . 227


Main Window Responsibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Data Container Responsibilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
Saving and Loading Binary Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Writing and Reading Using QDataStream . . . . . . . . . . . . . . . . . . . 240
Writing and Reading Using the pickle Module . . . . . . . . . . . . . . . 246
Saving and Loading Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Writing and Reading Using QTextStream . . . . . . . . . . . . . . . . . . . 250
Writing and Reading Using the codecs Module . . . . . . . . . . . . . . . 255
Saving and Loading XML Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Writing XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Reading and Parsing XML with PyQt’s DOM Classes . . . . . . . . 259
Reading and Parsing XML with PyQt’s SAX Classes . . . . . . . . . 262
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266

Part III: Intermediate GUI Programming

Chapter 9. Layouts and Multiple Documents . . . . . . . . . . . . . . . . . . . . 269


Layout Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
Tab Widgets and Stacked Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Extension Dialogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
Splitters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Single Document Interface (SDI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

ix
Multiple Document Interface (MDI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

Chapter 10. Events, the Clipboard, and Drag and Drop . . . . . . . . . 303
The Event-Handling Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
Reimplementing Event Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Using the Clipboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Drag and Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Handling Custom Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318

Chapter 11. Custom Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321


Using Widget Style Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
Creating Composite Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Subclassing Built-in Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Subclassing QWidget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Example: A Fraction Slider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Example: A Flow-Mixing Widget . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

Chapter 12. Item-Based Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349


Custom and Interactive Graphics Items . . . . . . . . . . . . . . . . . . . . . . . . . 351
Animation and Complex Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379

Chapter 13. Rich Text and Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381


Rich Text Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Using QSyntaxHighlighter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
A Rich Text Line Edit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Printing Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Printing Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Printing Documents Using HTML and QTextDocument . . . . . . 401
Printing Documents Using QTextCursor and QTextDocument 403
Printing Documents Using QPainter . . . . . . . . . . . . . . . . . . . . . . . . 407
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412

x
Chapter 14. Model/View Programming . . . . . . . . . . . . . . . . . . . . . . . . . . 413
Using the Convenience Item Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Creating Custom Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Implementing the View Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Implementing the Custom Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
Creating Custom Delegates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443

Chapter 15. Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445


Connecting to the Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Executing SQL Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
Using Database Form Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
Using Database Table Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471

Part IV: Advanced GUI Programming

Chapter 16. Advanced Model/View Programming . . . . . . . . . . . . . . . 475


Custom Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Generic Delegates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
Representing Tabular Data in Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505

Chapter 17. Online Help and Internationalization . . . . . . . . . . . . . . 509


Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Internationalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520

Chapter 18. Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521


Creating a TCP Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Creating a TCP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534

xi
Chapter 19. Multithreading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
Creating a Threaded Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Creating and Managing Secondary Threads . . . . . . . . . . . . . . . . . . . . . 544
Implementing a Secondary Thread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
This Is Not Quite the End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559

Appendix A. Installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561


Installing on Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
Installing on Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
Installing on Linux and Unix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570

Appendix B. Selected PyQt Widgets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575

Appendix C. Selected PyQt Class Hierarchies . . . . . . . . . . . . . . . . . . . 581

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585

xii
Foreword
As PyQt’s creator, I’m delighted to see that this book has been written. Al-
though I served as one of the book’s technical reviewers, I’m happy to confess
that I learned a few things myself.
The PyQt documentation covers the APIs of all the PyQt classes. This book
shows you how to use all those classes, how to combine them to create dialogs,
main windows, and entire applications—all of which look good and work well,
with no arbitrary limits, and using a programming language that is a joy
to use.
What I particularly like about the book is that the examples aren’t trivial ones
designed to illustrate a simple point, but are potentially useful in their own
right. The way that different approaches are considered will reward the reader
who wants to develop a deeper understanding of how to apply PyQt to the
development of large scale, production quality applications.
I began the PyQt story back in the late 1990s. I had been using Tcl/Tk for
some time, but I felt that Tk applications looked ugly, especially when I saw
what had been achieved with the first version of KDE. I had wanted to switch
to Python, and so I thought I would combine the change of language with a
change of GUI library.
Initially I used some wrappers that had been written using SWIG, but I con-
cluded that I could produce a more suitable wrapper tool myself. I set to work
creating SIP, and released PyQt 0.1 supporting Qt 1.41 in November 1998.
Development has continued regularly ever since, both to keep up with new re-
leases of Qt and to broaden the scope of PyQt with, for example, the addition
of support tools and improved documentation. By 2000, PyQt 2.0 supported
Qt 2.2 on both Linux and Windows. Qt 3 support appeared in 2001, and
Mac OS X support in 2002. The PyQt4 series began with PyQt 4.0 in June 2006
with support for Qt 4.
My primary goal has always been to allow Python and Qt to work together in
a way that feels natural to Python programmers, while allowing them to do
anything they want in Python that can be done in C++. The key to achieving
this was the development of SIP. This gave me a specialized code generator
over which I had complete control and ensures that Python and Qt will always
fit snugly together.
The essential process of developing and maintaining PyQt is now well estab-
lished. Much of the work is now automated, which means that keeping up with

xiii
new releases of Qt from Trolltech is no longer the problem it once was, and en-
surs that PyQt will continue for years to come.
It’s been very gratifying to watch the growth of the PyQt community over the
years. If this book is part of your introduction to PyQt, then welcome!

— Phil Thompson
Wimborne, Dorset, U.K.
August 25, 2007

xiv
Introduction
This book teaches how to write GUI applications using the Python program-
ming language and the Qt application development framework. The only
essential prior knowledge is that you can program in some object-oriented pro-
gramming language, such as C++, C#, Java, or of course, Python itself. For the
rich text chapter, some familiarity with HTML and with regular expressions is
assumed, and the databases and threading chapters assume some basic knowl-
edge of those topics. A knowledge of GUI programming is not required, since
all the key concepts are covered.
The book will be useful to people who program professionally as part of their
job, whether as full-time software developers, or those from other disciplines,
including scientists and engineers, who need to do some programming in sup-
port of their work. It is also suitable for undergraduate and post-graduate stu-
dents, particularly those doing courses or research that includes a substantial
computing element. The exercises (with solutions) are provided especially to
help students.
Python is probably the easiest to learn and nicest scripting language in
widespread use, and Qt is probably the best library for developing GUI applica-
tions. The combination of Python and Qt, “PyQt”, makes it possible to develop
applications on any supported platform and run them unchanged on all the
supported platforms—for example, all modern versions of Windows, Linux,
Mac OS X, and most Unix-based systems. No compilation is required thanks
to Python being interpreted, and no source code changes to adapt to different
operating systems are required thanks to Qt abstracting away the platform-
specific details. We only have to copy the source file or files to a target machine
that has both Python and PyQt installed and the application will run.
If you are new to Python: Welcome! You are about to discover a language that
is clear to read and write, and that is concise without being cryptic. Python
supports many programming paradigms, but because our focus is on GUI
programming, we will take an object-oriented approach everywhere except in
the very early chapters.
Python is a very expressive language, which means that we can usually write
far fewer lines of Python code than would be required for an equivalent appli-
cation written in, say, C++ or Java. This makes it possible to show some small
but complete examples throughout the text, and makes PyQt an ideal tool for
rapidly and easily developing GUI applications, whether for prototyping or for
production use.

1
2 Introduction

Figure 1 The Eric4 IDE—a PyQt4 application

Since the emphasis of the book is on GUI programming, Part I provides a


fast-paced Python tutorial as well as some PyQt coverage. This material is
clearly marked (just like this paragraph, with “Qt” in the margin) to make
Qt it easy for experienced Python programmers to skip the Python they already
know. Parts II, III, and IV of the book are all PyQt-specific and assume that
readers can already program in Python, whether from previous experience or
from reading Part I.
Quite often in programming we reach decision points when there are several
possible approaches we could take. Reference books and the online documen-
tation identify what classes, methods, and functions are available, and in some
cases provide examples, but such documents rarely provide a broader context.
This book gives the necessary context, highlighting the key decision points for
GUI programming and offering insights into the pros and cons so that you can
decide for yourself what the right policy is for your particular circumstances.
For example, when you create a dialog, should it be modal or modeless? (See
Chapter 5 for an explanation and policy recommendations on this issue.)
PyQt is used to write all kinds of GUI applications, from accounting appli-
cations, to visualization tools used by scientists and engineers. Figure 1, for
example, shows Eric4, a powerful integrated development environment that is
written in PyQt. It is possible to write PyQt applications that are just tens of
lines long, and medium-size projects of 1 000 to 10 000 lines are very common.
Some commercial companies have built 100 000-line PyQt applications, with
Other documents randomly have
different content
corners, since only their pinnacles were visible from the court, and these I had always
supposed to be on the roof itself.

"Why, Amabel, did you know those towers were there?" I exclaimed.

"No," answered Amabel; "and what is that little building that joins on the church?"

"Perhaps it is the cell in which Sister Marie des Anges lived so many years. Don't you
remember mother assistant telling us the story?"

"Who was she?" asked Mrs. Thorpe, glad to see us a little diverted from our grief.

"She was a very holy lady who once belonged to our house a great while ago—a hundred
years, I dare say," replied Amabel. "She lost her mother when she was about sixteen, and
she had a great vocation. Her father, who had several younger children, would not consent
to her entering a convent, thinking she ought to take care of her little brothers and sisters.
So she shut herself up in a room at home, and would not eat with the family, or see any of
them if she could help it, and she slept on the floor and wore sackcloth. At last her father
died, and she could do as she pleased; so she built a little cell opening from the church,
and caused herself to be bricked up in it with but one window, opening to the church, and
there she lived—never coming out, or washing her face, or changing her clothes, till they
were all worn-out."

"She must have been a pleasant neighbor!" interrupted Mrs. Thorpe. "I should have liked a
seat on the other side of the church myself. In England, we think cleanliness is next to
godliness. But how did this pious lady spend her time?"

"In prayer, mostly," answered Amabel; "but she used to work beautiful lace and sell it for
the benefit of the house." *

* I beg pardon of the Canadians for transplanting to another time and place this
paragon, who really belongs to them. Her biographer remarks that she was exercised
with a perpetual aridity of spirit. No wonder!

"I should not like to be the one to wear it," responded Mrs. Thorpe, who did not seem to
admire this saintly personage at all. "You have told the story very nicely, my dear. Shall I
tell you a tale of one of my saints?"

"Oh! Do, if you please!" said both together, and Amabel added: "I did not know Protestants
had saints."

"Oh, yes, we have them, but they are rather different. Well, this young maid, like yours,
was bereft of her mother when she was seventeen, and she had four little brothers and
sisters. Her father was a clergyman—you know Protestant clergy marry—and very poor.

"This young lady had been taught by her mother, who was a well-educated lady. She had
most of the care of the family, for her father had a large parish, and very little means, so
that he was obliged to till a piece of land to help out the living.

"So my young maid—her name was Mary, too—heard her brother's Latin accidence, and so
on till he was ready to go to a foundation school, where he got an Oxford scholarship, and
was made a professor or master, I don't know just what they call it. Another brother got a
berth on a good ship, and now commands a fine vessel of his own.
"Of her two sisters, one keeps a girls' school at Gateshead, where she has brought up
many fine girls to be blessings to their families. The other married a sailor, who, after
many prosperous voyages was cast away in sight of his own home; and now she keeps a
shop, where all the fine ladies about come to buy laces, gloves, and sweet waters, and
oftentimes to learn embroidery stitches and the like.

"My saint herself lived to lay her honored father's head in the grave, and to see every one
of his children doing well in all ways, and then she went home to her well-earned rest. Yes,
indeed, my Mary, my more than mother!—Thou dost rest from thy labors, and thy works
do follow thee!"

"That is my saint, girls," said Mrs. Thorpe, after a little pause. "How do you like her?"

"I think she was lovely!" said Amabel, with enthusiasm. "And all the better because she did
not choose her own work. It was just as if God himself set her a task, was it not?"

"Yes, my dear Mrs. Amabel, God sets us all tasks, if we would but see them."

"And was this lady your sister?" I asked.

"Yes, my dear, my oldest sister; and if I ever have done any good in this world, it is owing
to her. I will show you her picture at home. A traveling artist drew it for us. But it was odd
you should never have known of this cell," said Mrs. Thorpe, returning to Amabel's tale.
"Does it not open to the church now?"

"No; I believe she was built up in it after she died. But there are a great many places
about our house that we never saw."

"That is what I don't like—I mean all that mystery!" said Mrs. Thorpe. "I like things to be
open and above board. Not that I mean to say one word about the ladies in the house we
have left, who have been most kind, I am sure. I am only thinking what chances all this
concealment gives to wicked or tyrannical persons. Suppose a nun misbehaves, or is
thought to do so. She disappears, and word goes that she is sick. By and by it is said that
she is dead. But who knows what has become of her?"

"But such things would never happen in a religious house," said I, half offended.

"My dear, human nature is a poor creature, as my dear father used to say, when he could
find no other excuse for somebody. It is not fit to be trusted with arbitrary power."

"The Jesuits and the archbishop of Paris were religious persons when they persecuted
Mother Angelique and the other people at Port Royal," said Amabel, who had heard that
great lady's story many a time from Mother Perpetua; "but I am sure, Mrs. Thorpe, no one
was ever persecuted in our house."

"I dare say not, my dear; I was only speaking of what might be."

This discussion had thoroughly diverted us, and made us forget to turn back for that last
look we had promised ourselves. It was just as well, for such last looks are of no particular
use.

We now began to see so many wonders, and these wonders increased upon us so fast as
we drew near the city that we were silent from very amazement, and could only use our
eyes. The crowded ways and marketplaces, the shops, the soldiers marching through the
streets, the universal bustle of a seaport town—were enough to surprise and bewilder any
country-bred person, much more two little cage-birds like ourselves, who had never in all
our lives seen a dozen strange faces.

By the time we reached the lodging which the care of Captain Lowther had provided for us,
we were thoroughly tired out, and ready to eat our supper and go to bed earlier even than
we were used to do. We had both one chamber, with two little white and pink beds
furnished with canopies. There was also a full-length mirror in our room, and various other
luxuries. I dare say the place would look dingy enough to us now, but at that time it was
quite a fairy palace.

"What a soft bed!" said I, as I lay down. "I don't know what Mother Prudentia would say to
it."

"She would say we must not talk in bed, I suppose," replied Amabel. "What are they all
doing at our old home?"

"They are at service in the church," said I, as a clock on the mantel-piece struck seven.
"Does it not seem strange that we may sit up till nine o'clock if we choose."

"I could not I am sure, I am too sleepy," answered Amabel. "It seems as though I had
lived a hundred years since morning. Good-night, Lucy."

The novelty of my position and the strange and to me alarming sounds in the street kept
me awake for two hours—a very long time to lie awake at seventeen. I thought over all my
past life, and wondered what the future would be like. I wasted a good deal of conjecture
upon my probably position at Highbeck Hall—such was the name of the place where
Amabel's aunt lived. I thought of the story of Mary Lowther which we had heard in the
morning, and wondered—rather scared at myself for doing so—whether Protestants were
after all such bad people, and whether bringing up motherless children, or even children of
one's own, was not as high a vocation as building oneself up in a hole in the wall, and
living in rags and dirt for twenty years.

Finally I wondered myself to sleep, and did not wake till Mrs. Thorpe called me in the
morning. What a wonderful thing it was to have a mirror to dress by. I was positively
bewildered by it at first, and found I could manage better in the old way.

We saw very little of Toulon. There was some disturbance in the town, owing, I believe, to
the escape of some galley slaves, which made it unpleasant to be in the streets. I know
there was a great marching to and fro of soldiers, and once or twice the firing of guns.

We went out once, however, under the escort of Captain Lowther, to buy some new
clothes, and see some sights. We had new frocks alike of dark silk, which were quite
superb in our eyes, and thick grey woolen frocks, and warm cloaks, which Mrs. Thorpe said
we should need on the voyage, since it was always cold at sea.

On our return from this expedition, a great surprise befell us. We found Father Brousseau
waiting for us, and learned that he was to go to England in the same ship with us. He
informed us that a relative in the north of England had left him a small property, and
beside that, he wished to visit the noble family where he had once been confessor, and
perhaps he might remain with them.

He has since told me that his superiors that it as well for him to leave France for a time,
since he had drawn upon himself the enmity of a noble and powerful family, who would
have no scruple in revenging themselves even on a priest. It was known or guessed that
he had been the means of discovering that plot for sacking the convent which had so
nearly succeeded, and his life, it was said, had already been threatened by some of the
Count de Crequi's family.

Those were terribly lawless times in France. The country was full of soldiers disbanded or
deserted after the peace, ready to beg, rob, or murder, as might suit their purpose best,
and prepared for any desperate undertaking which promised plunder. The great nobles
oppressed their tenants and their weaker neighbors with impunity, and revelled in all sorts
of luxury, while the same tenants ate boiled grass and nettles, or died of starvation at their
gates. They say people are making an effort now to set things straight, but from all I hear,
not much good is likely to come of it. Folks who have been crushed down to the level of
brute beasts are pretty likely to act like wild beasts when once they get loose.

We sailed from Toulon in the first days of August, and arrived in Newcastle in about ten or
twelve days. We had a stormy passage, and Amabel and I were very sick a great deal of
the time, so that Mrs. Thorpe had her hands full with waiting on us. Father Brousseau was
not much better than we, but he made a heroic effort to crawl upon deck every day that
the captain would allow him to be there, and, so Mrs. Thorpe averred, gave wonderfully
little trouble for a man.

How thankful we were to be once more upon dry land; even though that land was none of
the most attractive. Everyone knows that Newcastle is the very centre of the great coal
trade of the North. It seemed to us, as we landed on the wharf, and toiled up the narrow
steep street to that part of the town where Mrs. Thorpe lived, that everything was
begrimed with coal-dust. The very faces of the babies were darkened with it, and we
seemed to breathe it in the air. The streets were narrow and the dingy houses were old
and tumble-down—and seemed to hum with people, like a hive. I suppose Mrs. Thorpe
read some dismay in our looks, for she said kindly—

"This is but a poor part of the town, young ladies; you will come to a better presently."

And in effect, we did come out on a wider and more quiet street, where there were a few
handsome old houses, and several shops of the better sort, at the doors of which
handsome equipages—carriages, or Sedan chairs, were standing. It was to one of the
neatest of these houses, that Mrs. Thorpe directed our steps. I noticed at once, that the
good-sized windows were clear and bright, the pavement in front well cleaned, and the two
stone steps which led down into the shop were as white as hands could make them.

"Welcome to my poor house, young ladies!" said Mrs. Thorpe, turning to us as we entered.
"I hope I shall be able to make you comfortable, though I am not much used to
entertaining ladies of quality. Well, Rebecca, and how do you do?"

"Right well, Clarissa, and glad to see thee back!" said a prim little old lady, who rose from
her seat behind the counter, and welcomed Mrs. Thorpe with a joy which was more forcibly
expressed in her beautiful grey eyes, than in her words.

We looked at her in some surprise; taking her in her grey dress, white kerchief and close
cap, for a sister of some religious order.

"These are the two young ladies whom my brother has brought over from France," said
Mrs. Thorpe, after she had shaken hands with her friend. "This is Mrs. Amabel Leighton,
and this is Mrs. Lucy Corbet, her companion and kinswoman."

The good woman made some kind of salutation, and then began asking questions of Mrs.
Thorpe, about her voyage, and answering others in her turn; while we stood patiently,
almost forgetting our fatigue in observing the strange new place in which we found
ourselves.

The shop was a large one for the place and time. It was exquisitely neat, and crammed full
of goods—laces, ribbons, fans, china jars, and monsters of all kinds, and the air was quite
heavy with the perfume of scented soaps, hair powder, and essences.

"But there, my dears, I won't keep you here, when I know you are tired to death. Come up
stairs directly. Where is Betsy? How do you do, my lass?" As a stout neat looking servant-
maid came in, wiping her hands and greeting her mistress in some language, which no
doubt was intended for English, but which her Northumbrian burr, made absolutely
unintelligible to me. "I suppose the young ladies' rooms are ready, Betsy!"

Betsy signified as much, and Mrs. Thorpe led the way up stairs, and herself introduced us
to a little parlor very neatly and prettily furnished, decorated with some beautiful china,
and with a great bow pot of flowers standing in the window. There were snow-white
curtains to the deep windows, and a Turkey rug, old and faded, but still beautiful, on the
centre of the floor. The furniture was heavy and black with age, but bright as rubbing could
make it; and what most attracted my attention at the moment, a tall press full of books
occupied a recess on one side of the fireplace.

From this pretty parlor opened two light closets, each of which held a little bed, a chair,
and a dressing-table, with a small round mirror hung over it. The sitting-room window
looked out on a small, but neatly kept garden, and through an opening between two great
trees at the bottom, we could see the tower of a grand old church.

"This will be your room, my dears—young ladies, I should say—as long as you remain with
me," said Mrs. Thorpe. "I bade Betsy get it ready, thinking you would like the view into the
garden."

"It is a beautiful room!" said Amabel. "Dear Mrs. Thorpe, how kind you are to us. But you
must not let us take up the best part of your house."

"Oh! I have plenty of room, never fear," answered Mrs. Thorpe smiling. "The house is a
large one. I used to take lodgers, but I don't do it any more. My shop gives me enough to
look to, and I have been wonderfully prospered and cared for. These books and most of the
furniture of this room, belonged to my honored father; and were placed here for my sister
Mary—the one I told you of—when she came to make her home with me. See! Here are
your mails—and I dare say you will like to wash, and change your clothes. It is always the
first thing I want to do when I come off the ship."

A stout serving-man, who looked as if he had never been hungry in his life, brought up our
little trunks. Betsy, who had left the room for a minute, followed him with a great can of
hot water, and a heap of clean towels; and Mrs. Thorpe left us to our toilets.

Mine was soon made, and as the window was open, I ventured to satisfy my curiosity, by
leaning out. I made the discovery that our next door neighbors were very quiet ones. The
house stood near a small grey-stone church, standing in a church-yard thickly sown with
stones, and unmarked graves. On the other side, our garden was bounded by a high wall
on which was trained a vine of some sort; over this, I could just see a bit of what looked
like a grand mansion of brick and stone. I announced my discovery to Amabel, who came
to look in her turn.

"Yes, it all seems quiet and nice," said she, "and the room is very pretty. I did not think
there could be such a pretty place in this ugly town."
"It is dreadfully ugly, at least all we have seen of it," I admitted. "Perhaps it is not all so.
You know Mrs. Thorpe said we came through a poor part of it. See what a pretty house
that is beyond the church-yard, where the gentleman is just coming out. There, he is
coming to the church. I wonder if he can be the priest."

"He does not look like one, though I am sure I don't know what an English priest does look
like. But, Lucy, what would Mother Prudentia say to our staring out of window at a strange
man?"

I drew back quickly enough, feeling, I don't know why, rather vexed at Amabel's words.

The gentleman in question was a tall, stout young man of thirty, or thereabouts, not at all
handsome, but with something very attractive in his face. He was twirling a thick stick, and
whistling to a rough little dog, which ran to and fro among the monuments.

Somehow I took a liking to that gentleman the moment I saw him. There was a kind of
real manliness about him which made one feel that he was a person to be relied upon in
case of danger or distress. I took another peep and saw that he was pulling up some
weeds from a baby's grave.

"Well, my dears—I must learn to say young ladies, I suppose, now you are at home in
England," said Mrs. Thorpe, knocking and entering at the same moment. "But, laws me, it
does come so easy to me to mother all young girls for the sake of my own two—I suppose
you are quite ready for your suppers. Will you join us at the table, or shall I send you
something up here?"

"Oh, we will go to the table," answered Amabel; "and, dear Mrs. Thorpe, I am sure we
shall be only too glad to be mothered, as you say. We are all ready, if you please."

"Please, Mrs. Thorpe, who is that lady below in the shop?" I ventured to ask as we
descended the stairs. "Is she a sister?"

"No, she is not a sister, but a Friend," answered Mrs. Thorpe, smiling. "She is what people
call a Quaker. Have you none in France?"

"I do not know," replied Amabel; "we know not much more about France than England."

"Ah! Yes, that is true. Well, the Friends are a people by themselves, and have their own
ways and notions—very odd ones, too, some of them are. They never go to church, and
have no sacraments, and no settled order of clergy, but they hold by the Bible, and are
very good, honest kind of people. Some of their women, even, are ministers, like Rebecca
Carter's sister. Rebecca is a good creature, and very faithful to me, but she has her ways,
as who has not? You must not mind if she calls you by your plain, Christian names. That is
a part of her religion."

At another time, I suppose all this would have surprised me very much, but the last two or
three weeks had been so full of wonders that I was beginning to lose the power of being
surprised at anything.

We followed Mrs. Thorpe into a kind of back-parlor, or better-most kitchen, I don't know
just which to call it, where the table was set for several persons. Mrs. Thorpe placed
Amabel and myself on either side of her, at the head of the table. She then rang a little
hand bell, and two or three neat looking young women came in from another room, and
took their places near the foot of the board. Mrs. Thorpe said grace, and Amabel and I
crossed ourselves, as we had always been used to do. I saw one of the girls glance at
another and smile contemptuously. Unluckily, Mrs. Thorpe saw it too.
"Betty Humble will leave the table," said she.

Betty colored furiously, and began to stammer some excuse, but Mrs. Thorpe made an
imperative gesture, which sent Betty out of the room, bursting into tears as she shut the
door behind her with more force than was quite needful. I felt sorry for the girl, though I
had felt my cheeks burn the moment before, and I glanced at Amabel, rather hoping she
would intercede for the banished Betty; but she said not a word, nor did anything in her
face show that she was at all disturbed.

The supper was brought in by Betsy, the stout servant-maid, who waited at table more
skillfully than I would have expected from her appearance. The meal was abundant, and
nicely cooked, and, as it was the first meal I ever ate in England, I remember it well. We
had a fine pair of roasted fowls, boiled potatoes, light as meal (the very first, by the way,
that I had ever seen, for they have never been very commonly used in France, and at that
time were not known in our parts). Also, we had a great bowl of frumenty, or wheat boiled
with milk, and a mountain of a brown loaf.

I thought of our dear mothers and sisters in France, sitting down to their meal of coarse
bread and milk, and not too much of that, and it gave me almost a guilty feeling. It
seemed as if I had no right to the savory wing of fowl that Mrs. Thorpe put upon my plate,
and the tears rose to my eyes in spite of me. Mrs. Thorpe noticed the change in my
countenance, as, indeed, she always saw everything.

"What is it, my dear? Anything wrong?"

"No, madame," I answered, making a great effort to compose myself. And then, feeling
that I owed her an explanation, I added in French, and in a low tone:

"I was thinking of the mothers and sisters at St. Jean, and wishing they had my supper."

"Bless your kind heart, Mrs. Lucy, I wish they had!" answered the good woman. "I am sure
they should be heartily welcome to the best my house could afford, if they were only here,
or I could send it to them. But do not let the thought spoil your supper, my dear. If those
who give to the poor lend to the Lord, the good ladies have a fine estate out at interest
into which they will come some day. Anne Thwaites, don't let me see you bend over to
your meat in that way—you will be growing as crooked as a rams-horn before you are
forty."

Anne, a delicate looking girl, pulled herself up, blushing and smiling at the same time. So
the meal proceeded with a little conversation, and now and then a remark addressed to
the apprentice lasses, for so I found them to be.

After all was cleared away, the servants—Betsy, the man who had brought up our trunks,
and an elderly woman, whom Mrs. Thorpe addressed as Mrs. Crump, came in and took
their seats. A large Bible and prayer-book were laid before Mrs. Thorpe; she read a
chapter, and then a prayer in a reverent devout manner, all joining in the Lord's prayer at
the end. If she had asked us to be present, I suppose we should have refused; but either
because she thought it the more discreet way, or from sheer forgetfulness, she never said
a word about it, but took our attendance for granted.

The chapter was the beautiful story of the Shunamite, and that was the first word I ever
heard out of the Old Testament, except indeed the Psalms, most of which I knew by heart.
I observed that Rebecca Carter did not come in to family prayers, but remained in the
shop, where also she had her supper. I concluded that this was one of the "ways" that Mrs.
Thorpe had told us of.
It was August, and the days were growing shorter, but the evening was warm and dry, and
Mrs. Thorpe invited us to go out into her garden.

"It is but a small place compared to that you have been used to!" said she. "But yet it is
not so bad for a town garden, and the church-yard being next, gives us plenty of fresh air."

"I think it is a lovely garden!" said Amabel with great enthusiasm, and indeed it was.

Every nook and corner was improved to some good purpose, either filled with such hardy
flowers as flourished so far north, or with sweet herbs or berry bushes. The sunny wall had
an apricot trained upon it, and there were two grand standard pear trees, and a low bushy
apple tree, all three laden with fruit. There was also a pretty arbor, covered with a great
Virginia vine, just beginning to turn red.

"My husband brought that vine from over-seas in America, himself," observed Mrs. Thorpe,
"as well as that tree you see yonder, in the church-yard; the tree has beautiful flowers
upon it. My sister's grave, and that of our two daughters are just under it."

"Were your daughters grown up, madame?" I ventured to ask.

"They were just about your age. They were both taken in one week's time of a fever, which
was in the town."

"That was very sad!" said I.

"Yes, my dear, very sad. I hardly knew how to bear it at first, and I do not know but I
should have sunk under the blow, only that many of our neighbors were ill, and needed my
help. Would you believe it, my dears? In that very house next door, the mother was taken
down, and her own sons and daughters would not go near her, but left her wholly to the
care of a wretch, who drank the wine given for her patient, and then ran away and left her.
I went in to see her, and by good hap, was in time to save her from sinking at the crisis of
the fever."

"'My good Mrs. Thorpe, it is very kind of you to look after Mama!' said one of the
daughters, in her fine lady lisp and drawl; 'but I suppose it is natural to you to like to take
care of the sick.'"

"'Madam!' says I. 'I hope it will never be natural to me to desert those who need my help,
whether they be strangers, or my own flesh and blood,' says I."

"Oh! I gave them a bit of my mind, I promise you; they were greatly offended and would
not come into my shop for a long time; but I let them alone and they got over it."

"Do they live there now?" I asked, much interested.

"Oh, no! They are all gone. One daughter married, and died of the smallpox. The other
wedded a fine London gentleman, who soon gambled away all her property, and left her in
great poverty and distress, poor thing. She lives in a little cottage over in Gateshead, on
what she can make from the rent of this house; which is not much, for it is in bad repair,
yet a fine old mansion too, and I will show you over it some day. See! Here are some
monthly roses—a bud for each of you."

"Have you not a bud for me also?" asked a cheery voice, from over the stone wall next the
church-yard.
We all turned round, and there stood the tall gentleman we had seen before. He was
leaning on the wall, and lifted his hat politely.

"Ah! Mr. Cheriton, I did not know your Reverence was in town!" answered Mrs. Thorpe,
curtsying low. "I fear there are no more rose-buds, but here is a clove pink if you will have
it."

"And when did you come home from foreign parts?" asked Mr. Cheriton, accepting the pink
with a bow, and putting it in his button-hole.

"Only to-day, your Reverence. This is Mrs. Amabel Leighton, and her kinswoman, Mrs. Lucy
Corbet, who have come home, and are staying with me, till they can go to their aunts at
Highbeck house."

"That is not likely to be very soon, I fear, unless both of these young ladies have had
smallpox!" said Mr. Cheriton. "I have just come home from my father's, and went over to
pay my respects to the old ladies, who made me the bearer of dispatches to yourself."

Mr. Cheriton bowed to us severally as he spoke, and then produced a letter bound with a
bit of floss silk, which he gave to Mrs. Thorpe. Then bowing again, and whistling to his
dog, he departed. Mrs. Thorpe led us into her own parlor behind the shop, where we
waited in some anxiety, while she read the note the gentleman had handed her.

"Here is a change of affairs with a witness!" said she, when she had succeeded in making
out its contents. "My dear young ladies, can you content yourselves to live with me for a
few weeks? Your aunt writes that they have two cases of smallpox in the house, and that
they are every day expecting Mrs. Chloe, the youngest lady, to come down with the same,
and that she would prefer to have you remain with me till the danger is over. I think you
told me you had never had the smallpox."

"Not unless we were very young at the time," we told her.

"Ah, then we will run no risks. But can you content yourselves with living quietly in my
plain way for a little, or would you rather go to my sister's school, where you can have
companions of your own age?"

We assured her that we would rather stay with her than go anywhere else, and, indeed, I
think we both felt it to be a reprieve. We had grown to love Mrs. Thorpe, and to feel
confidence in her, and the notion of strange companions of our own age was rather
alarming than attractive. So the matter was settled. We would make it our home for the
present, with good Mrs. Thorpe, who would on the morrow send word to that effect to our
aunts at Highbeck Hall.

"Amabel," said I, when we were once more alone in our own pretty room, "do you think we
did wrong to be present at Protestant worship? Ought we to have come away?"

"No, I don't think so," answered Amabel, after a little consideration. "We could not help it,
and there was nothing contrary to religion in the prayers."
"But there was no Hail Mary! Or any other devotion to the mother of God."

"That is true. I believe Protestants do not honor her as we do. But, Lucy, you know how we
used to read the 'Imitation of Christ' over and over. Mother Superior always had it by her
when she was ill, and there is not a word in that about the mother of God, any more than
in Mrs. Thorpe's prayer."

"That is true enough; I never thought of it before," I answered. Then—changing the


subject—"Are you glad, or sorry, that we are not to go to Highbeck Hall directly?"

"Glad, on the whole," answered Amabel. "It will give us a little time to rest, and get used
to English ways. Come, let us say our prayers, and get ready for night. Those little white
beds look so nice after the berths on board ship."

They did, indeed, but I had one question more.

"Amabel, what do you think of Mr. Cheriton?"

"I don't think of him at all;—why should I?" answered Amabel, a little shortly. "Come, let
us go to bed."

And so ended our first day in England; but I think Amabel did think a little bit about the
tall young rector after all.

CHAPTER IX.

LADY THROCKMORTON.

THE next day Father Brousseau came to see us. We had been so hurried and flurried at the
time of our landing the day before, that we had hardly exchanged a dozen words, and now
he came to bid us farewell before going to his friends in the country.

They had sent some one to meet him—a gentleman-in-waiting of some kind, and a very
solemn and dignified person indeed, who accompanied him to our house. He had furnished
the good priest with a suit of raiment, such as is worn by ordinary English clergymen, not
wishing, I suppose, to have him attract notice as a foreigner.

There were at the time considerable disturbances in the country. A French war was
impending, and an apprehended rising of the Jacobites, or adherents to the house of
Stuart, which really took place the next year, had awakened the "no popery" feeling,
always prevailing more or less in the lower and middle classes. I must say he had not
succeeded very well in disguising him, for Father Brousseau looked, if possible, more
priestly than ever.

He was to leave town that very day, and it was easy to see that the serving-man was
anxious to get him away. Indeed, he made his impatience so manifest, that our leave-
taking was rather a hurried one. The father gave us some advice as to our conduct,
enjoined it upon us to read no heretical books, and attend no heretical services, to say our
prayers and keep at home, and to be guided by Mrs. Thorpe in all things not belonging to
our religion. He gave us each a little picture, and his blessing, and bade us farewell. I did
not see him for many a year afterward, when times were greatly changed for both of us.

It must be confessed that for a few days, we lived rather an idle and unprofitable life at
Mrs. Thorpe's. The good woman herself was naturally very busy after her long absence,
and she left us much to ourselves. We had never been used to the ordering of our own
time any more since we were grown up, than when we were three years old.

In the convent every hour brought its own occupation, in the same regular routine, day
after day, and year after year, and we never thought of anything else. We had never been
trained to think or decide for ourselves in the smallest matter. "A good religious has no will
of her own, and no more thinks of guiding herself than does the needle she sews with,"
was a favorite saying of Mother Superior's, and we had been brought up on the same
principle. A man who has never learned to walk alone, will, if left to himself, stumble just
as much at fifty as at three, and will probably hurt himself a good deal more. It is
therefore no wonder that being, as it were, thus suddenly put on our own feet, and bade
to go, we did not know very well how to set about it.

Mrs. Thorpe, as I have said, had provided us with a parlor of our own, but we liked better
to sit in her room which opened from the shop, and watch the many customers—the fine
ladies who came for essences, laces, and fans, and the hundred and one nothings in which
Mrs. Thorpe dealt—to cheapen china jars and dragons, and go into ecstasies over tiny tea-
cups and French painted fans—and the still finer gentlemen who came to see the fine
ladies, look over the last novel—for Mrs. Thorpe added that of a circulating library to her
other business—and discuss the latest bit of news and scandal.

Mrs. Thorpe usually found or made time to take a walk with us every day, and when she
could not go herself, she sent Mrs. Crump, her housekeeper, a most respectable woman,
whom we particularly liked, because she had come from Cornwall, and could tell about the
place where our mothers had grown up.

In the house I am afraid, we dawdled sadly. We found ourselves for the first time among
books. Mrs. Thorpe, as I have said, kept a circulating library, but she by no means made
us free of its contents. However, she picked out for us Mr. Thomson's Poems and Dr.
Young's, and the then new romance of "Sir Charles Grandison" in its seven closely-printed
little volumes, (the good Richardson had made fourteen in the first place) and allowed us
to amuse ourselves with these. *

* This is an anachronism. "Sir Charles Grandison" was published in 1751.

To say that we read these books was nothing. We devoured them, read them aloud to each
other, and talked about them from morning till night. Books of any sort other than "Lives
of the Saints" and "Meditations" were such a wonder to us that it is not strange our heads
were a little turned with them. I think Amabel and I had our first difference of opinion over
the amiable Clementine, whom she admired for her wonderful spirit of self-sacrifice and
piety, and whom I thought a sentimental little fool—(I have never changed my mind)—and
she was downright vexed with me, when I laughed outright at the pathetic image of Sir
Charles and Clementine on their knees to each other, and the faithful Camilla presenting a
smelling-bottle alternately to each of their noses. We were actually rather cool to each
other for a whole day, but made up our quarrel at night over Mr. Thomson's description of
a thunder shower.

I have said that Mrs. Thorpe's shop was a resort for all the fine folks in town. It was not
long before we began to be observed as we sat in the back-parlor, which was divided from
the shop by a screen. In this parlor were kept some special boxes of lace too precious to
be trusted to the outer shop, and hither also came the fine ladies to try on the "heads,"
ruffs, and so on, which they were minded to purchase.

At this distance of time, I may say without vanity, that I was an unusually pretty girl,
though not so handsome as Amabel. She was and is one of the most beautiful women I
ever saw in my life. I had a dark clear skin, with a fresh color, and the crisped or waved
black hair so common in Cornwall. Amabel, on the contrary, was fair and delicate as a lily,
with dark clear grey eyes, and a wonderful profusion of straight golden hair, a little
inclining to redness. Her features were regular, and she had always a calm placid look, a
little wondering, as it were, as though her spirit had not got over its surprise at the strange
sphere wherein it found itself.

Ladies began to notice us, and gentlemen to pass and re-pass the door of the parlor, and
put up their eye-glasses to stare at us. All this made Mrs. Thorpe a little uneasy, and she
used now and then to make a pretext to send us out of the room.

One day, a grand equipage stopped at the door, with a great clatter of horse-hoofs. A
lackey in a fine livery jumped down and opened the door, and a gentleman who was in the
shop rushed forward to give his hand to a very fine lady indeed, who descended from the
vehicle. She wore an immense hoop, at least eight yards in circumference, a sacque and
petticoat of contrasting colors. Her hair was cut and curled close round her well-rouged
and patched face, and she wore a very small chip hat cocked up at one side, and trimmed
with very rich, white and silver ribbons. These same white ribbons had a significance
which, at the time, I did not understand. The lady was followed by her gentlewoman in
waiting, an impudent looking piece, nearly as fine as her mistress, who carried a horrid
little lap-dog in her arms.

"Is it possible?" exclaimed the gentleman, laying his hand on his heart with a theatrical air.
"Do my eyes deceive me, or does the adorable Lady Throckmorton deign once more to
bestow on our barbarous town the light of her presence? I had thought nothing would
bring you from the Baths at this time of the year."

"And nothing would but dire necessity, I assure you, Captain Lovelace," answered the lady.
"But Sir John's mother, who is much in years and very frail, desired to see her son, and Sir
John would not travel without me—indeed he is not very fit to do so—so as I could not
deprive the poor lady of what might be the last sight of her son, I was obliged to quit all
the dear delights of the Baths."

"Angelic goodness!" said Captain Lovelace.

"Nay, 'twas no such great matter. We shall all come to age and infirmity some day. My lady
has been a good mother to her son, and would have been to me if I had but let her."
The lady spoke these last words with a tone expressive of some emotion. I even thought
there were tears in her beautiful eyes. If so, she soon dispersed them, and, as if she were
ashamed of her late seriousness, she began to chatter the most arrant nonsense to
Captain Lovelace and her dog, alternately,—treating the one with about as much respect
as the other, I thought, while she turned over the caps and aprons Mrs. Thorpe showed
her, calling one horrible—absolutely hideous and revolting—and another ravishing, angelic!
Perfectly divine!

"I must positively try this on, my good Thorpe; it is just my style. Has any one else seen
it?"

"Nobody, my lady. I have but this morning unpacked it, and I brought it from France only a
few days ago. If your ladyship will step into the parlor."

Amabel and I were sitting in the parlor—Amabel reading and I busy with some pretence of
needlework. We usually retired on such occasions, but I had a mind to see a little more of
this very fine lady, and I am ashamed to say I purposely upset my work-basket, and set
the spools rolling all about the floor. The two grey kittens instantly pounced upon them,
and, while I was rescuing my materials, Lady Throckmorton entered the room. She stood
as if transfixed for a moment.

"Whom have we here? A ghost from the other world!" she exclaimed. "Mrs. Thorpe, where
have you found this living image of poor little Lady Leighton?"

"This is the daughter of Sir Julius Leighton, my lady," answered Mrs. Thorpe, presenting
us; "and this is her cousin and foster-sister. I brought the young gentlewomen from France
but a few days since, and they are staying here under my care till the smallpox shall be
over at Highbeck Hall."

"Yes, I heard Mrs. Chloe was in a way to have her youthful beauty spoiled," said Captain
Lovelace.

"For shame! You spiteful creature!" said the lady, giving him a blow with her closed fan.
"Mrs. Chloe is my particular friend. And so are Lady Leighton's daughter, as well as her
living image," she added, turning to Amabel, and speaking in quite a different tone. "I
knew your mother well, my child. You and my Alice were born on the same day, but she
was but a frail creature, fading in her earliest bloom."

Again a softer look came into her eyes. I never saw such eyes as hers. They were of a
sapphire-blue, very bright and clear, with a sort of hardness and sharpness in them, and
flashing with a fierce and baleful luster when she was offended. She was indeed a most
curious mixture of good and evil, as I came to know afterward, but the evil predominated,
being let to have its way unchecked, and she perished miserably at last, poor thing!

"Mrs. Thorpe never made a more beautiful or valuable importation, I am sure," said
Captain Lovelace, bowing to us both, though he had not been included in—indeed, had
been rather pointedly left out of—the presentation.

Lady Throckmorton's eyes flashed for a moment.

"Your presence in this room is not required, Captain Lovelace," said she in a stately
fashion; then, as the gentleman retired, with an extravagant gesture of humility and
despair, "You must not listen to such gallants, my loves," she added, in a lighter tone.

"I do not, madam," answered Amabel quietly.


"A dignified young lady, upon my word. And who is this?" Turning to me. "She reminds me
of some one, I cannot tell who."

Mrs. Thorpe explained who I was, and her ladyship was pleased to say she remembered
my mother quite well.

"She came from Cornwall with Lady Leighton, and they were quite inseparable, I
remember," said she. "Your mother afterward married a gentleman who had a small estate
in the neighborhood, and was killed by a fall from his horse. Yes, yes; I remember. My
good Thorpe, you must take care of these visitors of yours."

"I hope to do so, my lady," answered Mrs. Thorpe, not without emphasis, as I thought.

"And have you seen anything of the town yet, my rose-buds?" asked the lady, turning to
us. "I suppose not. Come, get your hoods, and I will take you for an airing. No, on second
thought, I cannot either, for I promised my old lady to return in time for her afternoon
drive. I shall have my own horses another day, and then I will call for you. Meantime, Mrs.
Thorpe must let me present you each with one of these fine aprons."

So saying, she selected from the stock before her two lawn aprons with more puffs,
ruffles, and lace than there was of the original stuff, and bestowing one upon each of us,
she sailed out to her carriage, attended by Captain Lovelace, and followed by her maid and
dog. This was our first sight of that famous beauty and wit, Lady Throckmorton of
Newcastle. It would have saved us a good deal had it been the last.

"There goes a fine woman spoiled," said Mrs. Thorpe. "I was glad she was obliged to go, I
did not like to have you go out with her, and I did not exactly know how to refuse."

"But why do you call her spoiled?" I asked. "I am sure she is very generous in giving us
these beautiful aprons."

"'Tis not hard to be generous when some one else pays the bills," answered Mrs. Thorpe.
"However, we will not judge the poor thing. Her notice was at least kindly meant. Perhaps
if her children had lived she would have been different. But, my young ladies, though I do
not like to deprive you of a pleasure, I fear I must banish you forth of this parlor during
business hours. 'Tis too public a place for ladies of quality, and I have no mind to have you
brought under the notice of Captain Lovelace and others of his stamp, of whom we have at
present only too many in the town. So, my dears, you will amuse yourselves as well as you
can in your own room."

We had now no choice but to withdraw, and were soon seated in our own pretty parlor.

"So it seems we are to be imprisoned in this dull room for the future!" said I, pettishly
enough. "One might as well be in the convent again, as shut up in this poky place."

"You did not think it poky at first!" said Amabel. "And I think, Lucy, Mrs. Thorpe is right
about our sitting in the shop. I am sure Mother Prudentia would say the same, if she were
here."

"Mother Prudentia is not our governor now," I replied.

"No! But Mrs. Thorpe is, now that our relations have put us under her care. I must say, I
don't care to see that Captain Lovelace again; I thought him very rude," answered Amabel
with a flash of her eye, such as I had hardly ever seen before.
"You did not think Mr. Cheriton rude, when he gave you those flowers over the wall this
morning!" said I.

"That was very different!" answered Amabel. "I am sure, Lucy, you can't compare Mr.
Cheriton's manners with those of Captain Lovelace. Mrs. Thorpe herself was by and saw no
harm. But I don't think it is very nice to be talking about young men in this way."

"One may as well talk of them as think of them, I suppose!" I answered, rather flippantly.

Amabel made me no answer, but withdrawing into a corner, she laid aside Mr. Thomson's
poems, and, betook herself to her book of "Hours," which had been rather neglected of
late. I took up my work, and we sat in silence, till called to dinner.

A few days afterwards, we were walking with Mrs. Crump. We had been to carry a basket
of food some pensioner of Mrs. Thorpe's, and were pacing along rather soberly, thinking of
the sad scene we had just witnessed, when we heard our names called.

We looked and saw Lady Throckmorton, leaning out of her carriage. She was more dressed
than ever, with splendid jewels in her ears, and on her neck. Of course we stopped to
curtsy, and were passing on, when she beckoned us again; the coachman at the same time
drawing up to the side of the street.

"So I have caught you, my doves!" said she. "I must positively take you for an airing, and
carry you home to have some tea with me. Nay, I will take no refusal. This good woman
will make your excuses to Mrs. Thorpe, if any are needed."

Mrs. Crump was a very quiet woman, who dressed in the plainest way, and rarely said a
needless word. She did not, however, seem at all dashed at the presence of the great lady,
but answered her, even with dignity.

"So, please you madam, I think the young ladies had better see Mrs. Thorpe themselves,
before going any where else."

"Woman, you forget yourself!" said Lady Throckmorton, with that angry flash of the eye,
that I had observed before. "I would have your mistress know, that Lady Throckmorton's
notice is an honor to any young lady. Come girls—my black haired beauty, I am sure, is
not afraid of the old shopkeeper. Come, I cannot keep the horses standing."

I think Amabel would have refused, but that she saw me determined to accept Lady
Throckmorton's invitation, and she would not let me go by myself. So we got into the
carriage and drove away, leaving Mrs. Crump standing on the pavement.

"Insolent old creature!" said Lady Throckmorton. "But there, never mind her. Tell me about
yourselves, and your life—where were you educated?"

"In France," we told her.

"Ah! That is how you come to carry yourselves so well; and what have you learned?"

I gave her as good an account as I could of our acquirements.

"Why! You are real paragons—I must have you with me, while I am here—I positively
must, indeed—nothing takes like a new face, and your conventual simplicity is truly
charming. It will never do for you to be buried at Highbeck Hall, with those old frights,
each more absurd than the other. I must write to your father, Miss Amabel Leighton."
This was the first time I ever heard the title of Miss, which was just then coming into
fashion.

"The ladies you speak of are my aunts, madame," said Amabel, with some dignity.

"That does not hinder their being old frights, child. Oh! You must not mind me, I say I
think of every one. Well, here we are at home. I must introduce you to my poor old Sir
John; he is not so old either, but a sad invalid, poor man."

We had driven into a paved court, and now alighted at the door of the handsomest
mansion I had yet seen.

Lady Throckmorton led us through a grand hall, up a fine oak staircase, which reminded
me of the great staircase at St. Jean, and into her own dressing-room; which was a rather
small apartment, so crowded with all kinds of nick-nacks, that it was hard to move without
knocking down a china mandarin, or a shepherdess, or upsetting a potpourri. The air was
heavily laden with scents, as that of Mrs. Thorpe's shop. The windows were hung with rich
draperies, and another curtain was looped over a door, which opened into a richly
furnished bed-chamber. One of the most noticeable things in the room, was a finely
painted portrait of a gentleman, surrounded by a wreath of white roses, so beautifully
made, that at first I thought them real, and wondered where they came from.

"This is my den," said Lady Throckmorton. "I told Sir John I positively could not stay in this
horrible old pile of bricks unless he would allow me to fit up two or three rooms to suit my
own taste. He is a good-natured creature, and so, though he worships his hideous old
chairs and tables as if they were veritable household gods, he gave me leave to do what I
liked with these rooms, and a withdrawing-room down stairs. What do you think of the
general effect, eh?"

She evidently expected us to be quite dazzled with all her splendor, and I indeed was so,
though all the time I was conscious of a certain something which pained the eye. Amabel
answered that we had seen so little of such things, that we were hardly good judges. My
lady was evidently a little nettled by her coolness, and began to display one fine bit of
china and gilding after another, till the entrance of her waiting-woman interrupted the
lecture.

"Tea is ready, my lady," said the Abigail, as it was then the fashion to call these
personages, "and Captain Lovelace and some other gentlemen are in the drawing-room."

"Dear me, I had no notion it was so late. You have been so entertaining, girls, that you
have lent new wings to time."

N. B.—We had hardly said ten words between us, but I have observed that people are
usually better entertained with their own conversation than that of any one else.

"See, Wilson, can you make these girls presentable at short notice? I wish to take them
out with me this evening."

Mrs. Wilson looked critically at us, and began to suggest various additions to our simple
toilets.

"No, on second thoughts, you may let them alone, only select one of my lace aprons and a
necklace apiece for them. Those black velvet bands with the pearls sewed on will do. No,
let the hair alone, 'tis well enough as it is. Those gipsy hats are very becoming, only they
should be trimmed with white. Don't wear red ribbons, girls, whatever you do, but blue
may pass well enough. There, that will answer, Wilson."
All this time, Mrs. Wilson had been pinning on the aprons, tying on the necklaces, and
otherwise decorating us, till I felt as if I was a doll being dressed for Mrs. Thorpe's show
window. I glanced at Amabel. She looked more uncomfortable than I had often seen her.
There was not much time to notice looks, for my lady beckoned us to follow her, and we
did so, passing down stairs into a small drawing-room, where was a table set out with a
tea equipage in silver, and any number of odd little china cups.

There were two or three gentlemen in the room, and a thin middle-aged lady very plainly
dressed, and with a good serene face, which attracted me at once. In one corner, with a
table to himself, sat a thin elderly man, evidently an invalid, to whom we were presented
as Sir John Throckmorton. The poor man's face brightened as he heard Amabel's name.

"And so you are Sir Julius Leighton's daughter," said he kindly. "Your father was an honest,
worthy gentleman, and we have had many a day's sport together when we were young. I
suppose he is still in London. Will he be coming north before long?"

"I do not know, Sir John," answered Amabel. "We have not heard from him since we
landed in England."

"He will come north at the right time, I dare say," said Lady Throckmorton. "Come, Sir
John, I cannot have you monopolizing our young ladies. We shall have cutting of throats
presently."

She then gave us seats on each side of herself, and presented the gentlemen as they came
up. I remember none of them except Captain Lovelace, who had the impudence to claim a
previous acquaintance, and Mr. Cheriton, who came in just as the ceremony was
concluded. He looked surprised, and, as it seemed to me, not very well-pleased, at finding
us in such company.

I noticed in a moment that, while all the other gentlemen wore white rose-buds in their
button-holes, he wore a red clove pink which Amabel had given him that very morning. I
think Amabel saw it too, for she blushed and looked confused.

Lady Throckmorton's keen eyes flashed from one face to the other as if she suspected
something.

"So you know my young visitors already, Mr. Cheriton," said she. "How is that?"

"We are neighbors, you know," answered Mr. Cheriton easily, "and as their parish priest
and spiritual guide, it was my duty to make acquaintance with them."

I must say I was not pleased with the tone in which he spoke—as if his sacred profession
were a thing to be joked about.

"And you ventured to come hither with a red flower in your button-hole!" continued the
lady in the same bantering tone, which yet seemed to have a meaning in it.

"Red is my favorite color," answered Mr. Cheriton.

"I have heard it was a thrifty color—no doubt that recommends it," said one of the
company with an undisguised sneer.

"You are right my lord, it is a thrifty color, and does not change, easily," answered Mr.
Cheriton, dryly enough. "I have known many white roses turn red, but I don't know that I
have ever seen a red one turn white."
"Let the white ones become the fashionable color and the red will turn fast enough,"
retorted the other angrily.

"Possibly, but that fashion has not yet been set."

"Come, come, I will have no sparring," said Lady Throckmorton imperatively. "Captain
Lovelace, do you not see that Miss Bunnell has her tea all ready to dispense? What are you
thinking of? Give them plenty of sugar, my good Bunnell, and sweeten their tempers."

On this hint the gentlemen bestirred themselves, and handed us little cups of tea with
sponge cakes and other things of that kind. I had not yet learned to like tea, which I had
never seen till I came to England, and Lady Throckmorton seeing that I did not drink mine,
bade Mr. Cheriton exchange it for a cup of chocolate. My lady herself waited upon her
husband, carrying him his chocolate and other refreshments, and spending some minutes
in arranging them to his liking.

"How devoted Lady Throckmorton is to her husband! Is it not a pretty exhibition?" said
Captain Lovelace in my ear, as he stood just behind me. "She is always so—at least when
there is any one to see her. He has all his personal property in his own power, and she has
no settlements to speak of; but of course that has nothing to do with the matter."

I knew nothing of settlements or personal property at that time, but I understood the
implied detraction, and felt indignant at it. I had begun to feel very uncomfortable by that
time, as if I had of my own accord walked into a net out of which I did not see my way.
Presently Lady Throckmorton came back to her seat, and began asking the news of the
day.

"They say the Methodists are coming hither again," said Captain Lovelace. "If so, we shall
have some sport. You ought to have seen how we served them at Leeds when I was there.
There was a bull-baiting in the town, and we drove the bull right in among them, as they
stood with open mouths and ears, around their prophet. There was a fine scattering at
first, I promise you. But if you will believe it, when the beast got into the crowd, he stood
stock still by the side of Mr. Wesley himself, as quiet as he had been a tame dog." *

* This incident, or one nearly similar, happened at Pensford, March, 1742.

I saw Mrs. Bunnell smile at this, as with a kind of triumph, at which I wondered, for it
seemed to me a mean and dastardly action.

"I have taken a shorter way than that," said Lord Bulmer. "I took up a local preacher, and
another fellow of that sort who had the impudence to come praying and exhorting among
my tenants, and sent them for soldiers on the spot. I told them I would soon stop their
prayers, and one of them, if you will believe me, had the impudence to answer me: 'You
cannot do that, my lord, unless you can stop the path to heaven.' Why, one of those
rascals had the impudence to tell Dr. Borlase himself that he knew his sins were forgiven."

Again I saw the smile pass over Mrs. Bunnell's face.

"These Methodists seem to me to be a harmless sort of folks enough—mere visionary


enthusiasts," said Mr. Cheriton, helping himself to a piece of plum cake as he spoke.

"They are traitors—rascals who turn the world upside down—Jesuits in disguise, if the truth
was known," said Captain Lovelace.
"That, of course, would be enough to condemn them in your eyes," said Mr. Cheriton,
carelessly, "your aversion to Jesuits, and those who are governed by them, being so well-
known."

Again I saw by the expression of the faces around me, that the words had some hidden
meaning.

"Well, well, we shall know how to serve them if they come here," said Lord Bulmer.

"They have been here already—do you not know it?" said Lady Throckmorton. "I myself
heard a part of one of Mr. Wesley's sermons, and thought him very eloquent. And my good
friend Bunnell here, was altogether won over by him, so that she thinks it a sin to wear so
much as a feather or a necklace."

"Is that true, Mrs. Bunnell? Nay, I cannot have that," said Mr. Cheriton, turning to the lady,
who had sat quietly behind her mistress. "I look upon you as one of the pillars of my
church."

"Mr. Wesley withdraws no one from church," answered Mrs. Bunnell, in her clear, even
tones. "On the contrary, it has been objected to him that he makes trouble for the clergy
and sextons by bringing so many to the sacrament." *

* See Charles Wesley's "Journal."

"I could bear a little trouble of that kind, methinks," said the rector; "but surely, Mrs.
Bunnell, you do not justify such presumption as a common man saying that he knows his
sins are forgiven?"

"The paralytic was but a common man to whom One said, 'Thy sins be forgiven thee!'"
answered Mrs. Bunnell. "And why should you read the absolution in church if no one is to
believe himself absolved?"

"Come, come, Bunnell, we want no conventicles here. You and Mr. Cheriton must settle
your disputes elsewhere than at my tea-table."

"Nay, madam, she did but answer my question," said Mr. Cheriton, good-naturedly.

"Then you need not have asked such a question," returned the lady sharply. "I hate people
who are always dragging religion in by the head and shoulders, reminding one of
everything dismal that one wishes to forget. Commend me to a preacher like yourself, Mr.
Cheriton, who gives us good moral discourses that don't make one uncomfortable. I hate
the Methodists, with their rant and pretence of spirituality, and what not, and I hope if the
preachers come here again, they will get a warm reception. Gentlemen, if you have
finished your tea, we ask to be excused, as I propose to take my young friends to the
theatre this evening."

The gentlemen took their leave on this hint, and Mrs. Bunnell also withdrew. Sir John's
man came and carried him off, and we were left alone with my lady.

"Bunnell is a good creature, and devoted to me," said her ladyship, when we were by
ourselves, "but I think I shall have to let her go if she keeps on with her high-flown
notions. I told her the other day that she might be content to let Mr. Cheriton think for her
in such matters; and what do you suppose she answered me? Why, that as Mr. Cheriton
could not be saved or lost for her, she must needs think for herself. But come, it is time we
were going. See, here is a fan apiece for you," pulling out a handful from a box; "take your
choice."

"But, madam, I think we should be going home," said Amabel. "It is growing dark."

"Nonsense, child! You are going to the play with me, and then I will set you down at home,
or bring you back here, if it is too late. Nay, not a word," with an imperative gesture, as
Amabel would have spoken. "You are in my hands, and must do as you are bid."

She left the room for a few moments, and Amabel turned to me.

"What shall we do?" said she. "Oh, how I wish we had never come."

"It was all my fault," I answered: "but I don't see how to help it now; we cannot find our
way home alone, through this great town, especially as it is growing dark. If Mrs. Thorpe
wanted us, she would send for us."

"True!" said Amabel. "She knows where we are, and could send Timothy for us."

She had done so, we found afterwards, but we were not told of it.

"We must do as my lady bids us, till we can get away; but Lucy! I do not like her, nor this
place."

"Nor I!" I answered. "I feel as if we had got into the hands of the fairy Melusene, that
Mother Prudentia told us of. I have not seen one person who seemed real to me, except
that nice Mrs. Bunnell—and Mr. Cheriton."

My lady returned at this moment, so we had no chance for any further conversation. We
went with her to the play; I don't remember what it was, and indeed, there was such a
buzz of conversation, and the lights and music so bewildered me, and gave me such a
headache, that I had much ado not to burst out crying. I was thankful enough when the
evening concluded.

Captain Lovelace had been in the box all the evening, and had full possession of her
ladyship's ear and attention. I fancy from words that I caught, that there was some
political intelligence going among them. I saw that many of the ladies wore white ribbons,
and other red; while a few seemed to have tried to make a compromise between the two.

"What ails you, child?" said my lady somewhat sharply, as the play being at last concluded,
she had time to notice me. "You are as white as a ghost."

"Lucy has a bad headache, madame!" said Amabel, seeing that I was trying in vain to
speak.

"A headache! Oh that is nothing—and yet it might be the beginning of an illness too!"
added her ladyship. "Where had you been when I met you this afternoon?"

"To visit a poor sick woman, madame."

"A poor sick woman—very likely she had smallpox or something, and here you have been
sitting with me all this time!" exclaimed her ladyship: "Who knows what I may have
caught."

"The poor woman had nothing infectious," Amabel began, but Lady Throckmorton cut her
short—
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like