[PySide] combining two default widgets

Frank Rueter | OHUfx frank at ohufx.com
Tue Oct 22 03:01:15 CEST 2013


yes, that's indeed more sensible. I am just inheriting from QComboBox 
now and drawing a simple progress bar myself.

Cheers,
frank


On 22/10/13 08:28, Matthew Woehlke wrote:
> On 2013-10-20 01:37, Frank Rueter | OHUfx wrote:
>> I have written a custom comboBox which renders like a progress bar.
>> Depending on which item is chosen, the progress bar is updated accordingly:
>> http://pastebin.com/yWACCHH0)
>>
>> Initially I thought I'd be cheeky and try to inherit both QComboBox and
>> QProgessBar (in that order) to see if this is the easiest way to do
>> this, but the app crashed as soon as I used self.setItems() in the
>> constructor.
> In C++, inheriting from QObject more than once is explicitly forbidden.
> While it *might* be possible to make this work in PySide, I wouldn't
> count on it, nor would I particularly recommend it.
>
> What is the purpose of inheriting from both? You may be better off
> having one as an internal object of the other, similar to how there is
> an internal QLineEdit of QComboBox.
>




More information about the PySide mailing list