QTgui.QDialog not working

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
ikua
Posts: 159
Joined: Fri Apr 07, 2017 1:32 pm

QTgui.QDialog not working

Post by ikua »

Hello!

I had an workbench running on fc 0.17. Now i tryed to migrate it to 0.18 and python 3. I got it more or less started. The strange thin is, the Qt.Gui only opens up ones. If i close it and try to open it a second time it does not work. Has anyone an idea, what the issue could be?

thanks ikua

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16131 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 3129ae4296e40ed20e7b3d460b86e6969acbe1c3
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

Code: Select all

from PySide import QtGui, QtCore
from PySide2.QtGui import *
from PySide2.QtWidgets import *
import FreeCAD as App
import FreeCADGui as Gui
import numpy as np


#Gui = FreeCADGui
# UI Class definitions
DNarray = np.genfromtxt(App.__path__[0] +  '\pipeExt\Resources\DN_Durchmesser.csv', delimiter=',', names=True)
RohrDef = np.genfromtxt(App.__path__[0] +  '\pipeExt\Resources\Rohrdefinitionen.csv', delimiter=',', names=True,dtype=None)
GaebBereiche = np.genfromtxt(App.__path__[0] +  '\pipeExt\Resources\GaebBereich.csv', delimiter=',', names=True,dtype=None)
#print(RohrDef.dtype.names)
#print(RohrDef)
# List all objects of the document
guiDoc = Gui.ActiveDocument
doc = App.ActiveDocument
sel = Gui.Selection.getSelection()
#loop through selection to search for pipes
iPipe=0
indexPipe = []
for o in sel:
	#print o.Name
	if "Pipe" in o.Name :
		iPipe=iPipe+1
		indexPipe.append(iPipe)


#if  not FreeCADGui.Selection.getSelection() :

