Reputation: 13
I am learning Qt and C++ and I am starting to use the QInputDialog and QMessageBox. The official Qt Documentation states the following as the default QInputDialog parameters:
double QInputDialog::getDouble ( QWidget * parent, const QString & title, const QString & label, double value = 0, double min = -2147483647, double max = 2147483647, int decimals = 1, bool * ok = 0, Qt::WindowFlags flags = 0 )
If, say, I want to change the number of decimal places that the user can input, I would have to change "int decimals = 1". Is there a shorthand way of changing this while keeping the min and max as their default values or would have to manually put in -214... and 214...?
Upvotes: 1
Views: 345
Reputation: 62651
C++ doesn't allow you to choose which parameters to specify and which to leave at default values. So, unfortunately, your call will have to include at least all the parameters until decimals
.
Upvotes: 2