你可以把lineEdit里面的内容保存为字符串。lineEdit有个信号叫做textEdited,你可以做一个函数void copy(){ char show1[100] = { 0 }; strcpy(lineEdit->text().toUtf8().data(),show1);}然后连接:connect(lineEdit,SIGNAL(textEdited(QString)),this,SLOT(copy()));再想办法将字符串转化为数字。
200字范文,内容丰富有趣,生活中的好帮手!