[PyQt] QLabel with tabs and newlines crashes Python

Erik Janssens Erik.Janssens at conceptive.be
Wed Dec 15 21:25:48 GMT 2010


it does not crash on my python 2.7 - pyqt 4.8.1 - qt 4.7.1 build on Linux

On Wed, Dec 15, 2010 at 10:07 PM, Joe Planisky <joe.planisky at temboo.com> wrote:
> 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
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>


More information about the PyQt mailing list