For anyone that is interested, the way I ended up doing this was polling the nitems_written() function of the head block, and once it reached the terminal value, calling another function to quit the QT application. Then I connected that function call to the other quitting() procedure. Seems kind of roundabout, but works.
-Michael
---
qapp = Qt.QApplication(sys.argv)
def quitQT():
qapp.quit()
max_n_samps = 1000000
tb = top_block_cls()
tb.start()
tb.show()
def check_status():
fg_is_done = 0
while not fg_is_done:
time.sleep(1)
if (tb.blocks_head_0.nitems_written(0) == max_n_samps):
fg_is_done = 1
quitQT()
def quitting():
tb.stop()
tb.wait()
qapp.connect(qapp, Qt.SIGNAL("aboutToQuit()"), quitting)
qapp.connect(qapp, Qt.SIGNAL("quitQT()"), quitting)
checker = Thread(target=check_status)
checker.start()
qapp.exec_()