Example #1
0
    def getShownProperties(self):
        """Returns a copy of the currently shown properties

        :return: (CurveAppearanceProperties)
        """
        prop = CurveAppearanceProperties()
        # get the values from the Style comboboxes. Note that the empty string
        # ("") translates into None
        prop.sStyle = ReverseNamedSymbolStyles[str(
            self.ui.sStyleCB.currentText())]
        prop.lStyle = ReverseNamedLineStyles[str(
            self.ui.lStyleCB.currentText())]
        prop.cStyle = ReverseNamedCurveStyles[str(
            self.ui.cStyleCB.currentText())]
        # get sSize and lWidth from the spinboxes
        prop.sSize = self.ui.sSizeSB.value()
        prop.lWidth = self.ui.lWidthSB.value()
        if prop.sSize < 0:
            prop.sSize = None
        if prop.lWidth < 0:
            prop.lWidth = None
        # Get the Color combo boxes. The item at index 0 is the empty one in
        # the comboboxes
        index = self.ui.sColorCB.currentIndex()
        if index == 0:
            prop.sColor = None
        else:
            prop.sColor = Qt.QColor(self.ui.sColorCB.itemData(index))
        index = self.ui.lColorCB.currentIndex()
        if index == 0:
            prop.lColor = None
        else:
            prop.lColor = Qt.QColor(self.ui.lColorCB.itemData(index))
        # get the sFill from the Checkbox.
        checkState = self.ui.sFillCB.checkState()
        if checkState == Qt.Qt.PartiallyChecked:
            prop.sFill = None
        else:
            prop.sFill = bool(checkState)
        # get the cFill from the Checkbox.
        checkState = self.ui.cFillCB.checkState()
        if checkState == Qt.Qt.PartiallyChecked:
            prop.cFill = None
        else:
            prop.cFill = bool(checkState)
        # store the props
        return copy.deepcopy(prop)
Example #2
0
    def getShownProperties(self):
        """Returns a copy of the currently shown properties

        :return: (CurveAppearanceProperties)
        """
        prop = CurveAppearanceProperties()
        # get the values from the Style comboboxes. Note that the empty string
        # ("") translates into None
        prop.sStyle = ReverseNamedSymbolStyles[
            str(self.ui.sStyleCB.currentText())]
        prop.lStyle = ReverseNamedLineStyles[
            str(self.ui.lStyleCB.currentText())]
        prop.cStyle = ReverseNamedCurveStyles[
            str(self.ui.cStyleCB.currentText())]
        # get sSize and lWidth from the spinboxes
        prop.sSize = self.ui.sSizeSB.value()
        prop.lWidth = self.ui.lWidthSB.value()
        if prop.sSize < 0:
            prop.sSize = None
        if prop.lWidth < 0:
            prop.lWidth = None
        # Get the Color combo boxes. The item at index 0 is the empty one in
        # the comboboxes
        index = self.ui.sColorCB.currentIndex()
        if index == 0:
            prop.sColor = None
        else:
            prop.sColor = Qt.QColor(self.ui.sColorCB.itemData(index))
        index = self.ui.lColorCB.currentIndex()
        if index == 0:
            prop.lColor = None
        else:
            prop.lColor = Qt.QColor(self.ui.lColorCB.itemData(index))
        # get the sFill from the Checkbox.
        checkState = self.ui.sFillCB.checkState()
        if checkState == Qt.Qt.PartiallyChecked:
            prop.sFill = None
        else:
            prop.sFill = bool(checkState)
        # get the cFill from the Checkbox.
        checkState = self.ui.cFillCB.checkState()
        if checkState == Qt.Qt.PartiallyChecked:
            prop.cFill = None
        else:
            prop.cFill = bool(checkState)
        # store the props
        return copy.deepcopy(prop)