Muutke küpsiste eelistusi

E-raamat: Beginning PyQt: A Hands-on Approach to GUI Programming with PyQt6

  • Formaat: EPUB+DRM
  • Ilmumisaeg: 16-Mar-2022
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484279991
  • Formaat - EPUB+DRM
  • Hind: 67,91 €*
  • * hind on lõplik, st. muud allahindlused enam ei rakendu
  • Lisa ostukorvi
  • Lisa soovinimekirja
  • See e-raamat on mõeldud ainult isiklikuks kasutamiseks. E-raamatuid ei saa tagastada.
  • Formaat: EPUB+DRM
  • Ilmumisaeg: 16-Mar-2022
  • Kirjastus: APress
  • Keel: eng
  • ISBN-13: 9781484279991

DRM piirangud

  • Kopeerimine (copy/paste):

    ei ole lubatud

  • Printimine:

    ei ole lubatud

  • Kasutamine:

    Digitaalõiguste kaitse (DRM)
    Kirjastus on väljastanud selle e-raamatu krüpteeritud kujul, mis tähendab, et selle lugemiseks peate installeerima spetsiaalse tarkvara. Samuti peate looma endale  Adobe ID Rohkem infot siin. E-raamatut saab lugeda 1 kasutaja ning alla laadida kuni 6'de seadmesse (kõik autoriseeritud sama Adobe ID-ga).

    Vajalik tarkvara
    Mobiilsetes seadmetes (telefon või tahvelarvuti) lugemiseks peate installeerima selle tasuta rakenduse: PocketBook Reader (iOS / Android)

    PC või Mac seadmes lugemiseks peate installima Adobe Digital Editionsi (Seeon tasuta rakendus spetsiaalselt e-raamatute lugemiseks. Seda ei tohi segamini ajada Adober Reader'iga, mis tõenäoliselt on juba teie arvutisse installeeritud )

    Seda e-raamatut ei saa lugeda Amazon Kindle's. 

Beginning-Intermediate

Learn GUI application development from the ground up by building simple projects that teach the fundamentals of using PyQt6. This 2nd edition includes updated code, programs, and new chapters to get you started using the newest version.  Taking a practical approach, each chapter will gradually teach more advanced and diverse concepts to aid you in designing and customizing interesting and professional applications.

You'll start by learning important concepts related to GUI development, and then jump right into building different and exciting projects in every chapter. Along the way, you’ll discover new widgets, layouts, and other concepts that will help you to build better UIs. You'll also construct more elaborate GUIs, covering topics that include storing data using the clipboard, graphics and animation, support for SQL databases, multithreading applications, and building modern-looking interfaces. 

Using this knowledge, you’ll be able to build a photo editor, games, a text editor, a working web browser, and an assortment of other GUIs. In the end, this book will guide you through the process of creating UIs to help you bring your own ideas to life.  Find out what you need to begin making your own applications with PyQt! 

What You'll Learn
  • Develop cross-platform UIs with PyQt and Python
  • Use PyQt’s many widgets and apply them by building real applications
  • Build larger applications through a step-by-step approach and break the code into smaller chunks for deeper understanding
  • Work with more complex applications in PyQt, covering SQL databases, multithreading, web browsers, and more
  • Create modern-looking UIs with Qt Quick and QtQml using the latest version of PyQt
Who This Book Is For

Python developers who are looking to begin creating user interfaces and want to utilize the latest version of PyQt to gets started. Having prior knowledge of PyQt or other Python UI toolkits is not necessary to begin using this book.


About the Author xiii
About the Technical Reviewers xv
Acknowledgments xvii
Introduction xix
Chapter 1 Getting Started with PyQt 1(12)
The PyQt Framework
1(2)
Why Choose PyQt?
2(1)
PyQt5 vs. PyQt6
3(1)
Installing Python 3 and PyQt6
3(2)
Checking Your Version of Python
4(1)
Installing PyQt6
4(1)
Introduction to User Interfaces
5(2)
What Is a Graphical User Interface?
5(1)
Concepts for Creating Good Interface Design
6(1)
Creating Your First GUI: An Empty Window
7(4)
Explanation for Creating an Empty Window
8(3)
Summary
11(2)
Chapter 2 Building a Simple GUI 13(12)
The QLabel Widget
13(5)
Explanation for Using QLabel
14(4)
Project 2.1 - User Profile GUI
18(6)
Designing the User Profile GUI
19(1)
Explanation for the User Profile GUI
20(4)
Summary
24(1)
Chapter 3 Adding More Functionality with Widgets 25(38)
Event Handlers and Signals and Slots
25(1)
The QPushButton Widget
26(5)
Explanation for Using QPushButton
27(4)
The QLineEdit Widget
31(3)
Explanation for Using QLineEdit
31(3)
The QCheckBox Widget
34(4)
Explanation for Using QCheckBox
35(3)
The QMessageBox Dialog
38(6)
Windows vs. Dialogs
39(1)
Explanation for Using QMessageBox
39(5)
Project 3.1 - Login GUI and Registration Dialog
44(17)
Designing the Login GUI and Registration Dialog
46(1)
Explanation for Creating the Login GUI
47(8)
Explanation for Creating the Main Window
55(1)
Explanation for Creating the Registration Dialog
56(5)
Summary
61(2)
Chapter 4 Learning About Layout Management 63(42)
Using Layout Managers in PyQt
64(1)
Absolute Positioning
65(1)
Horizontal and Vertical Layouts with Box Layouts
66(7)
Explanation for QHBoxLayout
66(3)
Explanation for QVBoxLayout
69(4)
Creating Nested Layouts
73(6)
Explanation for Nested Layouts
74(5)
Arranging Widgets in Grids with QGridLayout
79(8)
Explanation for QGridLayout
80(7)
Building Forms with QFormLayout
87(8)
Explanation for QFormLayout
88(7)
Managing Pages with QStackedLayout
95(6)
Explanation for QStackedLayout
97(4)
Additional Tips for Managing Space
101(3)
Explanation for Managing Space
102(2)
Summary
104(1)
Chapter 5 Menus, Toolbars, and More 105(56)
Common Practices for Creating Menus
106(1)
Creating a Simple Menu Bar
106(5)
Explanation for Creating a Menu Bar
107(4)
Using Icons and the Qlcon Class
111(5)
Explanation for Using Icons
112(3)
Setting the Central Widget
115(1)
Built-in Dialog Classes in PyQt
116(6)
The QFileDialog Class
116(1)
The QlnputDialog Class
117(1)
The QFontDialog Class
118(1)
The QColorDialog Class
119(2)
The About QMessageBox
121(1)
Project 5.1 - Rich Text Notepad GUI
122(11)
Designing the Rich Text Notepad GUI
123(1)
Explanation for the Rich Text Notepad GUI
123(10)
Expanding the Features in a Main Window
133(9)
Explanation for Expanding the Features
134(8)
Project 5.2 - Simple Photo Editor GUI
142(17)
Designing the Photo Editor GUI
143(1)
Explanation for the Photo Editor GUI
143(16)
Summary
159(2)
Chapter 6 Styling Your GUIs 161(40)
What Are Styles in PyQt?
161(2)
Changing the Default Style
162(1)
Modifying Widget Appearances
163(12)
Using HTML to Change the Look of Text
164(3)
Using Qt Style Sheets to Change the Look of Widgets
167(2)
Explanation for Using "Inline" Qt Style Sheets
169(3)
Explanation for Using "Embedded" Qt Style Sheets
172(3)
Organizing Widgets with Containers and Tabs
175(7)
The QRadioButton Widget
176(1)
The QGroupBox Class
176(1)
The QTabWidget Class
177(1)
Explanation for Using Containers and Tabs
177(5)
Project 6.1 - Food Ordering GUI
182(16)
Design the Food Ordering GUI
184(1)
Explanation for the Food Ordering GUI
185(13)
CSS Properties Reference
198(1)
Summary
199(2)
Chapter 7 Handling Events in PyQt 201(16)
Event Handling in PyQt
201(2)
Using Signals and Slots
202(1)
Using Event Handlers to Handle Events
202(1)
Difference Between Signals and Slots and Event Handlers
203(1)
Handling Key Events
203(2)
Explanation for Handling Key Events
204(1)
Handling Mouse Events
205(6)
Explanation for Handling Mouse Events
207(4)
Creating Custom Signals
211(5)
Explanation for Creating Custom Signals
212(4)
Summary
216(1)
Chapter 8 Creating GUIs with Qt Designer 217(42)
Getting Started with Qt Designer
218(8)
Installing Qt Designer
218(1)
Exploring Qt Designer's User Interface
219(6)
Qt Designer's Editing Modes
225(1)
Creating an Application in Qt Designer
226(1)
Project 8.1 - Keypad GUI
227(27)
Explanation for the Keypad GUI
228(26)
Extra Tips for Using Qt Designer
254(4)
Setting Up Main Windows and Menus
254(3)
Displaying Images in Qt Designer
257(1)
Adding Style Sheets in Qt Designer
257(1)
Summary
258(1)
Chapter 9 Working with the Clipboard 259(14)
The QClipboard Class
259(6)
Explanation for Using QClipboard
261(4)
Project 9.1 - Sticky Notes GUI
265(7)
Explanation for the Sticky Notes GUI
267(5)
Summary
272(1)
Chapter 10 Presenting Data in PyQt 273(26)
Quickly Handling Data in PyQt
273(1)
The QListWidget Class
274(5)
Explanation for Using QListWidget
275(4)
Drag and Drop in PyQt
279(4)
Explanation for Drag and Drop
280(3)
The QTableWidget Class
283(10)
Explanation for Using QTableWidget
284(9)
The QTreeWidget Class
293(4)
Explanation for Using QTreeWidget
294(3)
Summary
297(2)
Chapter 11 Graphics and Animation in PyQt 299(42)
Introduction to the QPainter Class
300(14)
Explanation for Using the QPainter Class
301(13)
Project 11.1 - Painter GUI
314(1)
Explanation for the Painter GUI
315(14)
Creating the Canvas Class
316(6)
Creating the Painter GUI's MainWindow Class
322(5)
Animating Scenes with QPropertyAnimation
327(2)
Explanation for Animating Scenes
329(5)
Introduction to Animating Widgets
334(1)
Explanation for Animating Widgets
335(5)
Summary
340(1)
Chapter 12 Creating Custom Widgets 341(18)
Project 12.1 - RGB Slider Custom Widget
341(15)
PyQt's Image Handling Classes
343(1)
The QSlider Widget
344(1)
Explanation for the RGB Slider Widget
345(11)
RGB Slider Demo
356(2)
Explanation for the RGB Slider Demo
357(1)
Summary
358(1)
Chapter 13 Working with Qt Quick 359(36)
Outlining QtQuick and QML
360(6)
Elements in QtQuick
362(1)
Introduction to the QML Language and Syntax
363(3)
Building and Running QML Components
366(21)
Creating and Loading QML Components
367(6)
Creating Reusable Components
373(3)
Layout Handling in QML
376(4)
Building and Loading QML Windows
380(7)
Using Transformations to Animate Objects
387(7)
Explanation for Simple Transformations
388(2)
Explanation for Using Transformations to Animate Objects
390(4)
Summary
394(1)
Chapter 14 Introduction to Handling Databases 395(42)
Thinking About Data
395(1)
Introduction to ModelNiew Programming
396(8)
The Components of the ModelNiew Architecture
396(2)
PyQt's ModelNiew Classes
398(2)
Explanation for Introduction to ModelNiew
400(4)
Working with SQL Databases in PyQt
404(3)
What Is SQL?
404(3)
Project 14.1 -Account Management GUI
407(29)
Explanation for Working with the QtSql Module
409(7)
Explanation for Querying a Database with QSqlQuery
416(3)
Working with the QSqlTableModel Class
419(4)
Working with the QSqlRelationalTableModel Class
423(5)
Explanation for the Account Management GUI
428(8)
Summary
436(1)
Chapter 15 Managing Threads 437(14)
Introduction to Threading
437(3)
Threading in PyQt
438(1)
Methods for Processing Long Events in PyQt
439(1)
Project 15.1 - File Renaming GUI
440(10)
The QProgressBar Widget
441(1)
Explanation for File Renaming GUI
441(9)
Summary
450(1)
Chapter 16 Extra Projects 451(52)
Project 16.1 - Directory Viewer GUI
452(4)
Explanation for the Directory Viewer GUI
453(3)
Project 16.2 - Camera GUI
456(8)
Explanation for the Camera GUI
458(6)
Project 16.3 - Simple Clock GUI
464(3)
Explanation for the Clock GUI
465(2)
Project 16.4 - Calendar GUI
467(6)
Explanation for the Calendar GUI
468(5)
Project 16.5 - Hangman GUI
473(11)
Explanation for the Hangman GUI
475(9)
Project 16.6 - Web Browser GUI
484(13)
Explanation for Web Browser GUI
486(11)
Project 16.7 - Tri-state QComboBox
497(1)
Explanation for the Tri-state QComboBox
498(3)
Summary
501(2)
Appendix: Reference Guide for PyQt6 503(30)
Selected PyQt6 Modules
503(1)
Selected PyQt Classes
504(25)
Classes for Building a GUI Window
505(4)
QPainter
509(2)
Layout Managers
511(1)
Button Widgets
512(2)
Input Widgets
514(8)
Display Widgets
522(2)
Item Views
524(2)
Container Widgets
526(3)
QtQuick and QML
529(1)
Qt Style Sheets
529(3)
Qt Namespace
532(1)
Summary
532(1)
Index 533
Joshua Willman is a software engineer with more than 12 years of experience developing applications in mainly Python and C++. His career has allowed him to participate in many different fields, from robotics, machine learning, and computer vision, to UI development, game development, and more. His first experience with PyQt was building an interface for simplifying the labeling process of datasets for machine learning. Ever since then, hes been hooked!

In recent years, his passion for programming and all things visual has allowed him to participate in numerous projects. These include designing educational courses for mobile robotics and computer vision using Arduino and Raspberry Pi, building GUI applications, and working as a solo indie game developer. He currently works as a robotics engineer, a technical writer, and a content creator (learning web development in his spare time in order to build his own platform, redhuli.io). When hes not working, he enjoys tinkering on robotics projects and spending time with his wonderful wife and daughter.





 He is also the author of two books with Apress:





    Beginning PyQt: A Hands-on Approach to GUI Programming (1st Edition)





    Modern PyQt: Create GUI Applications for Project Management, Computer Vision, and Data Analysis