need to go soon, but in any case I will leave you then the two options you have to add the code:
* you can add just the code of the example inside the directory pyside-setup/examples you create three levels more with this name quick/customitems/painteditem/ and place the code there.
* this one is more tricky, because you will need to adopt what is being presented here: https://codereview.qt-project.org/c/pyside/pyside-setup/+/285647 and do the same for your specific case.
I recommend you the first one, so then we can try to modify the page easily afterwards