May 2019
Intermediate to advanced
542 pages
13h 37m
English
To begin our program, copy the Qt application template from Chapter 4, Building Applications with QMainWindow, to a new file called system_monitor.py.
At the top of the application, we need to import the QtChart library:
from PyQt5 import QtChart as qtch
We're also going to need the deque class and the psutil library, just like we needed them in Chapter 12, Creating 2D Graphics with QPainter:
from collections import dequeimport psutil
Our program will contain several charts, each in its own tab. So, we will create a tab widget in MainWindow.__init__() to hold all the charts:
tabs = qtw.QTabWidget() self.setCentralWidget(tabs)
Now that the main framework of the GUI is in place, we'll start creating our chart classes and ...
Read now
Unlock full access