I need to restrict the inputs on one of my qlineEdit to a range between 2 numbers. The following code works fine for this.
QRegExp range( "[0-9]*[-][0-9]*");

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.

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:
QRegExp range( "[0-9]*[-][0-9]*[\r]");

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