Allow only [1-9]+ in Pin matrix

pull/1/head
slush0 11 years ago
parent 0634d6bbb4
commit 12955a0c0c

@ -1,7 +1,7 @@
import sys
from PyQt4.Qt import QApplication, QWidget, QGridLayout, QVBoxLayout
from PyQt4.QtGui import QPushButton, QLineEdit, QSizePolicy
from PyQt4.QtCore import QObject, SIGNAL
from PyQt4.QtGui import QPushButton, QLineEdit, QSizePolicy, QRegExpValidator
from PyQt4.QtCore import QObject, SIGNAL, QRegExp
class PinButton(QPushButton):
def __init__(self, password, encoded_value):
@ -27,6 +27,7 @@ class PinMatrixWidget(QWidget):
self.buttons = []
self.password = QLineEdit()
self.password.setValidator(QRegExpValidator(QRegExp('[1-9]+'), None))
self.password.setEchoMode(QLineEdit.Password)
grid = QGridLayout()

Loading…
Cancel
Save