Skip to content

Commit

Permalink
TableView3D: Entering non-numbers in the table now results in an erro…
Browse files Browse the repository at this point in the history
…r message
  • Loading branch information
malcom2073 committed Aug 3, 2014
1 parent 1e787ad commit b3812fb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/src/tableview3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,5 +1156,14 @@ TableView3D::~TableView3D()
}
void TableView3D::itemChangeRequest(int row,int column,QString text)
{
setValue(row,column,text.toDouble());

bool ok = false;
double newval = text.toDouble(&ok);
if (!ok)
{
QLOG_ERROR() << "Attempted to enter a number into table that wasn't a number!";
QMessageBox::information(0,"Error",text + " is not a number.'");
return;
}
setValue(row,column,newval);
}

0 comments on commit b3812fb

Please sign in to comment.