PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 1146 - QPainter.drawText causes segmentation fault
: QPainter.drawText causes segmentation fault
Status: UNCONFIRMED
Product: PySide
Classification: Unclassified
Component: QtGui
: 1.1.0
: PC Linux
: P5 minor
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2012-02-20 18:35 EET by Alex
Modified: 2012-03-08 16:57 EET (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex 2012-02-20 18:35:13 EET
On amd64 Gentoo, the following code results in segfault:
        img = QImage(300,300,QImage.Format_ARGB32)
        qp = QPainter(self.img)
        qp.setPen(QColor(168, 34, 3))
        qp.setFont(QFont('Arial', 10))
        #One may draw lines, polygons, etc here, all works fine
        qp.drawText(10,10, u'Test')#Segfault at this line
        qp.end()
If the app=QApplication(argv) line is not present in the code before.
Essentially, the problem is that the interpreter crashes with no visible error
message. It may be quite difficult why exactly this is happening, especially if
the application is not using QT for GUI, but just for image processing. 

Not like it breaks anything, but I have just wasted about 30 min trying to
figure it out.
Comment 1 Paulo Alcantara 2012-02-26 03:01:14 EET
Hi Alex,

It's a Qt issue rather a PySide one. This Qt issue has been discussed a couple
of times by Qt developers (including us, PySide developers). The same issue
occurs when writing the same program in C++ instead. If I fix the issue only to
fix this specific case, that means I'd have to additional overhead only to
check if a QApplication has been instatiated before instatiating an object
which needs an instance of QApplication somewhere. So make sure we have a
QApplication instance for whatever you're using that needs it. IIRC, if you do
it without having a QApplication instance on Windows systems the program won't
crash, instead it will print out an error/warning/fatal/whatever message.


           - Paulo Alcantara
Comment 2 Alex 2012-02-29 11:21:30 EET
In such case there appears to be no real solution. Just close it, and sorry for
bothering.
Comment 3 Matti Airas 2012-03-08 16:57:49 EET
PySide is now a Qt-addon and uses Qt Project's JIRA tool for tracking bugs.
Please verify that the bug is still valid and re-submit it in the address
below:

https://bugreports.qt-project.org/

Sorry for the inconvenience!