Skip to content

Commit

Permalink
Update widget.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
scienceasdf authored Jun 20, 2016
1 parent da2e84e commit 172e74d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ void Widget::paintEvent(QPaintEvent* event)

void Widget::on_pushButton_2_clicked()
{
if ((ui->posText->text().toDouble()<0) || ui->posText_2->text().toDouble()<0)
if ((ui->posText->text().toDouble()<0 || ui->posText->text().toDouble()>beam1->leng) ||
ui->posText_2->text().toDouble()<0 || ui->posText_2->text().toDouble()>beam1->leng )
{
int ret=QMessageBox::information(this,"警告","非法位置输入",QMessageBox::Ok);
return;
Expand Down

0 comments on commit 172e74d

Please sign in to comment.