Skip to content

Commit a69e45a

Browse files
committed
qtvcp calc: prevent display input, fix check for None
Currently inputting text directly into the display (5+5 for example) and clilcking = will cause a crash. In the future perhaps this can be sorted out to accept this, for now it's best to prevent input into this box. The newly added preference stores "None" as a string, fix the check to check for "None" instead of None.
1 parent 9ff4280 commit a69e45a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/python/qtvcp/widgets/calculator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, parent=None):
3636

3737
self.display = QLineEdit('0')
3838
self.display.setMinimumHeight(30)
39-
self.display.setReadOnly(False)
39+
self.display.setReadOnly(True)
4040
self.display.setAlignment(Qt.AlignRight)
4141
self.display.setMaxLength(15)
4242

@@ -116,7 +116,7 @@ def __init__(self, parent=None):
116116

117117
if self.PREFS_:
118118
constValues = self.PREFS_.getpref('constValuesList', None, str, self.PREF_SECTION)
119-
if constValues is not None:
119+
if constValues != 'None':
120120
self.constButtons = []
121121
constValues = ''.join(constValues.split())
122122
for value in constValues.split(',')[:6]:

0 commit comments

Comments
 (0)