1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-14 03:30:02 +00:00

Simplified PinMatrix widget

This commit is contained in:
slush0 2013-10-08 01:43:16 +02:00
parent a69c820f5b
commit 2a1a1e61e4

View File

@ -24,8 +24,6 @@ class PinMatrixWidget(QWidget):
def __init__(self, parent=None):
super(PinMatrixWidget, self).__init__(parent)
self.buttons = []
self.password = QLineEdit()
self.password.setValidator(QRegExpValidator(QRegExp('[1-9]+'), None))
self.password.setEchoMode(QLineEdit.Password)
@ -36,15 +34,12 @@ class PinMatrixWidget(QWidget):
button = PinButton(self.password, x + 1)
button.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
button.setFocusPolicy(Qt.NoFocus)
self.buttons.append(button)
grid.addWidget(button, x / 3, x % 3)
vbox = QVBoxLayout()
vbox.addLayout(grid)
vbox.addWidget(self.password)
self.setLayout(vbox)
self.move(300, 150)
def get_value(self):
return self.password.text()
@ -70,6 +65,7 @@ if __name__ == '__main__':
w = QWidget()
w.setLayout(vbox)
w.move(100, 100)
w.show()
a.exec_()