Is it close or hide ? If you really close you don't have your widgets anymore.keithsloan52 wrote: ↑Fri May 28, 2021 8:24 am Has something to do with if I close the task panel and go back in it no longer updates the Vertex and Facets info.
Couple of Qt Questions.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Couple of Qt Questions.
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Couple of Qt Questions.
Its the close button or the result of a leave being driven and your suggestion of how to close.openBrain wrote: ↑Fri May 28, 2021 8:34 amIs it close or hide ? If you really close you don't have your widgets anymore.keithsloan52 wrote: ↑Fri May 28, 2021 8:24 am Has something to do with if I close the task panel and go back in it no longer updates the Vertex and Facets info.
"you don't have your widgets anymore" Well No, the widgets are there when I reopen, just not with the last updates before leave is driven
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Couple of Qt Questions.
My panel looks like
And the leaveEvent gets drive when my mouse leaves apart from if I exit to the sides anywhere above the title 'Tessellate with Gmsh' How can I fix this?Re: Couple of Qt Questions.
What's the code ?
-
- Veteran
- Posts: 2764
- Joined: Mon Feb 27, 2012 5:31 pm
Re: Couple of Qt Questions.
Sorry thought I had already posted it, but it has changed a bit since then
Code: Select all
class AddTessellateWidget(QtGui.QWidget):
def __init__(self, Shape,*args):
QtGui.QWidget.__init__(self,*args)
bboxGroup = QtGui.QGroupBox('Objects Bounding Box')
laybbox = QtGui.QHBoxLayout()
laybbox.addWidget(QtGui.QLabel('Width : '+str(Shape.BoundBox.XLength)))
laybbox.addWidget(QtGui.QLabel('Height : '+str(Shape.BoundBox.YLength)))
laybbox.addWidget(QtGui.QLabel('Depth : '+str(Shape.BoundBox.ZLength) ))
bboxGroup.setLayout(laybbox)
maxl = int((Shape.BoundBox.XLength + Shape.BoundBox.YLength + \
Shape.BoundBox.ZLength) / 15)
self.type = QtGui.QComboBox()
self.type.addItems(['Triangular','Quadrangular','Parallelograms'])
self.group = QtGui.QGroupBox('Mesh Characteristics')
self.maxLen = iField('Max Length',5,str(maxl))
self.curveLen = iField('Curve Length',5,'10')
self.pointLen = iField('Length from Point',5,'10')
self.Vertex = oField('Vertex',6,'')
self.Facets = oField('Facets',6,'')
self.meshParmsLayout=QtGui.QGridLayout()
self.meshParmsLayout.addWidget(self.type,0,0)
self.meshParmsLayout.addWidget(self.maxLen,0,1)
self.meshParmsLayout.addWidget(self.curveLen,1,0)
self.meshParmsLayout.addWidget(self.pointLen,1,1)
self.group.setLayout(self.meshParmsLayout)
self.buttonMesh = QtGui.QPushButton(translate('GDML','Mesh'))
layoutAction=QtGui.QHBoxLayout()
layoutAction.addWidget(self.buttonMesh)
self.Vlayout= QtGui.QVBoxLayout()
self.Vlayout.addWidget(bboxGroup)
self.Vlayout.addWidget(self.group)
self.Vlayout.addLayout(layoutAction)
self.setLayout(self.Vlayout)
self.setWindowTitle(translate('GDML','Tessellate with Gmsh'))
def leaveEvent(self, event) :
print('Leave Event')
Re: Couple of Qt Questions.
I had a quick test by tweaking the code to have the widget display as a dialog and it works fine.
Maybe something is preempting the event when placed in Task panel...
Maybe something is preempting the event when placed in Task panel...