[PyQt] QLabel with tabs and newlines crashes Python

Joe Planisky joe.planisky at temboo.com
Wed Dec 15 21:07:54 GMT 2010


Hi,

I've run into a strange situation with displaying text containing tab (\t) and newline (\n) characters in a QLabel.  The following code causes an immediate hard crash of python on my Windows XP system with Python 2.6, sip 4.10.5, PyQt 4.7.4, and Qt 4.6.3.  


from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys

app = QApplication(sys.argv)
dialog = QDialog()
layout = QHBoxLayout()
layout.addWidget(QLabel("test\t\n\ttest"))
dialog.setLayout(layout)
sys.exit(dialog.exec_())


Removing either the tabs or the newline cures the crash.  The equivalent program written in C++ does NOT crash, leading me to consider that this might be a PyQt issue.  

How can I conclusively determine whether this is a Qt or a PyQt issue?
   
-- 
Joe


More information about the PyQt mailing list