Material: Use std::numeric_limits and std::numbers instead of defines
This commit is contained in:
@@ -42,7 +42,6 @@
|
||||
#ifdef _PreComp_
|
||||
|
||||
// standard
|
||||
#include <cfloat>
|
||||
#include <cmath>
|
||||
|
||||
// STL
|
||||
|
||||
@@ -125,7 +125,7 @@ QWidget* ArrayDelegate::createWidget(QWidget* parent, const QVariant& item) cons
|
||||
else if (_type == Materials::MaterialValue::Integer) {
|
||||
Gui::UIntSpinBox* spinner = new Gui::UIntSpinBox(parent);
|
||||
spinner->setMinimum(0);
|
||||
spinner->setMaximum(UINT_MAX);
|
||||
spinner->setMaximum(std::numeric_limits<unsigned>::max());
|
||||
spinner->setValue(item.toUInt());
|
||||
widget = spinner;
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ BaseDelegate::createWidget(QWidget* parent, const QVariant& item, const QModelIn
|
||||
if (type == Materials::MaterialValue::Integer) {
|
||||
auto spinner = new Gui::UIntSpinBox(parent);
|
||||
spinner->setMinimum(0);
|
||||
spinner->setMaximum(UINT_MAX);
|
||||
spinner->setMaximum(std::numeric_limits<unsigned>::max());
|
||||
spinner->setValue(item.toUInt());
|
||||
widget = spinner;
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ QWidget* MaterialDelegate::createWidget(QWidget* parent,
|
||||
if (type == Materials::MaterialValue::Integer) {
|
||||
auto spinner = new Gui::IntSpinBox(parent);
|
||||
spinner->setMinimum(0);
|
||||
spinner->setMaximum(INT_MAX);
|
||||
spinner->setMaximum(std::numeric_limits<int>::max());
|
||||
spinner->setValue(item.toInt());
|
||||
widget = spinner;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
#ifdef _PreComp_
|
||||
|
||||
// standard
|
||||
#include <cfloat>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user