class ExampleModalGuiClass(QtGui.QDialog):
	""""""

	GaebExport = True
	def __init__(self):
		super(ExampleModalGuiClass, self).__init__()
		self.initUI()
	def initUI(self):
		#here again (like above) for the update function
		sel = Gui.Selection.getSelection()
		#loop through selection to search for pipes
		iPipe=0
		indexPipe = []
		for o in sel:
			#print o.Name
			if "Pipe" in o.Name :
				iPipe=iPipe+1
				indexPipe.append(iPipe)
				
		self.result = userCancelled
		# create our window
		# define window		xLoc,yLoc,xDim,yDim
		self.setGeometry(	250, 250, 400, 220)
		self.setWindowTitle("Rohrmanipulation H2Office")
		self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
		
		# Rohrbezeichnung
		self.label2 = QtGui.QLabel("Rohrbezeichung:", self)
		self.label2.move(20, 20)
		self.textInputBez = QtGui.QLineEdit(self)
		self.textInputBez.setFixedWidth(150)
		self.textInputBez.move(20, 35)
		
		# Medium
		self.label2 = QtGui.QLabel("Medium:", self)
		self.label2.move(220, 20)
		self.popupItems1 = [""]+RohrDef["Medium"].tolist()
		self.popupMedium = QtGui.QComboBox(self)
		self.popupMedium.addItems(self.popupItems1)
		#self.popupMedium.setCurrentIndex(self.popupItems1.index("Faulgas"))
		self.popupMedium.activated[str].connect(self.onpopupMedium)
		self.popupMedium.move(220, 35)
		
		# # DN
		self.label2 = QtGui.QLabel("DN:", self)
		self.label2.move(330, 20)
		self.popupItems2 = [""]+[ '{:.0f}'.format(x) for x in DNarray["DN"]]
		self.popupDN = QtGui.QComboBox(self)
		self.popupDN.addItems(self.popupItems2)
		self.popupDN.move(330, 35)
		
		# # Material
		self.label3 = QtGui.QLabel("Material:", self)
		self.label3.move(20, 60)
		self.popupItems3 = [""]+np.unique(RohrDef["Material"]).tolist()
		self.popupMaterial = QtGui.QComboBox(self)
		self.popupMaterial.addItems(self.popupItems3)
		self.popupMaterial.move(20, 75)
		
		# Gaeb Ja nein
		self.checkboxGaeb = QtGui.QCheckBox("Gaebexport Rohrleitung", self)
		self.checkboxGaeb.clicked.connect(self.oncheckboxGaeb)
		self.checkboxGaeb.setTristate()
		self.checkboxGaeb.setCheckState(QtCore.Qt.PartiallyChecked)
		self.checkboxGaeb.move(20,100)		
				
		# Gaeb Bereich
		self.label11 = QtGui.QLabel("Gaeb Bereich:", self)
		self.label11.move(20, 120)
		self.popupItemsGaeb = [""]+np.unique(GaebBereiche["Bereich"]).tolist()
		self.popupGaeb = QtGui.QComboBox(self)
		self.popupGaeb.addItems(self.popupItemsGaeb)
		self.popupGaeb.move(20, 140)

			
		# Gaeb Gruppe
		self.label11 = QtGui.QLabel("Gaeb Gruppe:", self)
		self.label11.move(220, 120)
		self.textInputGaebGruppe = QtGui.QLineEdit(self)
		self.textInputGaebGruppe.setFixedWidth(150)
		self.textInputGaebGruppe.move(220, 140)
		

		# cancel button
		clearButton = QtGui.QPushButton('Clear input', self)
		clearButton.clicked.connect(self.onClear)
		clearButton.move(140,170)
		
		# OK button
		setButton = QtGui.QPushButton('Set Properties', self)
		setButton.clicked.connect(self.onSet)
		setButton.setAutoDefault(True)
		setButton.move(20, 170) 
		
		# Pipe show Button
		self.pipeShowButton = QtGui.QPushButton("Rohre ausblenden", self)
		self.pipeShowButton.setCheckable(True)
		self.pipeShowButton.clicked.connect(self.onpipeShow)
		self.pipeShowButton.move(20, 195) 

		# Pipe lines show Button
		self.pipeShowLineButton = QtGui.QPushButton("Rohrlinien ausblenden", self)
		self.pipeShowLineButton.setCheckable(True)
		self.pipeShowLineButton.clicked.connect(self.onpipeLineShow)
		self.pipeShowLineButton.move(140, 195) 


		# update button
		updateButton = QtGui.QPushButton('Get Properties', self)
		updateButton.clicked.connect(self.onupdate)
		updateButton.setAutoDefault(True)
		updateButton.move(220, 170)
		
		# update button
		updateButton = QtGui.QPushButton('Set Selection', self)
		updateButton.clicked.connect(self.onsetSel)
		updateButton.setAutoDefault(True)
		updateButton.move(300, 170)

		
		self.show()

		#Füllen der Felder wenn nur ein RohrDef
		if  iPipe==1 :
			#get Name of Pipe, change to string from unicode, get only part without standard naming part
			self.textInputBez.setText(sel[0].Label.split("_Rohr",1)[0])
		
		if  iPipe>=1 :	
			if hasattr(sel[0],"Medium"):
				self.popupMedium.setCurrentIndex(self.popupMedium.findText(str(sel[0].Medium)))
			if hasattr(sel[0],"Rohrmaterial"):
				self.popupMaterial.setCurrentIndex(self.popupMaterial.findText(str(sel[0].Rohrmaterial)))
			if hasattr(sel[0],"DN"):
				self.popupDN.setCurrentIndex(self.popupDN.findText(str(sel[0].DN)))#
			if hasattr(sel[0],"GaebBereich"):
				self.popupGaeb.setCurrentIndex(self.popupDN.findText(str(sel[0].DN)))
			if hasattr(sel[0],"GaebGruppe"):
				self.textInputGaebGruppe.setText(sel[0].GaebGruppe)
			if hasattr(sel[0],"GaebExport"):
				self.checkboxGaeb.setChecked(sel[0].GaebExport)
		#loopen durch auswahl, vergleich mit sel 0 wenn ungleich dann feld leeren
		for o in sel[1:]:
			if hasattr(o,"Medium") &  hasattr(sel[0],"Medium"):
				if o.Medium != sel[0].Medium:
					self.popupMedium.setCurrentIndex(-1)
			if hasattr(o,"Rohrmaterial") & hasattr(sel[0],"Rohrmaterial"):
				if o.Rohrmaterial != sel[0].Rohrmaterial:
					self.popupMaterial.setCurrentIndex(-1)
			if hasattr(o,"DN") & hasattr(sel[0],"DN"):
				if o.DN != sel[0].DN:
					self.popupDN.setCurrentIndex(-1)
			if hasattr(o,"GaebBereich") & hasattr(sel[0],"GaebBereich"):
				if o.GaebBereich != sel[0].GaebBereich:
					self.popupGaeb.setCurrentIndex(self.popupDN.findText(str(sel[0].DN)))
			if hasattr(o,"GaebGruppe") & hasattr(sel[0],"GaebGruppe"):
				if o.GaebGruppe != sel[0].GaebGruppe:
					self.GaebGruppe.setText("")
			if hasattr(o,"GaebExport") & hasattr(sel[0],"GaebExport"):
				if o.GaebExport != sel[0].GaebExport:
					self.GaebExport.setCheckState(QtCore.Qt.PartiallyChecked)
					
		
		if self.popupMedium.currentText()=="" :
			print ("leer")
		
	def onpopupMedium(self, selectedText):
		iii = str(RohrDef["Medium"].tolist().index(self.popupMedium.currentText()))
		self.popupMaterial.setCurrentIndex(self.popupMaterial.findText(str(RohrDef["Material"][iii])))
		

	def oncheckboxGaeb(self):
		print(type(str(self.checkboxGaeb.checkState() )))
		if  self.checkboxGaeb.isChecked():    
			self.GaebExport = True
			print("checkeD")
		else :
			self.GaebExport = False
			print("uncheckeD")

	def onClear(self):
		self.textInputBez.setText("")
		self.popupMedium.setCurrentIndex(-1)		
		self.popupMaterial.setCurrentIndex(-1)		
		self.popupDN.setCurrentIndex(-1)		
		self.popupGaeb.setCurrentIndex(-1)			
		self.textInputGaebGruppe.setText("")
		self.checkboxGaeb.setCheckState(QtCore.Qt.PartiallyChecked)
	
		#self.result			= userCancelled
		#self.close()
		
	def onSet(self):
		print (indexPipe)
		#Zuweisung der Bezeichnungen beginnt
		Leitungsbezeichnung = form.textInputBez.text()
		Medium = form.popupMedium.currentText()
		DN = form.popupDN.currentText()
		Rohrmaterial = form.popupMaterial.currentText()
		GaebGruppe = form.textInputGaebGruppe.text()
		GaebBereich = form.popupGaeb.currentText()	
		print ("Gaeb", GaebBereich)
		iw=2
		ir=0 # Laufvariable Rohr für Benennung
		ia=2
		sel = Gui.Selection.getSelection()
		
		#get the acutual selection
		indexPipeSet = []
		iPipeSet=0
		for o in sel:
			#print o.Name
			if "Pipe" in o.Name :
				iPipeSet=iPipeSet+1
				indexPipeSet.append(iPipeSet)
		

		#for obj in sel:
		for item in indexPipeSet: #loop durch alle gewählten Pipeobjecte
			print(item)
			print (indexPipeSet)
			obj=sel[item-1]
			ir = ir+1
			if not Leitungsbezeichnung =="" :
					obj.Label = Leitungsbezeichnung + "_Rohr_" + str(ir)
			if not Medium =="":
				if not hasattr(obj,"Medium"):
					obj.addProperty("App::PropertyString","Medium")
				obj.Medium = Medium 
				R = float(RohrDef["R"][RohrDef["Medium"].tolist().index(Medium)])
				G = float(RohrDef["G"][RohrDef["Medium"].tolist().index(Medium)])
				B = float(RohrDef["B"][RohrDef["Medium"].tolist().index(Medium)])
				print("color",R,G,B)
				obj.ViewObject.ShapeColor = (R/255,G/255,B/255)
				#dwire Line Anpassen 
				guiDoc.getObject(obj.Base.Name).LineColor = (R/255,G/255,B/255)
				guiDoc.getObject(obj.Base.Name).DrawStyle = u"Dashdot"
				guiDoc.getObject(obj.Base.Name).LineWidth = 4.000
				
			if not Rohrmaterial =="":		
				if not hasattr(obj,"Rohrmaterial"):
					obj.addProperty("App::PropertyString","Rohrmaterial")
				obj.Rohrmaterial =  Rohrmaterial		
			if not DN =="":						
				if not hasattr(obj,"DN"):
					obj.addProperty("App::PropertyString","DN")
				obj.DN = str(DN)
				Aussendurchmesser = DNarray["Durchmesser_mm"][[ '{:.0f}'.format(x) for x in DNarray["DN"]].index(DN)]
				obj.Diameter = Aussendurchmesser
				obj.Base.FilletRadius = Aussendurchmesser * 1.5
			if not GaebBereich =="":		
				if not hasattr(obj,"GaebBereich"):
					obj.addProperty("App::PropertyString","GaebBereich")
				obj.GaebBereich = GaebBereich 	
			if not GaebGruppe =="":		
				if not hasattr(obj,"GaebGruppe"):
					obj.addProperty("App::PropertyString","GaebGruppe")
				obj.GaebGruppe = GaebGruppe 	
			if not "PartiallyChecked" in str(form.checkboxGaeb.checkState() ): #wenn partially checked dann keine Veränderung
				if not hasattr(obj,"GaebExport"):
					obj.addProperty("App::PropertyBool","GaebExport")
				obj.GaebExport = form.GaebExport
				#print(str(form.checkbox.isChecked()))

				#AB Hier scheinbar für Armaturen todo noch durchschauen
				#ir +=2
				#print("Name: " + Leitungsbezeichnung + "_Rohr_" + str(ir))
			#	object_A = obj 
				#print(object_A.Label)
			#	for obj in sel:
			#		object_B = obj
			#		common = object_A.Shape.common( object_B.Shape )
			#		if common.Volume > 0.0 and (str(object_A.Label) <> str(object_B.Label)) and "_Rohr_" not in str(object_B.Label) :
			#			print("Ueberschneidung "+ object_A.Label +" " + object_B.Label + " Nr " + str(ia))
						#Nummer aus String entfernen und auch Leitungsbezeichnung um Anhauufung Leitunsart Name zu vermeiden
			#			object_B.Label = Leitungsbezeichnung + "_"+ filter(str.isalpha, str(str(object_B.Label).replace(Leitungsbezeichnung,'')) )+ "_" + str(ia)
						#add property geht nur bei PythonFeature objects
						#if form.checkboxGaeb.isChecked():
						#	print(str(object_B.label))
						#	object_B.addProperty("App::PropertyBool","GaebExport")
						#	object_B.GaebExport = True
			obj.touch()
		#for obj in FreeCAD.ActiveDocument.Objects:
			#obj.touch()
		App.ActiveDocument.recompute() 

	def onupdate(self):
		self.initUI()

	def onsetSel(self):
		#todo update selectin following properties from menue	
		App.ActiveDocument.recompute()

	def onpipeShow(self):
		if self.pipeShowButton.isChecked():
			for o in App.ActiveDocument.Objects :
				print (o.Name)
				if "Pipe" in o.Name :
					obj = App.ActiveDocument.getObject(o.Name)
					#print dir(obj)
					#print o.Name
					if  not form.textInputBez.text():
						Gui.ActiveDocument.getObject(o.Name).Visibility=False						
					elif form.textInputBez.text().lower() in o.Label.lower():
						Gui.ActiveDocument.getObject(o.Name).Visibility=False
						
		else:
			for o in App.ActiveDocument.Objects :
				if "Pipe" in o.Name :
					if  not form.textInputBez.text():
						Gui.ActiveDocument.getObject(o.Name).Visibility=True						
					elif form.textInputBez.text().lower() in o.Label.lower():
						Gui.ActiveDocument.getObject(o.Name).Visibility=True	

	def onpipeLineShow(self):
		if self.pipeShowLineButton.isChecked():
			for o in App.ActiveDocument.Objects :
				print (o.Label)
				if "Pipe" in o.Name :
					obj = App.ActiveDocument.getObject(o.Base.Name)
					if  not form.textInputBez.text():
						Gui.ActiveDocument.getObject(o.Base.Name).Visibility=True						
					elif form.textInputBez.text().lower() in o.Label.lower():
						Gui.ActiveDocument.getObject(o.Base.Name).Visibility=True	
		else:
			for o in App.ActiveDocument.Objects :
				print (o.Label)
				if "Pipe" in o.Name :
					if  not form.textInputBez.text():
						Gui.ActiveDocument.getObject(o.Base.Name).Visibility=False						
					elif form.textInputBez.text().lower() in o.Label.lower():
						print ("text")
						Gui.ActiveDocument.getObject(o.Base.Name).Visibility=False	
	
