Changeset 13cd397 in sasview for src


Ignore:
Timestamp:
Oct 9, 2017 7:07:09 AM (7 years ago)
Author:
wojciech
Branches:
ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
ca7c6bd
Parents:
d6e5b31
Message:

subclass to QStandardItemModel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingWidget.py

    r8f2548c r13cd397  
    5050 
    5151USING_TWISTED = True 
     52 
     53class ToolTippedItemModel(QtGui.QStandardItemModel): 
     54 
     55    def __init__(self, parent = None): 
     56        QtGui.QStandardItemModel.__init__(self,parent) 
     57 
     58    # optional method for Model class 
     59    def headerData(self, section, orientation, role): 
     60 
     61        if role == QtCore.Qt.ToolTipRole: 
     62            if orientation == QtCore.Qt.Horizontal: 
     63                return QtCore.QString("Horizontal Header %s Tooltip" % str(section)) 
     64            else: 
     65                return QtCore.QString("Vertical Header %s Tooltip" % str(section)) 
    5266 
    5367class FittingWidget(QtGui.QWidget, Ui_FittingWidgetUI): 
     
    240254        # We can't use a single model here, due to restrictions on flattening 
    241255        # the model tree with subclassed QAbstractProxyModel... 
    242         self._model_model = QtGui.QStandardItemModel() 
    243         self._poly_model = QtGui.QStandardItemModel() 
    244         self._magnet_model = QtGui.QStandardItemModel() 
     256        self._model_model = ToolTippedItemModel() 
     257        self._poly_model = ToolTippedItemModel() 
     258        self._magnet_model = ToolTippedItemModel() 
    245259 
    246260        # Param model displayed in param list 
Note: See TracChangeset for help on using the changeset viewer.