PyQt Intro to Widgets Part 1

Widgets are the core of what you’ll use in PyQt.  They are the interface elements that display information and respond to user interaction.  All widgets are descended from QWidget and are found in the PyQt5.QtWidgets module.  Over the course of the next couple of articles, we’re going to take a look at some of the basic input widgets, a…

PyQt Project Scaffold

Most of the time when you are setting up a a new PyQt5 project, you’re going to start from the same boilerplate so for the first article in this series, I’m going to show you the scaffold project I start with when I create new PyQt5 projects. The file setup is very basic- there is…

Lazy Loading PyQt Data Models (for QTreeViews)

Sometimes loading all of the required data into a model at the time it’s created is not a great option.  For example, you wouldn’t want to have a file system model enumerating every file – this could take quite a while, and besides, the user is not likely to want to navigate to every file…

QtWebkit Javascript Bridge

QtWebkit bridge allows the Javascript environment in a QWebView to call python code through the Qt slots mechanism.  This allows a webpage to interact with the Qt application. The basic setup is quite easy – select a QObject to be exposed to javascript and call the addToJavaScriptWindowObject() method of a QWebView’s main frame. This exposes any slots…