[PyKDE] Re: [PyQt3] QStyle.drawComplexControl() with invalid type in arg 7

Hans-Peter Jansen hpj at urpla.net
Mon Oct 23 20:47:50 BST 2006

Am Montag, 23. Oktober 2006 18:22 schrieb Hans-Peter Jansen:
> Am Sonntag, 22. Oktober 2006 23:32 schrieb Hans-Peter Jansen:
> Update: to avoid the SC_All value for the sub parameter, I added:
>         sub = QStyle.SC_SpinWidgetUp | QStyle.SC_SpinWidgetDown |
> QStyle.SC_SpinWidgetFrame | \ QStyle.SC_SpinWidgetEditField |
> QStyle.SC_SpinWidgetButtonField
> and use this value, which in theory should do the right thing.
> Unfortunately, it leads to the earlier mentioned core dump with an
> interesting back trace:
> The question is, why the heck does paintEvent call into
> QSpinWidget::buttonSymbol at all? At least, I wouldn't expect this, but
> may be it's due to some self.style().drawComplexControl() side effect?

Found it. Inside drawComplexControl(), whereever it is implemented, it accesses the QSpinWidget to check, which button symbols to paint, and that's where it crashes. This is the first time, where I got stuck in such a way, it looks like it cannot be solved on the python side of PyQt (well, at least not without giving up consistent visual appearance by implementing the QSpinWidget button paint with primitive elements, or suffering big pains by subclassing QSpinBox and trying to override most functionality..)

The whole issue is triggered by the unfortunate relationship of QSpinBox with the int based QRangeControl, which is simply too limited for medium sized decimal values (at least on 32 bit cpus), since they must be mapped to the int range.

If anybody has more ideas, what can be done, I'm open for suggestions..

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20061023/61389812/attachment.html

More information about the PyQt mailing list