I have a dialog-window for userinput of parameters for a cuboid.
There is a OK-Button and after clicking it, the Dialog should disappeare - That is my problem!
Then a new Dialog appeares "Click a Insertion Point"
Code: Select all
....
import DraftSnap
.....
class Ui_Dialog(QtGui.QDialog):
def setupUi(self, Dialog):
.... Dialog to create a cuboid
....
self.pB_Einf.clicked.connect(self.quader) #Clicking the OK-Button calls function quader Part::Box
....
def quader(self): #Creates the cuboid
global ding
ding = App.ActiveDocument.addObject("Part::Box", "Box")
l = self.doubleSpinBox_10.value()
ding.Length = str(l) + "m"
...
snapit(ding) # To insert the cuboid where the User clicked.
def cb(point, self): #Gets the Point from the snapper
if point:
print("Punkt:", point)
Draft.move(ding,point,copy=False)
def snapit(ding):
print("Here should the Dialog disappeare!!!!") # <-------------------------------------------------------- ??????????????
#MainWindow.close()
#Mainwindow.done()
point = FreeCADGui.Snapper.getPoint(callback = Ui_Dialog.cb) #Calls function cb, wich moves the cuboid
....
It would be nice, if the cuboid would hang on the cursor, while the user moves to a Insertion Point - Is this possible?
Thanks Chr1