本文整理汇总了C++中CNode::getUniqueID方法的典型用法代码示例。如果您正苦于以下问题:C++ CNode::getUniqueID方法的具体用法?C++ CNode::getUniqueID怎么用?C++ CNode::getUniqueID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNode
的用法示例。
在下文中一共展示了CNode::getUniqueID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doc
CConfiguration::CConfiguration(QWidget* canvasWidget,
const QString& configFile)
: m_CanvasWidget(canvasWidget),
m_DisplaySizeX(0),
m_DisplaySizeY(0)
{
m_Nodes.setAutoDelete(true);
QDomDocument doc("ScenarioSetup");
QFile file(configFile);
if(!file.open(QIODevice::ReadOnly)) {
throw ELoadFileException();
}
QString errorMessage;
int errorLine;
if(!doc.setContent(&file , true , &errorMessage, &errorLine)) {
file.close();
throw EXMLSyntaxException(errorMessage, errorLine);
}
file.close();
QDomNode currentNode = doc.documentElement().firstChild();
while(!currentNode.isNull()) {
if(QDomNode::ElementNode == currentNode.nodeType()) {
if(currentNode.toElement().tagName() == QString(g_RefreshTimeTag)) {
m_RefreshTime = currentNode.toElement().text().toInt();
}
else if(currentNode.toElement().tagName() == QString(g_ListenPortTag)) {
m_ListenPort = currentNode.toElement().text().toInt();
}
else if(currentNode.toElement().tagName() == QString(g_ResolutionXTag)) {
m_DisplaySizeX = currentNode.toElement().text().toInt();
}
else if(currentNode.toElement().tagName() == QString(g_ResolutionYTag)) {
m_DisplaySizeY = currentNode.toElement().text().toInt();
}
else if(currentNode.toElement().tagName() == QString(g_ProtocolColorTag)) {
QDomAttr Attribute = currentNode.toElement().attributeNode(QString(g_ProtocolColorIDTag));
if(!Attribute.isNull()) {
m_ColorMap[Attribute.value().toInt()] = currentNode.toElement().text();
}
}
else if(currentNode.toElement().tagName() == QString(g_BackgroundImageTag)) {
m_BackgroundImageName = currentNode.toElement().text();
}
else if(currentNode.toElement().tagName() == QString(g_CaptionTag)) {
m_Caption = currentNode.toElement().text();
}
else if((currentNode.toElement().tagName() == QString(g_NodeTag)) ||
(currentNode.toElement().tagName() == QString(g_RSPNodeTag))) {
CNode* node = createNode(currentNode.toElement());
m_Nodes.append(node);
m_NodesMap[node->getUniqueID()] = node;
}
else {
QMessageBox::critical(0, "Error!", "Found unknown tag in config file: " +
currentNode.toElement().tagName());
}
}
currentNode = currentNode.nextSibling();
}
m_NetworkListener = new CNetworkListener(m_ListenPort, m_NodesMap);
}