Many Thanks Pete<br><br>I forgot to answer back, but eventually I did convert the code from C++ to Python<br><br>I could solve the crash issue doing this:<br><br> richTextLabel.drawContents(QPainter(richTextPixmap), QRectF(richTextPixmap.rect()))<br>
<br>I am fighting now with Qt Designer. I am trying to put the Html property in the Property editor panel as a rich Text Property, but no luck.<br><br>I am trying to get the right xml on the method domXml of the class QtDesigner.QPyDesignerCustomWidgetPlugin<br>
<br>(<a href="http://trinity.pearsoncomputing.net/docs/qt4/designer-creating-custom-widgets.html">http://trinity.pearsoncomputing.net/docs/qt4/designer-creating-custom-widgets.html</a>)<br><br><br>Best Regards<br><br><div class="gmail_quote">
On 26 January 2011 22:03, Hans-Peter Jansen <span dir="ltr"><<a href="mailto:hpj@urpla.net">hpj@urpla.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Wednesday 26 January 2011, 14:35:35 <a href="mailto:ferdemza@gmail.com">ferdemza@gmail.com</a> wrote:<br>
> Thanks again Pete<br>
><br>
> I think i will do my own custom widget from scratch following a book<br>
> i have and then use the link you gave me to integrate it to the<br>
> designer.<br>
<br>
</div></div>As I told you, it is simpler to convert the Qt code.<br>
<br>
@Phil: for some reason, the richTextPainter.end() is needed in the PyQt<br>
version to avoid a SIGSEGV crash during paint event:<br>
<br>
QPaintDevice: Cannot destroy paint device that is being painted<br>
<br>
(gdb) bt<br>
#0 0x08339d10 in ?? ()<br>
#1 0xb647c3f8 in ~QPainter (this=0x1) at painting/qpainter.cpp:1491<br>
#2 0xb6fdfe80 in release_QPainter (sipCppV=0x82514d8) at sipQtGuiQPainter.cpp:5371<br>
#3 0xb6fdfedc in dealloc_QPainter (sipSelf=0xb4ae4454) at sipQtGuiQPainter.cpp:5382<br>
#4 0xb7fc4f5f in forgetObject (sw=0xb4ae4454) at siplib.c:10004<br>
#5 0xb7fc4ff1 in sipSimpleWrapper_dealloc (self=0xb4ae4454) at siplib.c:9233<br>
#6 0xb7eba68d in subtype_dealloc (self=0xb4ae4454) at Objects/typeobject.c:1018<br>
#7 0xb7e8c24a in frame_dealloc (f=0x8301c4c) at Objects/frameobject.c:417<br>
#8 0xb7ef8bec in PyEval_EvalCodeEx (co=0xb7c32260, globals=0xb7c7602c, locals=0x0, args=0xb7c42418, argcount=2,<br>
kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2953<br>
#9 0xb7e8da29 in function_call (func=0xb5f37994, arg=0xb7c4240c, kw=0x0) at Objects/funcobject.c:524<br>
#10 0xb7e68c1c in PyObject_Call (func=0xb5f37994, arg=0xb7c4240c, kw=0x0) at Objects/abstract.c:2487<br>
#11 0xb7e769fe in instancemethod_call (func=0xb5f37994, arg=0xb7c4240c, kw=0x0) at Objects/classobject.c:2579<br>
#12 0xb7e68c1c in PyObject_Call (func=0xb7c26694, arg=0xb5f5b02c, kw=0x0) at Objects/abstract.c:2487<br>
#13 0xb7ef177f in PyEval_CallObjectWithKeywords (func=0xb7c26694, arg=0xb5f5b02c, kw=0x0) at Python/ceval.c:3548<br>
#14 0xb7fc6b03 in sip_api_call_method (isErr=0x0, method=0xb7c26694, fmt=0xb721cf4c "D") at siplib.c:1721<br>
#15 0xb6e3b5f9 in sipVH_QtGui_3 (sipGILState=PyGILState_UNLOCKED, sipMethod=0xb7c26694, a0=0xbfffdaa4)<br>
at sipQtGuicmodule.cpp:7343<br>
#16 0xb7199dc9 in sipQPushButton::paintEvent (this=0x81f0718, a0=0xbfffdaa4) at sipQtGuiQPushButton.cpp:420<br>
<br>
Do you want me to prepare that code for inclusion into examples?<br>
<br>
Pete<br>
</blockquote></div><br>