Qt, Houdini, Python Shell, QApp Event Loop not running?

   134   0   1
User Avatar
Member
33 posts
Joined: July 2005
Offline
Greetings,

Apologies for the newb question, but just doing a bit of testing of Qt in Houdini and I'm seeing unepected behavior. Running the following in the Python Shell results in no event processing.

from PySide2 import QtCore, QtWidgets

app = QtWidgets.QApplication.instance()
print(app)
# will return a qapp as expected
QtCore.QTimer.singleShot(3000, lambda: print('test'))
# should setup a three second timer that will print 'test'

I tried a couple of other scenarios: creating a timer instead of using singleShot; using a function instead a lambda; calling processEvents on the app object. Nothing. I've been working with Qt for quite a while now, and this behavior is perplexing to say the least. Can someone in the know explain to me why this is the case? Is Houdini not a QApplication? If not, where is that QApplication instance coming from? Why isn't it exec'd or connected to Houdini's event loop? Thanks in advance for the assist.

-B
-nimajneb
  • Quick Links