Thanks d_stranz for pointing those things out.
I do have a code for deleting the file instances
delete file; file = 0;
delete file; file = 0;
To copy to clipboard, switch view to plain text mode
after I'm done with the cases.
something like
case 8:
{ ListofValues.append(line.section(',', 8-i, 8-i));
ui->lcdNumber->display(ListofValues[i]);
break;
}
}//switch
}//for
}//if
delete file;
file = 0;
abc->deleteLater();//added after your comment
abc = 0; // added after your comment
}
case 8:
{ ListofValues.append(line.section(',', 8-i, 8-i));
ui->lcdNumber->display(ListofValues[i]);
break;
}
}//switch
}//for
}//if
delete file;
file = 0;
abc->deleteLater();//added after your comment
abc = 0; // added after your comment
}
To copy to clipboard, switch view to plain text mode
I also tried to instantiate Qfile in the constructor but it would give me a SEG FAULT pointing to getCurrent()
file->open(QIODevice::ReadWrite);
To copy to clipboard, switch view to plain text mode
what do you mean to connect the abc again to the same SLOT?
something like this?
void myProgram::getValue()
{
myFile
= new QFile (filename
);
abc = qnetworkaccessmanager.get(QNetworkRequest(url));
connect(abc, SIGNAL(readyRead()), this, SLOT(readValue()));
connect(abc, SIGNAL(readyRead()), this, SLOT(readValue()));
}
void myProgram::getValue()
{
myFile = new QFile (filename);
abc = qnetworkaccessmanager.get(QNetworkRequest(url));
connect(abc, SIGNAL(readyRead()), this, SLOT(readValue()));
connect(abc, SIGNAL(readyRead()), this, SLOT(readValue()));
file->open(QIODevice::ReadWrite);
}
To copy to clipboard, switch view to plain text mode
Last but not least, the code in the for-switch is to put the values 9-0 into a list of the same size. ex:
for (int i = 0; i < numberSize(); i++)
{
switch(i)
{
case 0:
{ ListofValues.append(line.section(',', 8-i, 8-i));
ui->lcdNumber->display(ListofValues[i]);
break;
}
//=====pseudo code explanation
for i= 0;
then 8-i // gets the ninth number in my file {1,2,3,4,5,6,7,8,9}
ListofValues[i]// index 0 = 9
ui->display(ListofValues[i])// display number 9 in the GUI
for i=1;
then 8-i //get the eighth number
ListofValues[i] // = 8
ui->display(ListofValues[i])// display number 8 in the GUI
for i=2;
8-i//gets the seventh and so on.
//======
for (int i = 0; i < numberSize(); i++)
{
switch(i)
{
case 0:
{ ListofValues.append(line.section(',', 8-i, 8-i));
ui->lcdNumber->display(ListofValues[i]);
break;
}
//=====pseudo code explanation
for i= 0;
then 8-i // gets the ninth number in my file {1,2,3,4,5,6,7,8,9}
ListofValues[i]// index 0 = 9
ui->display(ListofValues[i])// display number 9 in the GUI
for i=1;
then 8-i //get the eighth number
ListofValues[i] // = 8
ui->display(ListofValues[i])// display number 8 in the GUI
for i=2;
8-i//gets the seventh and so on.
//======
To copy to clipboard, switch view to plain text mode
Bookmarks