Changeset f37cab0 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
- Timestamp:
- Sep 12, 2018 8:12:44 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- 676a430
- Parents:
- 33b3e4d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
r2d47985 rf37cab0 273 273 self.theory_item = None 274 274 275 # list column widths 276 self.lstParamHeaderSizes = {} 277 275 278 # signal communicator 276 279 self.communicate = self.parent.communicate … … 361 364 self.lstParams.customContextMenuRequested.connect(self.showModelContextMenu) 362 365 self.lstParams.setAttribute(QtCore.Qt.WA_MacShowFocusRect, False) 366 # Column resize signals 367 self.lstParams.header().sectionResized.connect(self.onColumnWidthUpdate) 368 363 369 # Poly model displayed in poly list 364 370 self.lstPoly.setModel(self._poly_model) … … 1108 1114 self.SASModelToQModel(model, structure_factor) 1109 1115 1116 for column, width in self.lstParamHeaderSizes.items(): 1117 self.lstParams.setColumnWidth(column, width) 1118 1110 1119 # Update plot 1111 1120 self.updateData() … … 1669 1678 self._model_model.itemChanged.connect(self.onMainParamsChange) 1670 1679 1671 # Adjust the table cells width.1672 # TODO: find a way to dynamically adjust column width while resized expanding1673 self.lstParams.resizeColumnToContents(0)1674 self.lstParams.resizeColumnToContents(4)1675 self.lstParams.resizeColumnToContents(5)1676 self.lstParams.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)1677 1678 1680 def iterateOverPolyModel(self, func): 1679 1681 """ … … 2014 2016 self.magnet_params = {} 2015 2017 self.setMagneticModel() 2016 2017 # Adjust the table cells width2018 self.lstParams.resizeColumnToContents(0)2019 self.lstParams.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)2020 2018 2021 2019 # Now we claim the model has been loaded … … 2728 2726 self._poly_model.setData(fname_index, fname) 2729 2727 2728 def onColumnWidthUpdate(self, index, old_size, new_size): 2729 """ 2730 Simple state update of the current column widths in the param list 2731 """ 2732 self.lstParamHeaderSizes[index] = new_size 2733 2730 2734 def setMagneticModel(self): 2731 2735 """
Note: See TracChangeset
for help on using the changeset viewer.