[PyQt] Adding a layout to a QSlider widget

Christopher M. Nahler christopher.nahler at papermodels.at
Wed Jun 23 14:57:37 BST 2010


I am quite new to PyQt so there might be better answers but this is what 
I would do:

Create a standard QSlider
Create another widget (depending on what the other widget should do)
Create a QWidget (or derived)
Put both Sliders in the QWidget and handle the layout here
Use signalling between the two sliders to reflect changes of one in the 
other

OR

Create a custom (mixed slider) widget. Here you would need to handle the 
painting yourself.

I am not sure if you can take part of the result of the QSlider and add 
the other part. You would have to handle the painting of the whole new 
slider. Maybe others can clarify this.

If you have not read it, I recommend Mark Summerfields book "Rapid GUI 
Programming with Python and Qt" (http://www.qtrac.eu/pyqtbook.html) It 
has a chapter on how to create your own custom widgets!

Hope this helps
Chris



More information about the PyQt mailing list