From 172e74d96054ef8eeaa1942d96601aae979c9679 Mon Sep 17 00:00:00 2001 From: scienceasdf Date: Mon, 20 Jun 2016 18:34:36 +0800 Subject: [PATCH] Update widget.cpp --- widget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/widget.cpp b/widget.cpp index e83bb5f..34a4ed9 100644 --- a/widget.cpp +++ b/widget.cpp @@ -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;