对于使用此代码时的QList,我认为:
QList<Job> jobsList;
jobsList = job.getJobs(650, 654);
QListIterator<Job> iterJobs(jobsList);
while(iterJobs.hasNext())
{
job = iterJobs.next();
qDebug() << "IdJob " << job.jobId();
qDebug() << "jobType " << job.jobType();
}
并且一切都很好,但我怎么能做出预告呢?
非常感谢你
答案 0 :(得分:3)
foreach (Job const& job, jobsList) {
qDebug() << "IdJob " << job.jobId();
qDebug() << "jobType " << job.jobType();
}
答案 1 :(得分:1)
foreach (Job job, jobsList)
{
qDebug() << "IdJob " << job.jobId();
qDebug() << "jobType " << job.jobType();
}