[PyQt] QTextBlockUserData forgotten in SIP 4.14.3, bug?

Olivier Keshavjee olivier.keshavjee at gmail.com
Sat Jun 8 17:35:56 BST 2013


Hello,

I've seen that two months ago (
http://www.riverbankcomputing.com/pipermail/pyqt/2013-March/032458.html) a
bug in PyQt caused QTextBlockUserData objects to be destroyed. This was
announced to be fixed.

Yet I still experience the same behaviour. When using the following syntax
highlighter:

class DummyHighlighter(QSyntaxHighlighter):
>
>
>  def __init__(self, parent):
>
> QSyntaxHighlighter.__init__(self, parent)
>
>
>  def highlightBlock(self, text):
>
> data = self.currentBlockUserData()
>
> if not data: data = DummyTextBlockUserData()
>
> print(data.isValid()) # AttributeError here, see below
>
> self.setCurrentBlockUserData(data)
>
>
>
> class DummyTextBlockUserData(QTextBlockUserData):
>
>
>  def __init__(self):
>
> QTextBlockUserData.__init__(self)
>
>
>  def isValid(self):
>
> return True
>

I get the following error:

Traceback (most recent call last):
>     File "highlighter.py", line 20, in highlightBlock
>         print(data.isValid())
> AttributeError: 'QTextBlockUserData' object has no attribute 'isValid'
>

This is using:

   - PyQt 4.10.1
   - SIP 4.14.6
   - Python 2.7.4

Is it still a bug?

Thanks for you help !

Olivier Keshavjee
Ch. du Daillard 37
1070 Puidoux
+41 (0)76 345 47 49
http://www.theologeek.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20130608/67af008d/attachment.html>


More information about the PyQt mailing list