예제 #1
0
    def __init__(self, parent, transformation, scaleDivision, logger=None):
        super(HorizontalScaleWidget, self).__init__()

        self.titleWidget = HorizontalTitleWidget("Scale Widget Title", self)
        self.scaleBar = HorizontalScaleBar(self, transformation, scaleDivision)

        plotLayout = QtWidgets.QGridLayout()
        plotLayout.setSpacing(0)
        plotLayout.setContentsMargins(0, 0, 0, 0)
        plotLayout.addWidget(self.scaleBar, 0, 0)
        plotLayout.addWidget(self.titleWidget, 1, 0)

        self.setLayout(plotLayout)
예제 #2
0
class HorizontalScaleWidget(QtWidgets.QWidget):
    def __init__(self, parent, transformation, scaleDivision, logger=None):
        super(HorizontalScaleWidget, self).__init__()

        self.titleWidget = HorizontalTitleWidget("Scale Widget Title", self)
        self.scaleBar = HorizontalScaleBar(self, transformation, scaleDivision)

        plotLayout = QtWidgets.QGridLayout()
        plotLayout.setSpacing(0)
        plotLayout.setContentsMargins(0, 0, 0, 0)
        plotLayout.addWidget(self.scaleBar, 0, 0)
        plotLayout.addWidget(self.titleWidget, 1, 0)

        self.setLayout(plotLayout)

    def setTitle(self, title):
        self.titleWidget.setTitle(title)

    def setScaleProperties(self, transformation, scaleDivision):
        self.scaleBar.set_scale_properties(transformation, scaleDivision)

    def spacingBorders(self):
        return self.scaleBar.spacingBorders()