[PyQt] Custom widget SIP bindings: style not applied

Alexander Bruy alexander.bruy at gmail.com
Mon Oct 29 14:21:14 GMT 2012


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
-- 
Alexander Bruy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: src.tar.bz2
Type: application/x-bzip2
Size: 1001 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20121029/9a268f31/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpp_widget_empty.png
Type: image/png
Size: 394 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20121029/9a268f31/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpp_widget_with_text.png
Type: image/png
Size: 1895 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20121029/9a268f31/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_widget_with_text.png
Type: image/png
Size: 1548 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20121029/9a268f31/attachment-0002.png>


More information about the PyQt mailing list