On Nov 22, 2007 11:48 AM, Phil Thompson <<a href="mailto:phil@riverbankcomputing.co.uk">phil@riverbankcomputing.co.uk</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Thursday 22 November 2007, Alexandre Badez wrote:<br>> On Nov 22, 2007 11:09 AM, Phil Thompson <<a href="mailto:phil@riverbankcomputing.co.uk">phil@riverbankcomputing.co.uk</a>
><br>><br>> wrote:<br>> > On Thursday 22 November 2007, Alexandre Badez wrote:<br>> > > On Nov 21, 2007 5:26 PM, Alexandre Badez <<a href="mailto:alexandre.badez@gmail.com">alexandre.badez@gmail.com
</a>><br>> ><br>> > wrote:<br>> > > > On Nov 21, 2007 5:06 PM, Andreas Pakulat <<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>> wrote:<br>> > > > > [...]<br>> > > > > You can't, unless you copy the code, translate it to python and put
<br>> ><br>> > it<br>> ><br>> > > > > into your own delegate. Only whats documented in the API docs can<br>> ><br>> > be<br>> ><br>> > > > > used without copying it, everything else in Qt's code is private.
<br>> > > > ><br>> > > > > Andreas<br>> > > > ><br>> > > > > --<br>> > > > > Your mode of life will be changed for the better because of new<br>> > > > > developments.
<br>> > > > > _______________________________________________<br>> > > > > PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>> > > > >
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>> > > ><br>> > > > Thanks<br>> > > ><br>
> > > > --<br>> > > > Alex<br>> > ><br>> > > Hye,<br>> > ><br>> > > I'm steel trying to make my deletage, but I've steel have some problem.<br>> > > My application must be multi-plateform, so I develop for win32 and Unix
<br>> > > (SunOs 5.8).<br>> > > On Windows I've got:<br>> > > PyQt 4.0 (262 144)<br>> > > Qt 4.1.5 (even if PyQt give me the information: Qt 4.1.3 (262 403)<br>> > ><br>
> > > On Unix I've got:<br>> > > PyQt 4.1.1 (262 401)<br>> > > Qt 4.1.4 (262 404)<br>> > ><br>> > > In my delegate I'm doing this:<br>> > ><br>> > > from PyQt4 import QtGui
<br>> > > class myDelegate(QtGui.QItemDelegate):<br>> > > def paint(self, painter, option, index):<br>> > > [...]<br>> > > self.decoration(...) # <- method protected declare in C++
<br>> > > object [...]<br>> > ><br>> > > This code work great on window, but not on Unix (AttributError).<br>> > ><br>> > > What am I doing wrong ?<br>> ><br>> > QItemDelegate::decoration() is internal to Qt.
<br>> ><br>> > Phil<br>> > _______________________________________________<br>> > PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>> > <a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">
http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>><br>> But why does it work in Win32 and not on Unix ?<br><br></div></div>Wrong question. Why does it work with PyQt 4.0 and not with PyQt 4.1.1?<br><br>
...because the very first versions of PyQt4 incorrectly exposed internal Qt<br>functions.<br><div class="Ih2E3d"><br>> Those method, even if they are not documented, are protected, so I can<br>> normally do it in C++; so why not in python ?
<br><br></div>Because PyQt only exposes the official Qt API.<br><div><div></div><div class="Wj3C7c"><br>Phil<br>_______________________________________________<br>PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">
PyQt@riverbankcomputing.com</a><br><a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></div></div></blockquote></div><br>Thanks everybody for your answers.
<br>I swear I will try not to use private method anymore :P<br><br>By the way, is there a better than re implement the complete paint method ?<br>I mean, I just want to change the color of the line according to the "type" of the node (but not in every view).
<br><br>@Andreas: I wish I could update my different versions.<br>But, my unix administration service his quiet... crappy? So they do not want to upgrade (it's the same for python (2.4), PyQt, and dozen of other library / framework). That their politic...
<br><br>-- <br>Alex<br>