Book Image

Mastering GUI Programming with Python

By : Alan D. Moore
5 (2)
Book Image

Mastering GUI Programming with Python

5 (2)
By: Alan D. Moore

Overview of this book

PyQt5 has long been the most powerful and comprehensive GUI framework available for Python, yet there is a lack of cohesive resources available for Python programmers to learn how to use it. This book will be your comprehensive guide to exploring GUI development with PyQt5. You will get started with an introduction to PyQt5, before going on to develop stunning GUIs with modern features. You will learn how to build forms using QWidgets and delve into important aspects of GUI development such as layouts, size policies, and event-driven programming. Moving ahead, you’ll discover PyQt5’s most powerful features through chapters on audio-visual programming with QtMultimedia, database-driven software with QtSQL, and web browsing with QtWebEngine. Next, in-depth coverage of multithreading and asynchronous programming will help you run tasks asynchronously and build high-concurrency processes with ease. In later chapters, you’ll gain insights into QOpenGLWidget, along with mastering techniques for creating 2D graphics with QPainter. You’ll also explore PyQt on a Raspberry Pi and interface it with remote systems using QtNetwork. Finally, you will learn how to distribute your applications using setuptools and PyInstaller. By the end of this book, you will have the skills you need to develop robust GUI applications using PyQt.
Table of Contents (24 chapters)
Free Chapter
1
Section 1: Deep Dive into PyQt
8
Section 2: Working with External Resources
12
Section 3: Unraveling Advanced Qt Implementations
22
Upgrading Raspbian 9 to Raspbian 10

Questions

Try these questions to test your knowledge from this chapter:

  1. Which steps of the OpenGL render pipeline are user-definable? Which steps must be defined in order to render anything? You may need to reference the documentation at https://www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview.
  1. You're writing a shader for an OpenGL 2.1 program. Does the following look correct?
   #version 2.1

attribute highp vec4 vertex;

void main (void)
{
gl_Position = vertex;
}
  1. Is the following a vertex or fragment shader? How can you tell?
   attribute highp vec4 value1;
varying highp vec3 x[4];
void main(void)
{
x[0] = vec3(sin(value1[0] * .4));
x[1] = vec3(cos(value1[1]));
gl_Position = value1;
x[2] = vec3(10 * x[0])
}
  1. Given the following vertex shader, what code do you need to write to assign simple values to the two variables?
   attribute...