i'm reading from b123.txt file
first i want to make a file selected station with corresponding depth values and selected parameters from UI.
Secondly, i want to show from that file min and max of depth values on ui. help me to solve the problem
regards
deck99
#include "profile.h"
#include "ui_profile.h"
#include<QTextStream>
#include<QFile>
int line3=1;
int l3,j1;
Profile
::Profile(QWidget *parent
) :ui(new Ui::Profile)
{
ui->setupUi(this);
ui->comboBox->clear();
return;
while(!in.atEnd())
{s=in.readLine();
if(line3==1)
{
l3=l.size();
for(int i=0;i<l3;i++)
{
a1[i]=q;
// out1<<a[i]<<"\t";
}
}
line3++;
}
in.seek(0);
line3=1;
for(j1=0;j1<l3;j1++)
{
if(a1[j1]=="Station")
{
break;
}
}
while(!in.atEnd())
{s=in.readLine();
if(line3!=1)
{
l3=l.size();
r.append(q);
}
line3++;
}
in.seek(0);
line3=1;
//min Depth
for(j1=0;j1<l3;j1++)
{
if(a1[j1]=="Depth")
{
break;
}
}
while(!in.atEnd())
{s=in.readLine();
if(line3!=1)
{
l3=l.size();
dep.append(q);
// out1<<a[i]<<"\t";
}
line3++;
}
dep.removeDuplicates();
dep.sort();
ui->lineEdit->setText(dep.takeFirst());
file.close();
r.removeDuplicates();
r.sort();
for(int k=0;k<r.size();k++)
{
ui->comboBox->addItem(r[k]);
}
for(j1=0;j1<l3;j1++)
{
if(a1[j1]=="Depth")
{
break;
}
}
for(int k=j1;k<l3;k++)
{
ui->comboBox_3->addItem(a1[k]);
}
}
#include "profile.h"
#include "ui_profile.h"
#include<QTextStream>
#include<QFile>
QString a1[50];
int line3=1;
int l3,j1;
QStringList r;
QStringList dep;
Profile::Profile(QWidget *parent) :
QDialog(parent),
ui(new Ui::Profile)
{
ui->setupUi(this);
ui->comboBox->clear();
QFile file("b123.txt");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return;
QTextStream in(&file);
QString s;
while(!in.atEnd())
{s=in.readLine();
if(line3==1)
{
QStringList l=s.split("\t");
l3=l.size();
for(int i=0;i<l3;i++)
{
QString q=l.at(i);
a1[i]=q;
// out1<<a[i]<<"\t";
}
}
line3++;
}
in.seek(0);
line3=1;
for(j1=0;j1<l3;j1++)
{
if(a1[j1]=="Station")
{
break;
}
}
while(!in.atEnd())
{s=in.readLine();
if(line3!=1)
{
QStringList l=s.split("\t");
l3=l.size();
QString q=l.at(j1);
r.append(q);
}
line3++;
}
in.seek(0);
line3=1;
//min Depth
for(j1=0;j1<l3;j1++)
{
if(a1[j1]=="Depth")
{
break;
}
}
while(!in.atEnd())
{s=in.readLine();
if(line3!=1)
{
QStringList l=s.split("\t");
l3=l.size();
QString q=l.at(j1);
dep.append(q);
// out1<<a[i]<<"\t";
}
line3++;
}
dep.removeDuplicates();
dep.sort();
ui->lineEdit->setText(dep.takeFirst());
file.close();
r.removeDuplicates();
r.sort();
for(int k=0;k<r.size();k++)
{
ui->comboBox->addItem(r[k]);
}
for(j1=0;j1<l3;j1++)
{
if(a1[j1]=="Depth")
{
break;
}
}
for(int k=j1;k<l3;k++)
{
ui->comboBox_3->addItem(a1[k]);
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks