+ fix possible crash in some property editors
This commit is contained in:
@@ -670,12 +670,16 @@ QWidget* PropertyIntegerConstraintItem::createEditor(QWidget* parent, const QObj
|
||||
}
|
||||
|
||||
return sb;
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyIntegerConstraintItem::setEditorData(QWidget *editor, const QVariant& data) const
|
||||
{
|
||||
const App::PropertyIntegerConstraint* prop = static_cast
|
||||
<const App::PropertyIntegerConstraint*>(getFirstProperty());
|
||||
<const App::PropertyIntegerConstraint*>(getFirstProperty());
|
||||
|
||||
const App::PropertyIntegerConstraint::Constraints* c = 0;
|
||||
if (prop) {
|
||||
c = prop->getConstraints();
|
||||
}
|
||||
|
||||
QSpinBox *sb = qobject_cast<QSpinBox*>(editor);
|
||||
@@ -686,7 +690,7 @@ void PropertyIntegerConstraintItem::setEditorData(QWidget *editor, const QVarian
|
||||
}
|
||||
else {
|
||||
sb->setMinimum(INT_MIN);
|
||||
sb->setMaximum(INT_MAX);
|
||||
sb->setMaximum(INT_MAX);
|
||||
}
|
||||
sb->setValue(data.toInt());
|
||||
}
|
||||
@@ -869,7 +873,10 @@ void PropertyUnitConstraintItem::setEditorData(QWidget *editor, const QVariant&
|
||||
infield->selectAll();
|
||||
|
||||
const App::PropertyQuantityConstraint* prop = static_cast
|
||||
<const App::PropertyQuantityConstraint*>(getFirstProperty());
|
||||
<const App::PropertyQuantityConstraint*>(getFirstProperty());
|
||||
|
||||
const App::PropertyQuantityConstraint::Constraints* c = 0;
|
||||
if (prop) {
|
||||
c = prop->getConstraints();
|
||||
}
|
||||
|
||||
@@ -934,12 +941,16 @@ QWidget* PropertyFloatConstraintItem::createEditor(QWidget* parent, const QObjec
|
||||
|
||||
|
||||
return sb;
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyFloatConstraintItem::setEditorData(QWidget *editor, const QVariant& data) const
|
||||
{
|
||||
const App::PropertyFloatConstraint* prop = static_cast
|
||||
<const App::PropertyFloatConstraint*>(getFirstProperty());
|
||||
<const App::PropertyFloatConstraint*>(getFirstProperty());
|
||||
|
||||
const App::PropertyFloatConstraint::Constraints* c = 0;
|
||||
if (prop) {
|
||||
c = prop->getConstraints();
|
||||
}
|
||||
|
||||
QDoubleSpinBox *sb = qobject_cast<QDoubleSpinBox*>(editor);
|
||||
@@ -951,7 +962,7 @@ void PropertyFloatConstraintItem::setEditorData(QWidget *editor, const QVariant&
|
||||
else {
|
||||
sb->setMinimum((double)INT_MIN);
|
||||
sb->setMaximum((double)INT_MAX);
|
||||
sb->setSingleStep(0.1);
|
||||
sb->setSingleStep(0.1);
|
||||
}
|
||||
sb->setValue(data.toDouble());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user