0

I want to change the decimal digit in QLineEdit box. Here is the code I write

self.le1= QtGui.QLineEdit()    
self.le1.setValidator(QtGui.QDoubleValidator(1, 65535, 5))

From the documentation, I think it will make the input from range 1 to 65535 and can allow user to input 5 digits after decimal. But its not working. Can someone figure out the problem?

SimaGuanxing
  • 673
  • 2
  • 10
  • 29
  • Could you please explain what is it that you expect, and what is not working. Also do tell the version of PyQt4 and Qt4 you are currently using. – Marcus Jan 15 '16 at 05:45
  • If the problem is the range, not the decimals, here's a relevant link in C++: http://stackoverflow.com/questions/19571033/allow-entry-in-qlineedit-only-within-range-of-qdoublevalidator – Mel Jan 15 '16 at 10:03

0 Answers0