Issue
I have a QSpinBox in which I want to enable the arrows (for up and down values) but disable inserting data by the user. I've tried using this:
QtGui.QSpinBox.setReadOnly(True)
But it doesn't work. All is disabled and the arrows are 'stuck'.
Solution
If you set the spin-box readonly, it will disable eveything. Instead, just set the line-edit readonly, and then buttons will still work:
spinbox.lineEdit().setReadOnly(True)
Answered By - ekhumoro
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.