void Widget::on_pushButton_3_clicked() //载入数据
{
QFileDialog *fileDialog=new QFileDialog(this);
fileDialog->setWindowTitle(tr("open many days light data"));
fileDialog->setDirectory(".");
fileDialog->setFilter(tr("data Files(*.txt)"));
if(fileDialog->exec()==QDialog::Accepted)
{
QString path=fileDialog->selectedFiles()[0];
QFile file(path);
if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
return;
QTextStream in(&file);
dayLData.clear();
while(!in.atEnd())
{
QString strLine=in.readLine();
dayLData.append(strLine.toFloat());
}
file.close();
}
......
p3->setCorrds(1000,0,100,74000);
p3->setCurveData(3,adayLpCurData);
return;
}