本文整理汇总了C++中Answer::setBasicInfoId方法的典型用法代码示例。如果您正苦于以下问题:C++ Answer::setBasicInfoId方法的具体用法?C++ Answer::setBasicInfoId怎么用?C++ Answer::setBasicInfoId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Answer
的用法示例。
在下文中一共展示了Answer::setBasicInfoId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAnswerInfo
void getAnswerInfo()
{
QFile filename("Answer_Info.txt");
int j=1;
if(!filename.open(QIODevice::ReadOnly | QIODevice::Text))
{
//QMessageBox::critical(NULL, QObject::tr("提示"), QObject::tr("文件不存在,无法打开文件"));
//create the file
}
else
{
int id,prise;
QString line,sid,answerid,answertime,answerinfo,answerprise;
QTextStream in(&filename);
while(!in.atEnd())
{
line = in.readLine().replace(QString("\n"),QString(""));
if(j%5 == 1)
{
sid = line;
id = sid.toInt();
Answersubmit.setBasicInfoId(id);
//UserId.push_back(id);
}
else if(j%5 == 2)
{
answerid=line;
Answersubmit.setCreatUserId(answerid);
}
else if(j%5 == 3)
{
answertime=line;
Answersubmit.setCreatTime(answertime);
}
else if(j%5 == 4)
{
answerprise = line;
prise = answerprise.toInt();
Answersubmit.setPraiseNum(prise);
}
else
{
answerinfo = line;
Answersubmit.setBasicContent(answerinfo);
SumAnswerList.push_back(Answersubmit);
SumQuestionList[Answersubmit.getBasicInfoId()].addAnswer(SumAnswerList.size()-1);
}
j++;
}
filename.close();
}
}