Rows in list can't be more than count();
--HG-- branch : develop
This commit is contained in:
parent
cdeddbfa1e
commit
924af81eae
|
@ -340,11 +340,12 @@ void DialogDetail::ClickedReverse(bool checked)
|
||||||
*/
|
*/
|
||||||
void DialogDetail::ObjectChanged(int row)
|
void DialogDetail::ObjectChanged(int row)
|
||||||
{
|
{
|
||||||
if (ui.listWidget->count() == 0 || row == -1)
|
if (ui.listWidget->count() == 0 || row == -1 || row >= ui.listWidget->count())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const QListWidgetItem *item = ui.listWidget->item( row );
|
const QListWidgetItem *item = ui.listWidget->item( row );
|
||||||
|
SCASSERT(item != nullptr);
|
||||||
const VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
|
const VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
|
||||||
ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx()));
|
ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx()));
|
||||||
ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));
|
ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user