[PyQt] PyQt event linking to jupyter/ipython notebook cell

Cat mitelutco at gmail.com
Tue Oct 18 00:19:28 BST 2016


I was wondering if anyone knows how to enable jupyter notebook to interact
with a PyQt generated widget after calling app.exec_()?    The intrinsic
mouseEvent() functions do work, but the cells in the notebook are locked
out until the widget is closed manually.

It seems I have to call/execute the QApplication in a special way or
connect the notebook to it somehow, but can't figure it out.


#FIGURE CLASS: initialization of figure object and execution

class Figure(object):
    Main API functions

    def __init__(self):
        print "... initializing canvas ..."
        self.app = QApplication(sys.argv)

    def show(self):   #Show
        self.GUI = GLWindow(data)

#JUPYTER NOTEBOOK CODE: figure instantiation and display
fig = plb.figure()
fig.show()  #Locks out any further jupyter commands while widget on screen
fig.update() #Does not get executed until widget is closed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20161017/781f7225/attachment.html>

More information about the PyQt mailing list