Gui: Use std::numeric_limits and std::numbers instead of defines

This commit is contained in:
Benjamin Nauck
2025-03-27 18:59:58 +01:00
parent 3253f2c2de
commit b625e81a3e
33 changed files with 204 additions and 168 deletions

View File

@@ -905,7 +905,7 @@ void ParameterValue::onCreateUIntItem()
DlgInputDialogImp::UIntBox);
dlg.setWindowTitle(QObject::tr("New unsigned item"));
UIntSpinBox* edit = dlg.getUIntBox();
edit->setRange(0, UINT_MAX);
edit->setRange(0, std::numeric_limits<unsigned>::max());
if (dlg.exec() == QDialog::Accepted) {
QString value = edit->text();
unsigned long val = value.toULong(&ok);
@@ -1249,7 +1249,7 @@ void ParameterUInt::changeValue()
DlgInputDialogImp::UIntBox);
dlg.setWindowTitle(QObject::tr("Change value"));
UIntSpinBox* edit = dlg.getUIntBox();
edit->setRange(0, UINT_MAX);
edit->setRange(0, std::numeric_limits<unsigned>::max());
edit->setValue(text(2).toULong());
if (dlg.exec() == QDialog::Accepted) {
QString value = edit->text();