userCancelled		= "Cancelled"
userOK			= "OK"

form = ExampleModalGuiClass()
form.exec_()

if form.result==userCancelled:
	pass # steps to handle user clicking Cancel

doc.recompute
galou_breizh
Posts: 437
Joined: Wed Sep 15, 2010 9:38 am

Re: QTgui.QDialog not working

Post by galou_breizh »

Hi,

I didn't read your macro yet but I had a similar issue with the BoxCreator macro. The solution was to delete the widget, then the form containing it (cf. https://github.com/FreeCAD/FreeCAD-macr ... or.FCMacro).

Anyway, you cannot for sure mix PySide and PySide2. Cf. https://github.com/FreeCAD/FreeCAD-macr ... or.FCMacro for an example of import.

Hope this helps,
Gaël
ikua
Posts: 159
Joined: Fri Apr 07, 2017 1:32 pm

Re: QTgui.QDialog not working

Post by ikua »

thank you for you answer!

I do not really understand what you mean. I tried to implement you code into mine but failed. Maybe you could help me with more details (quite new to python).

greets and thanks ikua
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: QTgui.QDialog not working

Post by vocx »

ikua wrote: Wed Jan 29, 2020 12:03 pm

Code: Select all

from PySide import QtGui, QtCore
from PySide2.QtGui import *
from PySide2.QtWidgets import *
Don't import PySide and PySide2 at the same time. This is going to mess up the Qt classes available.

