Find Run Read etc - russ-hensel/qt5_by_example GitHub Wiki
There is a cycle that is useful in using this Book/Application: We call it "Find, Run, Read, Copy, Paste and Adapt". Here is the idea: You find the example(s) that relate to your interest. You Run the example to see if it seems to really be the right thing and do the right things. You Read the code for your example. You then copy the code of interest into your code. Finally adapt the code for your situation. A bit more about each stage
You need to have some idea of what you want to do to avoid looking at too much irrelevant info. Because of this the application includes a little search engine base on key words. In the key word field enter one or more key words. Tabs that match all the key words will be found when you press . What words might be used? For a generic push button the words "push" and "button" both work. So does the QT name for a push button "QPushButton". And any of the words in combination in any order and any capitalization also work. Sometimes other words work, like "click" ( what you do to a push button ) also works. Experiment a little, and you may even find out how to add key words to a tab.
Because it is sometimes hard to remember the names of QT widgets a list of all the important widgets in the application appear in a list above the key word field. Clicking on a widget name adds it to the key words.
Once you have found a tab in the list just click on it. It should open in a new tab ( unless it is already open ). Then interact with it. Click on things, right click on things, use the buttons, watch the messages. The inspect feature is a very powerful introspection tool, and the breakpoint button breaks into the debugger in the code of the tab.
So you are running the code in your IDE ( Spyder Recommended ) and now it is time to read the code. You could find it through the wiki, a search of the source code or the easy way press the button on the tab. This will stop the code in your debugger in the bre4akpoint function of the tab of interest. It should now be easy to track down the exact code. Use the function names in the messages from the tab, or on the buttons of the tab for additional help. Read the code. The widgets are usually constructed in ..... and mutated and inspected in ..... Some tabs have additional methods, finding your widgets instance name can also be used to track down the code. Read it we should have enough comments for you to be ready for the next operation, if not use the wiki-wiki button to find and read the wiki.
Locate the code of interest and copy it. The reading step should help.
Paste the code into your project. The reading step should help you understand how to do this. At this point you ( not us ) are responsible for the code.
The code is probably not 100% correct, names may need to be change. Change them. The code is now fully yours, and hopefully works as you intend.