Is there a way to automatically close a QT graphical sink after a flowgraph is done running? For example, I want to read in samples from a USRP, demodulate and plot the constellation, and then close everything automatically. My flowgraph looks like this:
USRP --> Head --> Demodulator --> QT Constellation Sink
--------------> File Sink
The head block stops the processing after a prescribed number of samples, but the QT sink remains open until I manually close it. If I disable graphics I can get this to run how I'd like, but having the option to see the constellation is important for me.
I've initially implemented this using a separate thread with a timer (see below), but it seems like there should be a cleaner way of doing this?
qapp = Qt.QApplication(sys.argv)
tb = top_block_cls()
qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
t = Thread(target=quitter)