本文整理汇总了C++中CNode::getContextMenuConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ CNode::getContextMenuConfig方法的具体用法?C++ CNode::getContextMenuConfig怎么用?C++ CNode::getContextMenuConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNode
的用法示例。
在下文中一共展示了CNode::getContextMenuConfig方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createNode
CNode* CConfiguration::createNode(QDomElement element)
{
Q3PtrList<CContextMenuConfig> contextNodes;
QString uniqueID;
QString displayName;
QString imageActive;
QString imageInactive;
int refreshTimeout = 0;
int positionX = 0;
int positionY = 0;
QDomNode currentNode = element.firstChild();
while(!currentNode.isNull()) {
if(QDomNode::ElementNode == currentNode.nodeType()) {
if(currentNode.toElement().tagName() == QString(g_UIDTag)) {
uniqueID = currentNode.toElement().text();
}
else if(currentNode.toElement().tagName() == QString(g_displayNameTag)) {
displayName = currentNode.toElement().text();
}
else if(currentNode.toElement().tagName() == QString(g_refreshTimeoutTag)) {
refreshTimeout = currentNode.toElement().text().toInt();
}
else if(currentNode.toElement().tagName() == QString(g_ActiveImageURLTag)) {
imageActive = currentNode.toElement().text();
}
else if(currentNode.toElement().tagName() == QString(g_InactiveImageURLTag)) {
imageInactive = currentNode.toElement().text();
}
else if(currentNode.toElement().tagName() == QString(g_NodePositionXTag)) {
positionX = currentNode.toElement().text().toInt();
if((positionX < 0) || (positionX > 100)) {
QMessageBox::critical(0, "Error!", "Wrong SizeX: " + positionX);
}
}
else if(currentNode.toElement().tagName() == QString(g_NodePositionYTag)) {
positionY = currentNode.toElement().text().toInt();
if((positionY < 0) || (positionY > 100)) {
QMessageBox::critical(0, "Error!", "Wrong SizeY: " + positionY);
}
}
else if(currentNode.toElement().tagName() == QString(g_ContextMenuEntryTag)) {
contextNodes.append(createContextMenuEntry(displayName, currentNode.toElement()));
}
else if(currentNode.toElement().tagName() == QString(g_ContextMenuSeparatorTag)) {
contextNodes.append(new CContextMenuConfig(m_CanvasWidget, "", "", ""));
}
else {
QMessageBox::critical(0, "Error!", "Found unknown tag in config file: " +
currentNode.toElement().tagName());
}
}
currentNode = currentNode.nextSibling();
}
CNode* node = new CNode(uniqueID, displayName,
imageActive, imageInactive,
positionX, positionY, refreshTimeout);
node->getContextMenuConfig() = contextNodes;
return node;
}