@@ -115,19 +115,16 @@ def signalReceived(self, **kw):
115115class TestRenameCurveDialog (TestCaseQt ):
116116 """Basic test for RenameCurveDialog"""
117117
118- def _testDialogCB (self ):
119- """Callback to make mouse events on the dialog"""
120- self .qWaitForWindowExposed (self .dialog )
121- self .keyClicks (self .dialog .lineEdit , 'changed' )
122- self .mouseClick (self .dialog .okButton , qt .Qt .LeftButton )
123-
124118 def testDialog (self ):
125119 """Create dialog, change name and press OK"""
126120 self .dialog = LegendSelector .RenameCurveDialog (
127121 None , 'curve1' , ['curve1' , 'curve2' , 'curve3' ])
128-
129- qt .QTimer .singleShot (100 , self ._testDialogCB )
130- ret = self .dialog .exec_ ()
122+ self .dialog .open ()
123+ self .qWaitForWindowExposed (self .dialog )
124+ self .keyClicks (self .dialog .lineEdit , 'changed' )
125+ self .mouseClick (self .dialog .okButton , qt .Qt .LeftButton )
126+ self .qapp .processEvents ()
127+ ret = self .dialog .result ()
131128 self .assertEqual (ret , qt .QDialog .Accepted )
132129 newName = self .dialog .getText ()
133130 self .assertEqual (newName , 'curve1changed' )
0 commit comments