In FreeCAD you just need to import the modules from PySide. If you are using a FreeCAD for Qt4 it will use the Qt4 classes, but if you are using a FreeCAD compiled for Qt5, as you do, then PySide is a fake module which will import objects from PySide2. This is a trick done specifically in FreeCAD to support code written with Qt4 and Qt5 seemingly.

The PySide2.QtWidgets module is in fact contained in the PySide.QtGui module.

Code: Select all

PySide2.QtCore.SomeClass1 -> PySide.QtCore.SomeClass1
PySide2.QtGui.SomeClass2 -> PySide.QtGui.SomeClass2
PySide2.QtWidgets.SomeClass3 -> PySide.QtGui.SomeClass3
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
ikua
Posts: 159
Joined: Fri Apr 07, 2017 1:32 pm

Re: QTgui.QDialog not working

Post by ikua »

@vocx

thanks for the advice. Changed to how it was in fc 017

Code: Select all

from PySide import QtGui, QtCore
But still the thing is not working. The behavior is so strange... opening once and then not opening anymore. I also do not get any error in the console... no idea what to do.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: QTgui.QDialog not working

Post by vocx »

ikua wrote: Thu Jan 30, 2020 8:02 am ...no idea what to do.
Your code is too long. Try with a short example.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
ikua
Posts: 159
Joined: Fri Apr 07, 2017 1:32 pm

