Cancel a program from a child window

Need help, or want to share a macro? Post here!
Posts: 48
Joined: Wed Oct 17, 2018 9:00 am

Cancel a program from a child window

Postby Chri1 » Mon Jul 29, 2019 9:50 am


I have a class "andocken" which calls a Dialogwindow. (The dialogwindow is another class (Ui_Dialog) in a another file ( )

Code: Select all

class andocken:
    def __init__(self,val):
        import bkNeu_diag
        self.d = QtGui.QDialog(FreeCADGui.getMainWindow())
        self.d.ui.setupUi(self.d, pipeout)        
        ###  Further Code ........         
ad = andocken(1)
In "Further code" a Snapper.Getpoint loop asks for several pick points, after every pick the point is sent and displayed in the Window Dialog.
When all the needed points are clicked, the dialog window closes and "docking" goes on.
This works.
But what if I don't want to pick any more in between?
In the dialog box there is a button "Cancel" and if the is clicked, the complete program should be canceled (also the pick loop)
Maybe call the dialog box with: d.ui.setupUi(self.d, self) and receive in dialog with def setupUi(self, dialog, ID)?
But what next? ID.close() does not work

Thanks for help

User avatar
Posts: 4354
Joined: Tue Nov 12, 2013 4:06 pm

Re: Cancel a program from a child window

Postby microelly2 » Mon Jul 29, 2019 11:08 am