View Issue Details

IDProjectCategoryView StatusLast Update
0004028Slicer4Core: Scripting (Wrapping, Python)public2018-05-28 23:29
ReporterrankinAssigned Tojcfr 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionunable to reproduce 
Product VersionSlicer 4.4.0 
Target VersionFixed in VersionSlicer 4.9.0 
Summary0004028: When reloading a scripted module, collapsed collapsible buttons are not repopulated
Description

As per summary:

If at the end of UI creation code the following is added:
collapsibleButton.collapsed = True
the layout area contains no widgets.

If the line is commented, the collapsible button is populated as expected (which can then later be collapsed via UI or interactor)

To reproduce:
Create scripted module from extension wizard
Modify setup() by adding the line:
parametersCollapsibleButton.collapsed = True
Launch Slicer
Go to new module and hit reload

TagsNo tags attached.

Activities

rankin

rankin

2015-08-06 06:47

reporter   ~0013228

Ooohhh interesting. It is not 100% reproducible. It only occurs with the following creation code!

#

Set up PLUS control collapsible button

#
self.plusControlCollapsibleButton = ctk.ctkCollapsibleButton()
self.plusControlCollapsibleButton.text = "Streaming Data"
# Layout within the collapsible button
plusFormLayout = qt.QFormLayout(self.plusControlCollapsibleButton)
plusFormLayout.setContentsMargins(15, 6, 15, 6)

#
# OpenIGTLink connector node selection
#
self.plusComboBox = slicer.qMRMLNodeComboBox()
self.plusComboBox.nodeTypes = (("vtkMRMLIGTLConnectorNode"), "")
self.plusComboBox.selectNodeUponCreation = True
self.plusComboBox.addEnabled = True
self.plusComboBox.removeEnabled = True
self.plusComboBox.noneEnabled = True
self.plusComboBox.showHidden = False
self.plusComboBox.showChildNodeTypes = False
self.plusComboBox.setMRMLScene(slicer.mrmlScene)
self.plusComboBox.setToolTip("Select connector node")
plusFormLayout.addRow("OpenIGTLink Connector: ", self.plusComboBox)

#
# Status label with icon
#
self.statusFrame = qt.QFrame()
statusLayout = qt.QFormLayout(self.statusFrame)
statusLayout.setContentsMargins(2,0,2,0)
self.statusLabel = qt.QLabel()
if self.logic.hasConnectorNode():
  self.statusLabel.text = self.openIGTNames[self.logic.getConnectorNode().GetState()]
self.statusIconLabel = qt.QLabel()
if self.logic.hasConnectorNode():
  self.statusIconLabel.pixmap = self._loadStatusPixmap( self.logic.getConnectorNode().GetState() )
statusLayout.addRow(self.statusLabel, self.statusIconLabel)
plusFormLayout.addRow("Status: ", self.statusFrame)

#
# Edit box for connector host
#
self.plusConnectorNodeHostLineEdit = qt.QLineEdit()
self.plusConnectorNodeHostLineEdit.text = self.logic.getParameterNode().GetParameter("IGTLConnectorHostname")
plusFormLayout.addRow("OpenIGTLink Host: ", self.plusConnectorNodeHostLineEdit)

#
# Edit box for connector port
#
self.plusConnectorNodePortLineEdit = qt.QLineEdit()
self.plusConnectorNodePortLineEdit.text = self.logic.getParameterNode().GetParameter("IGTLConnectorPort")
plusFormLayout.addRow("OpenIGTLink Port: ", self.plusConnectorNodePortLineEdit)

self.plusControlCollapsibleButton.collapsed = True
lassoan

lassoan

2018-05-28 23:29

developer   ~0015761

I cannot reproduce this anymore with Slicer-4.9.0-2018-05-28 on Windows.

Earlier I had this issue, too - workaround was to explicitly call self.someCollapsibleButton.collapsed = False before collapsing:

self.someCollapsibleButton.collapsed = False
self.someCollapsibleButton.collapsed = True

However, now I cannot reproduce those problems either.

This may have been fixed by switching to Qt5.

Issue History

Date Modified Username Field Change
2015-08-06 06:36 rankin New Issue
2015-08-06 06:36 rankin Status new => assigned
2015-08-06 06:36 rankin Assigned To => jcfr
2015-08-06 06:47 rankin Note Added: 0013228
2018-05-28 23:29 lassoan Status assigned => resolved
2018-05-28 23:29 lassoan Resolution open => unable to reproduce
2018-05-28 23:29 lassoan Fixed in Version => Slicer 4.9.0
2018-05-28 23:29 lassoan Note Added: 0015761