Hi again, I'm faced with the second application's crash.
Here is my code:
Qt Code:
  1. void DishManager::initPage1()
  2. {
  3. ui.p1FamilyComboBox->addItems(dishes->getFamilies());
  4. }
To copy to clipboard, switch view to plain text mode 
where p1FamilyComboBox is a instance of
Qt Code:
To copy to clipboard, switch view to plain text mode 
, and dishes is an instance of the following class Record.

Qt Code:
  1. const QStringList& Record::getDishNamesByFamily(const QString &family) const
  2. {
  3. QStringList names;
  4. for(int i = 0; i < dishes.size(); i++)
  5. {
  6. if(dishes[i].getFamily() == family)
  7. {
  8. names << dishes[i].getName(); //如果某菜谱属于此菜系,则加入其菜名
  9. }
  10. }
  11. return names;
  12. }
To copy to clipboard, switch view to plain text mode 
I think maybe it's due to the
Qt Code:
  1. const QStringList& Record::getDishNamesByFamily
To copy to clipboard, switch view to plain text mode 
Is there anything wrong with the returning value.
Thanks in advance!!