本文整理汇总了C++中BrowserClass::select_in_browser方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserClass::select_in_browser方法的具体用法?C++ BrowserClass::select_in_browser怎么用?C++ BrowserClass::select_in_browser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrowserClass
的用法示例。
在下文中一共展示了BrowserClass::select_in_browser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddOperation
void QuickEdit::AddOperation()
{
QModelIndex current = ui->tvEditor->selectionModel()->currentIndex();
if(!current.isValid())
return;
current = current.sibling(current.row(), 0);
TreeItemInterface *itemAsInterface = static_cast<TreeItemInterface*>(current.internalPointer());
BrowserNode* currentNode = static_cast<BrowserNode*>(itemAsInterface->InternalPointer());
BrowserClass* classNode;
int newItemPosition = 0;
if(currentNode->TypeID() == TypeIdentifier<BrowserClass>::id())
{
classNode = static_cast<BrowserClass*>(currentNode);
newItemPosition = itemAsInterface->childCount();
}
else if(currentNode->TypeID() == TypeIdentifier<BrowserOperation>::id() && current.parent().isValid())
{
itemAsInterface = static_cast<TreeItemInterface*>(current.parent().internalPointer());
classNode = static_cast<BrowserClass*>(itemAsInterface->InternalPointer());
newItemPosition = current.row()+1;
current = current.parent();
}
else
return;
if(!classNode)
return;
BrowserOperation* newOperation = static_cast<BrowserOperation*>(classNode->addOperation());
classNode->move(newOperation, currentNode);
classNode->select_in_browser();
QModelIndex parentIndex;
TreeItemInterface* parent;
if(treeModel->parent(current).isValid())
{
parentIndex = treeModel->parent(current);
parentIndex = parentIndex.sibling(parentIndex.row(), 0);
parent = static_cast<TreeItemInterface*>(parentIndex.internalPointer());
}
else
parent = treeModel->RootItem();
int insertIndex = parent->GetIndexOfChild(itemAsInterface);
QSharedPointer<TreeItemInterface> sharedOfOperation = parent->GetChildren()[insertIndex];
if(!treeModel->insertRows(newItemPosition-1, 1, current))
return;
if(!current.isValid())
return;
QModelIndex newItem = treeModel->index(newItemPosition-1,0,current);
TreeItemInterface *newItemInterface = static_cast<TreeItemInterface*>(newItem.internalPointer());
TreeItem<BrowserNode>* newItemAsNode = static_cast<TreeItem<BrowserNode>*>(newItemInterface);
newItemAsNode->SetController(operationController);
newItemAsNode->SetParent(sharedOfOperation);
newItemAsNode->SetInternalData(newOperation);
}