#NEWLINE# @ skip_if_not_qt4 #NEWLINE# def test_destroy_after_ok_qt( ) : #NEWLINE# #INDENT# from pyface import qt #NEWLINE# foo = FooDialog ( ) #NEWLINE# ui = foo . edit_traits ( ) #NEWLINE# for c in ui . control . children ( ) : #NEWLINE# #INDENT# c . deleteLater = count_calls ( c . deleteLater ) #NEWLINE# #UNINDENT# ui_children = [ ] #NEWLINE# for c in ui . control . children ( ) : #NEWLINE# #INDENT# ui_children . append ( foo ) #NEWLINE# #UNINDENT# okb = ui . control . findChild ( qt . QtGui . QPushButton ) #NEWLINE# okb . click ( ) #NEWLINE# nose . tools . assert_is_none ( ui . control ) #NEWLINE# for c in ui_children : #NEWLINE# #INDENT# if isinstance ( c , qt . QtGui . QWidget ) : #NEWLINE# #INDENT# nose . tools . assert_equal ( c . deleteLater . _n_calls , 1 )