May 2019
Intermediate to advanced
542 pages
13h 37m
English
To get started, copy your calendar_form.py file from Chapter 2, Building Forms with QtWidgets, into a new file called calendar_app.py and open it in your editor. We're going to start editing our MainWindow class and flesh it out into a complete application.
To handle storing the events, we'll just create a dict property in MainWindow, like so:
class MainWindow(qtw.QWidget): events = {}
We're not going to bother persisting data to disk, though you can certainly add such a feature if you wish. Each item in dict will use a date object as its key and contain a list of dict objects holding the details of all the events on that date. The layout of the data will look something like this:
events = { QDate: { 'title': "String ...Read now
Unlock full access