thats what I thought.
the logic is that usually I have a function that looks something like this.
void Present::present() const
{
cout<<"To: "<<this->to<<" Is: "<<this->is;
}
void Present::present() const
{
cout<<"To: "<<this->to<<" Is: "<<this->is;
}
To copy to clipboard, switch view to plain text mode
and In my other class with the array I have this function
void Hadler::show()const
{
for(int i=0;i<this->nrOfPresents;i++)
{
this->prsnt[i]->present();
}
}
void Hadler::show()const
{
for(int i=0;i<this->nrOfPresents;i++)
{
this->prsnt[i]->present();
}
}
To copy to clipboard, switch view to plain text mode
so lets say I call show() in main it will go through my array and cout all the info in it.
What I want to do is something similar.
Now I have a function that gets the content from the array, converts everything to one big string and then returns that and then it presents it in my listwidget, after that I does the same thing again until all items are presented in the listwidget.
thats why I have the following function cos I want the QString to be return as long as i is less then nrOfDiets.
{
for(int i=0;i< this->nrOfDiets;i++)
{
return this->dh[i]->toQString();
}
}
QString DH::toQString()const
{
for(int i=0;i< this->nrOfDiets;i++)
{
return this->dh[i]->toQString();
}
}
To copy to clipboard, switch view to plain text mode
Hope you understand
Bookmarks