I need to restrict the inputs on one of my qlineEdit to a range between 2 numbers (for example "14-52"). The following code works fine for this.
Qt Code:
  1. QRegExp range( "[0-9]*[-][0-9]*");
To copy to clipboard, switch view to plain text mode 

Now I need to add some functionality to allow the user to press enter inside the line edit , in order to launch a command. I use the following for this.
on_myLineEdit_returnPressed()

My issue is that the QRegExp blocks the enter command. From the documentation i figured that I have to add \r, but this doesn't work:
Qt Code:
  1. QRegExp range( "[0-9]*[-][0-9]*[\r]");
To copy to clipboard, switch view to plain text mode 

Also, ideally, this should also work when I only give a single number.