logo资料库

qt5-python-gui-programming-cookbook.pdf

第1页 / 共643页
第2页 / 共643页
第3页 / 共643页
第4页 / 共643页
第5页 / 共643页
第6页 / 共643页
第7页 / 共643页
第8页 / 共643页
资料共643页,剩余部分请下载后查看
Title Page
Copyright and Credits
Qt5 Python GUI Programming Cookbook
Dedication
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the author
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Get in touch
Reviews
Creating a User Interface with Qt Components
Introduction
PyQt
Ways of creating GUI applications
Displaying a welcome message
Understanding the Label widget
Methods
Understanding the Line Edit widget
Methods
Understanding the Push Button widget
How to do it...
How it works...
Using the Radio Button widget
Understanding Radio Button
Methods 
Signal description
How to do it...
How it works...
Grouping radio buttons
Getting ready
How to do it...
How it works...
Displaying options in the form of checkboxes
Getting ready
Method application
Signal description
How to do it...
How it works...
Displaying two groups of checkboxes
Getting ready
How to do it...
How it works...
Event Handling - Signals and Slots
Introduction
Using Signal/Slot Editor
How to do it...
Copying and pasting text from one Line Edit widget to another
Getting ready
How to do it...
How it works...
Converting data types and making a small calculator
How to do it...
How it works...
Using the Spin Box widget
Getting ready
How to do it...
How it works...
Using scrollbars and sliders
Getting ready
How to do it...
How it works...
Using List Widget
Getting ready
How to do it...
How it works...
Selecting multiple list items from one List Widget and displaying them in another
How to do it...
How it works...
Adding items into List Widget
How to do it...
How it works...
Performing operations in List Widget
Getting ready
Methods provided by the QListWidgetItem class
How to do it....
How it works...
Using the Combo Box widget
How to do it…
How it works...
Using the Font Combo Box widget
Getting ready
How to do it…
How it works...
Using the Progress Bar widget
Getting ready
How to do it…
How it works...
Working with Date and Time
Displaying LCD digits
Using Timers
Using the QTime class
Displaying system clock time in LCD-like digits
How to do it...
How it works...
Displaying the date selected by the user from Calendar Widget
Getting ready
Displaying a calendar
Using the QDate class
Using the Date Edit widget
How to do it...
How it works...
Creating a hotel reservation form 
Getting ready
How to do it...
How it works...
Displaying tabular data using Table Widget
Getting ready
Table Widget
The QTableWidgetItem class
How to do it...
How it works...
Understanding OOP Concepts
Object-oriented programming
Creating a class
Using the built-in class attributes
Accessing class variables in instance methods
Instances
Using classes in GUI
How to do it...
How it works...
Making the application more elaborate
Inheritance
Types of inheritance
Using single inheritance
Getting ready
How to do it...
How it works...
Using multilevel inheritance
Getting ready
How to do it...
How it works...
Using multiple inheritance
Getting ready
How to do it...
How it works...
Understanding Dialogs
Introduction
The input dialog box
Using the input dialog 
How to do it...
How it works...
Using the color dialog
How to do it...
How it works...
Using the font dialog
How to do it...
How it works...
Using the file dialog
Getting ready
How to do it...
How it works...
Understanding Layouts
Understanding layouts
Spacers
Using Horizontal Layout
How to do it...
How it works...
Using Vertical Layout
How to do it...
How it works...
Using Grid Layout
How to do it...
How it works...
Using Form Layout
Getting ready
How to do it...
How it works...
Networking and Managing Large Documents
Introduction
Creating a small browser
How to do it...
How it works...
Creating a server-side application
How to do it...
How it works...
Establishing client-server communication
How to do it...
How it works...
Creating a dockable and floatable sign-in form
Getting ready
How to do it...
How it works...
Multiple Document Interface 
Getting ready
How to do it...
How it works...
Displaying information in sections using Tab Widget
How to do it...
How it works...
Creating a custom menu bar
How to do it…
How it works...
Doing Asynchronous Programming in Python
Introduction
Multithreading
Asynchronous programming
Updating progress bar using thread
How to do it...
How it works...
Updating two progress bars using two threads
How to do it...
How it works...
Updating progress bars using threads bound with a locking mechanism
How to do it...
How it works...
Updating progress bars simultaneously using asynchronous operations
How to do it...
How it works...
Managing resources using context manager
Context manager
How to do it…
How it works...
Database Handling
Introduction
Creating the cursor object
Creating a database
How to do it…
How it works…
Creating a database table
How to do it…
How it works…
Inserting rows in the specified database table
How to do it…
How it works…
Displaying rows in the specified database table
How to do it…
How it works…
Navigating through the rows of the specified database table
How to do it…
How it works…
Searching a database table for specific information
How to do it…
How it works…
Creating a signin form – applying an authentication procedure
How to do it…
How it works…
Updating a database table – changing a user's password 
How to do it…
How it works…
Deleting a row from a database table
How to do it…
How it works…
Using Graphics
Introduction
Displaying mouse coordinates
How to do it...
How it works...
Displaying coordinates where the mouse button is clicked and released
How to do it...
How it works...
Displaying a point where the mouse button is clicked
How to do it...
How it works...
Drawing a line between two mouse clicks
How to do it...
How it works...
Drawing lines of different types
How to do it...
How it works...
Drawing a circle of a desired size
How to do it...
How it works...
Drawing a rectangle between two mouse clicks
How to do it...
How it works...
Drawing text in a desired font and size
How to do it...
How it works...
Creating a toolbar that shows different graphics tools
How to do it…
How it works...
Plotting a line using Matplotlib
Getting ready
How to do it...
How it works...
Plotting a bar using Matplotlib
Getting ready
How to do it...
How it works...
Implementing Animation
Introduction
Implementing animation
Displaying a 2D graphical image
How to do it...
How it works...
Making a ball move down on the click of a button
How to do it...
How it works...
Making a bouncing ball
How to do it...
How it works...
Making a ball animate as per the specified curve
How to do it...
How it works...
Using Google Maps
Introduction
Finding out details of a location or a landmark
How to do it…
How it works…
Getting complete information from latitude and longitude values
How to do it…
How it works…
Finding out the distance between two locations
How to do it…
How it works…
Displaying location on Google Maps 
How to do it…
How it works…
Running Python Scripts on Android and iOS
Introduction
Copying scripts from PC to Android devices
How to do it
Prompting for a username and displaying a welcome message
How to do it...
How it works...
Understanding different buttons in a dialog box
How to do it...
How it works...
Performing single selection from a list
How to do it...
How it works...
Performing multiple selections from a list
How to do it...
How it works...
Displaying a Date Picker dialog
How to do it...
How it works...
Capturing images using a camera
How to do it...
How it works...
Making an Android device speak a text input
How to do it...
How it works...
Creating a cross-platform Python script using Kivy
Getting started
How to do it...
Packaging a Python Script into the Android APK using Buildozer
Getting ready
How to do it...
How it works
Packaging Python script for iOS
How to do it...
How it works...
Other Books You May Enjoy
Leave a review - let other readers know what you think
Qt5 Python GUI Programming Cookbook Building responsive and powerful cross-platform applications with PyQt B.M. Harwani
BIRMINGHAM - MUMBAI
Qt5 Python GUI Programming Cookbook Copyright © 2018 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Commissioning Editor: Richa Tripathi Acquisition Editor: Alok Dhuri Content Development Editor: Zeeyan Pinheiro Technical Editor: Vibhuti Gawde Copy Editor: Safis Editing Project Coordinator: Vaidehi Sawant Proofreader: Safis Editing Indexer: Rekha Nair Graphics: Jason Monteiro Production Coordinator: Nilesh Mohite First published: July 2018 Production reference: 1270718 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-78883-100-0 www.packtpub.com
I am thankful to my family—my small world: Anushka (my wife) and my two little darlings, Chirag and Naman, for allowing me to work on the book even during time that I was supposed to spend with them.
mapt.io Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe? Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals Improve your learning with Skill Plans built especially for you Get a free eBook or video every month Mapt is fully searchable Copy and paste, print, and bookmark content
PacktPub.com Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktP ub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
分享到:
收藏