首页 > 代码库 > QLineEdit

QLineEdit

1. 使用数值给QLineEdit赋值

GlobalPSNR 是double类型

OutBPP是float类型

QString data = http://www.mamicode.com/QString::number(GlobalPSNR, ‘g‘, 6);
ui.textBrowser_PSN->setText(data);
data = http://www.mamicode.com/QString::number(OutputBPP, ‘g‘, 6);
ui.textBrowser_Pix->setText(data);
ui.textBrowser_Wav->setText("97M");

2. 使用QLineEdit给变量赋值

Channels = ui.lineEdit->text().toUShort();

 

QLineEdit