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_()
QT crash with Jpg in Houdini
5812 4 1- rdg
- Member
- 401 posts
- Joined:
- Offline
- tstex
- 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
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
- rdg
- Member
- 401 posts
- Joined:
- Offline
- tstex
- Member
- 454 posts
- Joined: July 2005
- Offline
- tstex
- Member
- 454 posts
- Joined: July 2005
- Offline
-
- Quick Links