[PyQt] Custom widget SIP bindings: style not applied

Phil Thompson phil at riverbankcomputing.com
Thu Nov 1 17:30:39 GMT 2012


On Mon, 29 Oct 2012 16:21:14 +0200, Alexander Bruy
<alexander.bruy at gmail.com> wrote:
> Hi all,
> 
> I subclassed QLineEdit and created custom lineedit widget with builtin
> button to clear it. This code in C++ and it works as expected (see
attached
> images cpp_widget_empty.png and cpp_widget_with_text.png). Then I
> tried to wrap this C++ code with SIP and make custom widget available
> in Python.
> 
> Bindings created but when I use this widget in program, clear button
> displayed
> in left side instead of right (see image python_widget_with_text.png).
> When I
> implement same code in pure Python all works as expected, button is
showed
> in right side as expected.  Any ideas what's wrong and how to fix this?
> 
> All sources attached. I use PyQt 4.8.1, Qt 4.7.0 and SIP 4.11.2
> 
> Thanks

SIP needs to know about any reimplemented methods - resizeEvent() in this
case.

Phil


More information about the PyQt mailing list