Re: QTgui.QDialog not working

Post by ikua »

I think I found my problem. I load my file with the window with an other script.
See example code below for the called file (lets name it pipeMenu.py).

Code: Select all

from PySide import QtGui, QtCore
import FreeCAD as App
import FreeCADGui as Gui
guiDoc = Gui.ActiveDocument
doc = App.ActiveDocument
class ExampleModalGuiClass(QtGui.QDialog):
	def __init__(self):
		super(ExampleModalGuiClass, self).__init__()
		self.initUI()
	def initUI(self):
		self.label2 = QtGui.QLabel("Medium:", self)
		self.label2.move(220, 20)
		self.popupItems1 = [""]+["ksjf"]+["selkjf"]
		self.popupMedium = QtGui.QComboBox(self)
		self.popupMedium.setFixedWidth(90)
		self.popupMedium.addItems(self.popupItems1)
		self.popupMedium.move(220, 35)
		self.show()
form = ExampleModalGuiClass()
form.exec_()
when i import it with "import pipeMenu", the window opens ones. If i close it, i can not make the window appear again with "pipeMenu".

It reloaded sometimes with "import firsttry" when there was a error in the code. Until i found out that, I was close to getting crazy.

i try to load the pipeMenu with the following code:

Code: Select all

# -*- coding: utf-8 -*-
import FreeCAD,FreeCADGui
class pipeMenu:
	"Menu to change pipes"
	def GetResources(self):
		return {"MenuText": "My Command",
				"Accel": "Ctrl+M",
				"ToolTip": "Menu for pipe properties",
				"Pixmap": FreeCAD.__path__[0] + "\pipeExt\icons\pipeMenu.svg"}

	def IsActive(self):
		return True #if true not grayed out

	def Activated(self):
		import pipeMenu
		pipeMenu

