在好例子网,分享、交流、成长!
您当前所在位置:首页Python 开发实例Python GUI开发 → Qt5 Python GUI Programming:Qt5 Python GUI 编程设计

Qt5 Python GUI Programming:Qt5 Python GUI 编程设计

Python GUI开发

下载此实例
  • 开发语言:Python
  • 实例大小:4.66M
  • 下载次数:20
  • 浏览次数:239
  • 发布时间:2022-09-06
  • 实例类别:Python GUI开发
  • 发 布 人:mhjysq
  • 文件格式:.pdf
  • 所需积分:2
 相关标签:

实例介绍

【实例简介】Qt5 Python GUI Programming:Qt5 Python GUI 编程设计

【实例截图】

【核心代码】

Table of Contents
Preface
1
Chapter 1: Creating a User Interface with Qt Components
8
Introduction
8
PyQt
9
Ways of creating GUI applications
9
Displaying a welcome message
11
Understanding the Label widget
11
Methods
12
Understanding the Line Edit widget
12
Methods
12
Understanding the Push Button widget
13
How to do it...
14
How it works...
17
Using the Radio Button widget
18
Understanding Radio Button
19
Methods
19
Signal description
19
How to do it...
20
How it works...
22
Grouping radio buttons
22
Getting ready
23
How to do it...
23
How it works...
26
Displaying options in the form of checkboxes
27
Getting ready
27
Method application
27
Signal description
28
How to do it...
28
How it works...
30
Displaying two groups of checkboxes
31
Getting ready
31
How to do it...
31
How it works...
34
Chapter 2: Event Handling - Signals and Slots
35
Introduction
35
Using Signal/Slot Editor
36
How to do it...
36
Copying and pasting text from one Line Edit widget to another
38
Getting ready
39Table of Contents
[ ii ]
How to do it...
39
How it works...
44
Converting data types and making a small calculator
45
How to do it...
46
How it works...
48
Using the Spin Box widget
51
Getting ready
51
How to do it...
52
How it works...
54
Using scrollbars and sliders
55
Getting ready
55
How to do it...
58
How it works...
59
Using List Widget
61
Getting ready
61
How to do it...
62
How it works...
64
Selecting multiple list items from one List Widget and displaying
them in another
65
How to do it...
65
How it works...
67
Adding items into List Widget
68
How to do it...
68
How it works...
69
Performing operations in List Widget
70
Getting ready
70
Methods provided by the QListWidgetItem class
70
How to do it....
71
How it works...
73
Using the Combo Box widget
77
How to do it…
78
How it works...
80
Using the Font Combo Box widget
81
Getting ready
81
How to do it…
82
How it works...
83
Using the Progress Bar widget
84
Getting ready
85
How to do it…
85
How it works...
87
Chapter 3: Working with Date and Time
88
Displaying LCD digits
88
Using Timers
89
Using the QTime class
89Table of Contents
[ iii ]
Displaying system clock time in LCD-like digits
90
How to do it...
90
How it works...
91
Displaying the date selected by the user from Calendar Widget
92
Getting ready
92
Displaying a calendar
93
Using the QDate class
94
Using the Date Edit widget
95
How to do it...
96
How it works...
97
Creating a hotel reservation form
99
Getting ready
99
How to do it...
101
How it works...
104
Displaying tabular data using Table Widget
105
Getting ready
105
Table Widget
105
The QTableWidgetItem class
105
How to do it...
106
How it works...
108
Chapter 4: Understanding OOP Concepts
109
Object-oriented programming
109
Creating a class
109
Using the built-in class attributes
110
Accessing class variables in instance methods
111
Instances
111
Using classes in GUI
113
How to do it...
113
How it works...
115
Making the application more elaborate
116
Inheritance
119
Types of inheritance
119
Using single inheritance
120
Getting ready
120
How to do it...
121
How it works...
123
Using multilevel inheritance
125
Getting ready
125
How to do it...
126
How it works...
129
Using multiple inheritance
131
Getting ready
132
How to do it...
132
How it works...
135
Chapter 5: Understanding Dialogs
138Table of Contents
[ iv ]
Introduction
138
The input dialog box
139
Using the input dialog
141
How to do it...
141
How it works...
142
Using the color dialog
144
How to do it...
144
How it works...
146
Using the font dialog
148
How to do it...
148
How it works...
149
Using the file dialog
152
Getting ready
152
How to do it...
154
How it works...
157
Chapter 6: Understanding Layouts
162
Understanding layouts
162
Spacers
163
Using Horizontal Layout
164
How to do it...
164
How it works...
169
Using Vertical Layout
170
How to do it...
170
How it works...
175
Using Grid Layout
176
How to do it...
176
How it works...
182
Using Form Layout
183
Getting ready
183
How to do it...
183
How it works...
187
Chapter 7: Networking and Managing Large Documents
189
Introduction
189
Creating a small browser
190
How to do it...
190
How it works...
193
Creating a server-side application
194
How to do it...
194
How it works...
196
Establishing client-server communication
197
How to do it...
197
How it works...
200
Creating a dockable and floatable sign-in form
205Table of Contents
[ v ]
Getting ready
205
How to do it...
206
How it works...
211
Multiple Document Interface
214
Getting ready
214
How to do it...
215
How it works...
219
Displaying information in sections using Tab Widget
223
How to do it...
223
How it works...
227
Creating a custom menu bar
229
How to do it…
229
How it works...
240
Chapter 8: Doing Asynchronous Programming in Python
244
Introduction
244
Multithreading
245
Asynchronous programming
246
Updating progress bar using thread
246
How to do it...
246
How it works...
248
Updating two progress bars using two threads
249
How to do it...
250
How it works...
252
Updating progress bars using threads bound with a locking
mechanism
254
How to do it...
254
How it works...
256
Updating progress bars simultaneously using asynchronous
operations
258
How to do it...
258
How it works...
260
Managing resources using context manager
262
Context manager
263
How to do it…
264
How it works...
266
Chapter 9: Database Handling
269
Introduction
269
Creating the cursor object
270
Creating a database
271
How to do it…
271
How it works…
273
Creating a database table
273
How to do it…
274Table of Contents
[ vi ]
How it works…
276
Inserting rows in the specified database table
278
How to do it…
279
How it works…
282
Displaying rows in the specified database table
284
How to do it…
284
How it works…
288
Navigating through the rows of the specified database table
289
How to do it…
289
How it works…
292
Searching a database table for specific information
294
How to do it…
294
How it works…
297
Creating a signin form – applying an authentication procedure
298
How to do it…
299
How it works…
301
Updating a database table – changing a user's password
302
How to do it…
302
How it works…
305
Deleting a row from a database table
307
How to do it…
307
How it works…
310
Chapter 10: Using Graphics
315
Introduction
315
Displaying mouse coordinates
316
How to do it...
316
How it works...
318
Displaying coordinates where the mouse button is clicked and
released
319
How to do it...
319
How it works...
321
Displaying a point where the mouse button is clicked
322
How to do it...
322
How it works...
324
Drawing a line between two mouse clicks
325
How to do it...
325
How it works...
327
Drawing lines of different types
328
How to do it...
328
How it works...
331
Drawing a circle of a desired size
333
How to do it...
333
How it works...
335
Drawing a rectangle between two mouse clicks
336Table of Contents
[ vii ]
How to do it...
336
How it works...
338
Drawing text in a desired font and size
339
How to do it...
339
How it works...
343
Creating a toolbar that shows different graphics tools
344
How to do it…
345
How it works...
353
Plotting a line using Matplotlib
355
Getting ready
355
How to do it...
356
How it works...
356
Plotting a bar using Matplotlib
357
Getting ready
358
How to do it...
358
How it works...
359
Chapter 11: Implementing Animation
360
Introduction
360
Implementing animation
361
Displaying a 2D graphical image
361
How to do it...
361
How it works...
363
Making a ball move down on the click of a button
364
How to do it...
364
How it works...
366
Making a bouncing ball
367
How to do it...
367
How it works...
369
Making a ball animate as per the specified curve
370
How to do it...
370
How it works...
372
Chapter 12: Using Google Maps
374
Introduction
374
Finding out details of a location or a landmark
375
How to do it…
375
How it works…
377
Getting complete information from latitude and longitude values
378
How to do it…
379
How it works…
381
Finding out the distance between two locations
382
How to do it…
382
How it works…
384
Displaying location on Google Maps
385Table of Contents
[ viii ]
How to do it…
385
How it works…
387
Chapter 13: Running Python Scripts on Android and iOS
389
Introduction
389
Copying scripts from PC to Android devices
392
How to do it
392
Prompting for a username and displaying a welcome message
394
How to do it...
394
How it works...
395
Understanding different buttons in a dialog box
397
How to do it...
397
How it works...
398
Performing single selection from a list
400
How to do it...
400
How it works...
401
Performing multiple selections from a list
402
How to do it...
402
How it works...
403
Displaying a Date Picker dialog
404
How to do it...
404
How it works...
405
Capturing images using a camera
406
How to do it...
407
How it works...
407
Making an Android device speak a text input
408
How to do it...
409
How it works...
409
Creating a cross-platform Python script using Kivy
409
Getting started
410
How to do it...
411
Packaging a Python Script into the Android APK using Buildozer
414
Getting ready
414
How to do it...
415
How it works
421
Packaging Python script for iOS
422
How to do it...
422
How it works...
427
Other Books You May Enjoy
428
Index
431

标签:

实例下载地址

Qt5 Python GUI Programming:Qt5 Python GUI 编程设计

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警