本文整理汇总了C++中Patient::addProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ Patient::addProperty方法的具体用法?C++ Patient::addProperty怎么用?C++ Patient::addProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Patient
的用法示例。
在下文中一共展示了Patient::addProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillPatientFromXMLFile
/**
* \author Jules Gorny - ALCoV team, ISIT, UMR 6284 UdA – CNRS
**/
void fillPatientFromXMLFile(Patient &pat, QString xmlPath, Ui::MainWindow *ui)
{
addProgressMessage(ui,"Retrieving data from database...\n", Qt::black, "", false);
QString tab = " ";
QFile f(xmlPath);
if(!f.open(QIODevice::ReadOnly))
addProgressMessage(ui,"Can't read the existing database.\n", Qt::red, "", true);
QTextStream in(&f);
Image* img = NULL;
Study* study = NULL;
Series* series = NULL;
Extract* extr = NULL;
File* file = NULL;
while(!in.atEnd())
{
QString line = in.readLine();
if( line.endsWith(">") && !line.contains("</") )
{
//Image
if( line.startsWith(tab + "<") )
{
if( line.contains("<Property") )
{
QString tag, tagName, value;
int start = line.indexOf("tag=")+5, end = line.indexOf("\"", start);
tag = line.mid(start, end-start);
start = line.indexOf("tagName=")+9; end = line.indexOf("\"", start);
tagName = line.mid(start, end-start);
start = line.indexOf("value=")+7; end = line.indexOf("\"", start);
value = line.mid(start, end-start);
Property prop(tag, tagName, value);
pat.addProperty(prop);
}
else
{
line = line.trimmed();
int start = line.indexOf("<")+1, end = line.lastIndexOf(">");
QString imgType = line.mid(start, end-start);
img = new Image(imgType);
pat.addImage(img);
}
}
//Study
else if( line.startsWith(tab + tab + "<") )
{
line = line.trimmed();
study = new Study();
int start = line.indexOf("\"")+1, end = line.lastIndexOf("\"");
QString descr = line.mid(start, end-start);
study->setDescription(descr);
img->addStudy(study);
}
//Series
else if( line.startsWith(tab + tab + tab + "<") )
{
if( line.contains("<Property") )
{
QString tag, tagName, value;
int start = line.indexOf("tag=")+5, end = line.indexOf("\"", start);
tag = line.mid(start, end-start);
start = line.indexOf("tagName=")+9; end = line.indexOf("\"", start);
tagName = line.mid(start, end-start);
start = line.indexOf("value=")+7; end = line.indexOf("\"", start);
value = line.mid(start, end-start);
Property prop(tag, tagName, value);
study->addProperty(prop);
}
else if( line.contains("<Series") )
{
line = line.trimmed();
series = new Series();
int start = line.indexOf("\"")+1, end = line.lastIndexOf("\"");
QString descr = line.mid(start, end-start);
series->setDescription(descr);
study->addSeries(series);
}
}
//Extract
else if( line.startsWith(tab + tab + tab + tab + "<") )
{
if( line.contains("<Property") )
{
QString tag, tagName, value;
int start = line.indexOf("tag=")+5, end = line.indexOf("\"", start);
tag = line.mid(start, end-start);
start = line.indexOf("tagName=")+9; end = line.indexOf("\"", start);
tagName = line.mid(start, end-start);
start = line.indexOf("value=")+7; end = line.indexOf("\"", start);
value = line.mid(start, end-start);
Property prop(tag, tagName, value);
series->addProperty(prop);
}
else if( line.contains("<Extract") )
//.........这里部分代码省略.........