예제 #1
0
파일: legend.py 프로젝트: gyenney/Tools
    def createWidget(self, data):
        """
        Create a widget to be inserted into the legend

        The default implementation returns a `QwtLegendLabel`.
        
        :param QwtLegendData data: Attributes of the legend entry
        :return: Widget representing data on the legend
        
        ... note::
        
            updateWidget() will called soon after createWidget()
            with the same attributes.
        """
        label = QwtLegendLabel()
        label.setItemMode(self.defaultItemMode())
        label.clicked.connect(lambda: self.itemClicked(label))
        label.checked.connect(lambda state: self.itemChecked(state, label))
        return label
예제 #2
0
 def createWidget(self, data):
     label = QwtLegendLabel()
     label.setItemMode(self.defaultItemMode())
     label.SIG_CLICKED.connect(lambda: self.itemClicked(label))
     label.SIG_CHECKED.connect(lambda state: self.itemChecked(state, label))
     return label
예제 #3
0
 def createWidget(self, data):
     label = QwtLegendLabel()
     label.setItemMode(self.defaultItemMode())
     label.SIG_CLICKED.connect(lambda: self.itemClicked(label))
     label.SIG_CHECKED.connect(lambda state: self.itemChecked(state, label))
     return label