1.在Qt design 里拖动界面,一个linedit linedit2 pushbutton
2.实现的功能:在linedit 输入12 点击pushbutton 然后在linedit2中出现12000;
3.看代码
:
#include "lined.h"
lined::lined(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
connect(ui.pushButton,SIGNAL(clicked()),this,SLOT(ChangeTxt()));
}
lined::~lined()
{
}
void lined::ChangeTxt()
{
QString str1=ui.lineEdit->text();
num=str1.toDouble()*1000;
ui.lineEdit2->setText(QString::number(num));
}
---------------------
作者:耗子来啦
来源:CSDN
原文:https://blog.csdn.net/hguo11/article/details/51197883
版权声明:本文为博主原创文章,转载请附上博文链接!