QT crash with Jpg in Houdini

   5838   4   1
User Avatar
Member
401 posts
Joined:
Offline
The following qt snippet runs in a shell but crashes Houdini if executed as a shelf script within Houdini.
changing the image from jpg to gif resolves the issue.

How would one try to debug this ?

Houdini Shelf Script:
from PyQt4 import QtCore
from PyQt4 import QtGui
import pyqt_houdini

class ImageViewer(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
hbox = QtGui.QHBoxLayout()
self.setGeometry(800, 400, 250, 110)
self.thumbnail = QtGui.QLabel()
self.thumbnail.setPixmap(QtGui.QPixmap('/tmp/noThumb.gif'))
hbox.addWidget(self.thumbnail)
self.setLayout(hbox)


app = QtGui.QApplication()
dialog = ImageViewer()
dialog.show()

# The main difference from a normal PyQt application is that instead of calling
# app.exec_() you call pyqt_houdini.exec_(app, dialog1, …).
pyqt_houdini.exec_(app, dialog)

Shell version:

from PyQt4 import QtCore
from PyQt4 import QtGui


class ImageViewer(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
hbox = QtGui.QHBoxLayout()
self.setGeometry(800, 400, 250, 110)
self.thumbnail = QtGui.QLabel()
self.thumbnail.setPixmap(QtGui.QPixmap('/tmp/noImage.jpg'))
hbox.addWidget(self.thumbnail)
self.setLayout(hbox)


app = QtGui.QApplication()
dialog = ImageViewer()
dialog.show()

app.exec_()
this is not a science fair.
User Avatar
Member
454 posts
Joined: July 2005
Offline
http://www.sidefx.com/docs/houdini10.0/hom/cookbook/pyqt/part1/ [sidefx.com]
http://www.sidefx.com/docs/houdini10.0/hom/cookbook/pyqt/part2/ [sidefx.com]

Also, Take a look at:

hou.ui.addEventLoopCallback()
and related event loop methods…
(These should supercede the pyqt enableHou methods above)

Cheers
User Avatar
Member
401 posts
Joined:
Offline
I followed the instructions on the pages mentioned.
Also removing the threading stuff completely didn't help either.
this is not a science fair.
User Avatar
Member
454 posts
Joined: July 2005
Offline
I don't see this anywhere in your code:

pyqt_helper.queueCommand()
User Avatar
Member
454 posts
Joined: July 2005
Offline
Oh - ignore previous post - I see they've put up some new approaches using the new hou.ui.addEventLoopCallback method.

Sorry to hear it isn't working for you. It's working for me. Did you ask SESI?
  • Quick Links