How to Use this Book - russ-hensel/qt5_by_example GitHub Wiki
Much of the structure of the book is meant to be a reference on how to use each type of widget. It goes one widget at a time. So it is not, in general, a tutorial.
But we start with a very brief tutorial which encompasses a series of widgets, because you cannot really have an interface with just one widget, it takes a village.
Before you can really begin you need to set yourself up:
Get a good IDE to work in, Idle can do it but a more advanced one is probably better. We used Spyder from Anaconda and recommend it. That is the IDE we will refer to but others should work if you prefer.
Download the application ( we recommend the zip file ..... ) and unzip it. ( https://github.com/russ-hensel/qt5_by_example )
Put the whole thing in your development/IDE environment, we use
...../qt5_by_example as its root directory
There is quite a bit of code here, do not dismay, at any one time the code
you need to be concerned with is in one file, one object, about 20 k much of
which is boiler plate.
To run it you should set up an environment with Python 13 ( it may work with earlier versions mostly it was developed with Python 12, but we have switched to Python 13 )
It has a few dependencies that Anaconda/Spyder does not install. So Install:
Wat inspector -- seems to require pip even under anaconda
pip install wat
pyqtgraph'
... may be a couple of others we need to check
With the environment in place open main.py and run it. You should see a window like this:
if not ... >>search debugging qt5_by_example
So what is the big IDEA here? The examples can be selected by using key words. The words include generic words like button and qt5 specific words like QPushButton.
When you give multiple words the example must match all the words.
Capitlization is ignored and pulurals formed with an s are also ignored.
After entering the key words press <select> and the examples matching the
key words are displayed in the list lower on the window. Click on an example to run it.
The application uses tabs as part of its GUI and each example is in its own tab. the Select Tab and Database Tab are part of the infra struchtre and not really examples themselfes -- all example tabs can be closed but these cannot be closed.
When a tab is open it shows the widget it is exampling plus others to make the example run. Interact with the widgets to see what they do.
Many interactions result in output to the text area at the bottom of the tab and the same output to your console.
Standard buttons ( not part of the examples, but standard example interface/infrasturcture ) include
mutate
inspect this brings up a mini inspection application based on the wat inspector
...... reference
>>search using the wat inspector
breakpoint this will break into your debugger in the breakpoint method of your tab. it should make it very easy to located the code you are running. do not forget to continue when you want to .... continue.