本文整理汇总了C++中BaseNode::getText方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseNode::getText方法的具体用法?C++ BaseNode::getText怎么用?C++ BaseNode::getText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseNode
的用法示例。
在下文中一共展示了BaseNode::getText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: modelChanged
/*! Slot. Sets the second point in a new connection node.
This function actually creates the node using the NodeFactory.
It doesn't create the node if the first or second point is invalid.
*/
void Document::createConnectionPoint2(const QPoint &point) {
// Create the object only if a valid first object was found
int index;
// creates a temp object node for self connectors
BaseNode *tempnode;
tempnode = NodeFactory::getInstance()->produce(newObjectID);
if (firstConnectionIndex != -1) {
index = getIndexAt(point);
// And the second index was found
if (((index != -1) &&
(nodes.at(index)->isConnector() == false)) &&
index != firstConnectionIndex) {
// produce the object
BaseNode *newNode;
newNode = NodeFactory::getInstance()->produce(newObjectID);
// now connect the connection to both objects, and connect the
// objects to the connections
newNode->addConnectedNode(nodes.at(firstConnectionIndex));
newNode->addConnectedNode(nodes.at(index));
nodes.at(firstConnectionIndex)->addConnectedNode(newNode);
nodes.at(index)->addConnectedNode(newNode);
addNodeToList(newNode);
ordering.append(nodes.size()-1);
nodes.at(index)->setSelectedForConnectionPoint(false);
setModified(true);
emit modelChanged();
}
// Self connectors
// And the second index was found
else if ((((index != -1) &&
(nodes.at(index)->isConnector() == false)) &&
(index == firstConnectionIndex) &&
(tempnode->getText() == "Collaboration Self Line")) ||
((index != -1) && (nodes.at(index)->isConnector() == false)
&&(index == firstConnectionIndex) && (tempnode->getText() == "State Self Line"))) {
// produce the object
BaseNode *newNode;
newNode = NodeFactory::getInstance()->produce(newObjectID);
// now connect the connection to both objects, and connect the
// objects to the connections
newNode->addConnectedNode(nodes.at(firstConnectionIndex));
newNode->addConnectedNode(nodes.at(index));
nodes.at(firstConnectionIndex)->addConnectedNode(newNode);
nodes.at(index)->addConnectedNode(newNode);
addNodeToList(newNode);
ordering.append(nodes.size()-1);
nodes.at(index)->setSelectedForConnectionPoint(false);
setModified(true);
emit modelChanged();
}
// end of self connect
else {
QMessageBox::information(0, "pUML", "No second object selected");
}
}
if (firstConnectionIndex != -1) {
nodes.at(firstConnectionIndex)->setSelectedForConnectionPoint(false);
}
}