FreeCADGui.addCommand('pipeMenu',pipeMenu())
FreeCADGui.addCommand('pipeParts',pipeParts())
FreeCADGui.addCommand('pipeReduction',pipeReduction())
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: QTgui.QDialog not working

Post by vocx »

ikua wrote: Mon Feb 03, 2020 4:33 pm when i import it with "import pipeMenu", the window opens ones. If i close it, i can not make the window appear again with "pipeMenu".
This describes the behavior of modules in Python. I suggest you read a bit how Python manages imported modules.

When you import something, Python executes the code once, so whatever you have in the file will run. However, this caches the module's name, so when you import the file again, it looks at the cache, sees that the module is already imported, so it doesn't run its code again.

The proper way to run things again and again, is to put them in a function or class, and then you can re-run that function, or create another instance of the class.

If your objective is to create a Gui Command, then yes, you have to create a class which loads the graphical interface. Then you register the class with addCommand.

Code: Select all

FreeCADGui.addCommand('pipeMenu',pipeMenu())
Then you can run the command with Gui.runCommand("pipeMenu"), or by defining a button in the interface.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
ikua
Posts: 159
Joined: Fri Apr 07, 2017 1:32 pm

Re: QTgui.QDialog not working

Post by ikua »

i am a total newbie in pyhton. So i helped myself with a dirty hack, which is also mentioned here.
https://forum.freecadweb.org/viewtopic.php?t=2965

but when i use the reload function, fc some times stops to work, after working with the form.
i know i do something wrong here, but i am not able to find out what exactly.

the pipeMenu gets called form a workbench button:

Code: Select all

class pipeMenu:
	"Menu to change pipes"
	def GetResources(self):
		return {"MenuText": "My Command",
				"Accel": "Ctrl+M",
				"ToolTip": "Menu for pipe properties",
				"Pixmap": FreeCAD.__path__[0] + "\pipeExt\icons\pipeMenu.svg"}

	def IsActive(self):
		return True #if true not grayed out

	def Activated(self):
		import pipeMenu
		pipeMenu.MenuWindow()
		
i am not able to find out, how to call a Qdialog exactly in the same way as on the first startup of the modul (with the import command). greets

ikua
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: QTgui.QDialog not working

Post by vocx »

ikua wrote: Tue Feb 11, 2020 3:15 pm i am a total newbie in pyhton. So i helped myself with a dirty hack, which is also mentioned here.
...
What hack? You need to mention exactly what you are using.
i am not able to find out, how to call a Qdialog exactly in the same way as on the first startup of the modul (with the import command). greets
As I said, any import statement should not run code inside, it should only define things. The second time that you import something, the code inside won't be run.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply