예제 #1
0
    def __init__(self):

        super(FenPartWidget, self).__init__()
        self.item = self.item_class()

        button = GraphicsButton(self.item)
        button.setParentItem(self)
        button.clicked.connect(self.onClicked)
예제 #2
0
    def __init__(self, default, minimum, maximum):
        super(IntegerWidget, self).__init__()

        self.minimum = int(minimum)
        self.maximum = int(maximum)
        int(default)
        self.item = CharacterItem(str(default))
        button = GraphicsButton(self.item)
        button.setParentItem(self)
예제 #3
0
    def __init__(self, font):

        super(CastleRightsWidget, self).__init__()

        self._buttons = []
        layout = QtGui.QGraphicsLinearLayout()

        for idx, symbol in enumerate(self.default):
            piece = PieceItem(font[symbol])
            piece.scaleTo(self.side)
            button = GraphicsButton(piece, checkable=True, data=symbol)
            button.checked = True
            button.toggled.connect(self.onToggled)
            self._buttons.append(button)
            layout.addItem(button)

        self.setLayout(layout)