本文整理汇总了C++中BrowserNode::select_in_browser方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserNode::select_in_browser方法的具体用法?C++ BrowserNode::select_in_browser怎么用?C++ BrowserNode::select_in_browser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrowserNode
的用法示例。
在下文中一共展示了BrowserNode::select_in_browser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: menu_op
void CodChangeMsgDialog::menu_op()
{
QMenu m(0);
MenuFactory::addItem(m, tr("Choose"), -1);
m.addSeparator();
int index = list.indexOf(edoper->currentText().trimmed());
if (index != -1)
MenuFactory::addItem(m, tr("Select in browser"), 0);
BrowserNode * bn = BrowserView::selected_item();
if ((bn != 0) &&
(bn->get_type() == UmlOperation) &&
!bn->deletedp() &&
(opers.indexOf((OperationData *) bn->get_data()) != -1))
MenuFactory::addItem(m, tr("Choose operation selected in browser"), 1);
else
bn = 0;
if (cl != 0)
MenuFactory::addItem(m, tr("Create operation and choose it"), 2);
if ((index != -1) || (bn != 0) || (cl != 0)) {
QAction* retAction = m.exec(QCursor::pos());
if(retAction)
{
switch (retAction->data().toInt()) {
case 0:
opers[index]->get_browser_node()->select_in_browser();
break;
case 2:
bn = cl->add_operation();
if (bn == 0)
return;
bn->select_in_browser();
// no break
case 1: {
OperationData * od = (OperationData *) bn->get_data();
if ((index = opers.indexOf(od)) == -1) {
index = opers.count();
opers.append(od);
QString s = od->definition(TRUE, FALSE);
list.append(s);
edoper->addItem(s);
}
}
edoper->setCurrentIndex(index + 1);
}
}
}
}
示例2: menu_type
void ParameterDialog::menu_type()
{
QMenu m(0);
MenuFactory::addItem(m, tr("Choose"), -1);
m.addSeparator();
int index = list.indexOf(edtype->currentText().trimmed());
if (index != -1)
MenuFactory::addItem(m, tr("Select in browser"), 0);
BrowserNode * bn = 0;
if (! visit) {
bn = BrowserView::selected_item();
if ((bn != 0) && (bn->get_type() == UmlClass) && !bn->deletedp())
MenuFactory::addItem(m, tr("Choose class selected in browser"), 1);
else
bn = 0;
MenuFactory::addItem(m, tr("Create class and choose it"), 2);
}
if (!visit || (index != -1) || (bn != 0)) {
QAction* retAction = m.exec(QCursor::pos());
if(retAction)
{
switch (retAction->data().toInt()) {
case 0:
nodes.at(index)->select_in_browser();
break;
case 2:
bn = BrowserClass::add_class(FALSE, view);
if (bn == 0)
return;
bn->select_in_browser();
// no break
case 1: {
QString s = bn->full_name(TRUE);
if ((index = list.indexOf(s)) == -1) {
// new class, may be created through an other dialog
index = 0;
QStringList::Iterator iter = list.begin();
QStringList::Iterator iter_end = list.end();
while ((iter != iter_end) && (*iter < s)) {
++iter;
index += 1;
}
nodes.insert((unsigned) index, bn);
list.insert(iter, s);
edtype->insertItem(index + offset,s);
}
}
edtype->setCurrentIndex(index + offset);
break;
default:
break;
}
}
}
}
示例3: menu_type
void ActivityObjectDialog::menu_type()
{
Q3PopupMenu m(0);
m.insertItem(TR("Choose"), -1);
m.insertSeparator();
int index = list.findIndex(edtype->currentText().stripWhiteSpace());
if (index != -1)
m.insertItem(TR("Select in browser"), 0);
BrowserNode * bn = 0;
if (! visit) {
bn = BrowserView::selected_item();
if ((bn != 0) && (bn->get_type() == UmlClass) && !bn->deletedp())
m.insertItem(TR("Choose class selected in browser"), 1);
else
bn = 0;
m.insertItem(TR("Create class and choose it"), 2);
}
if (!visit || (index != -1) || (bn != 0)) {
switch (m.exec(QCursor::pos())) {
case 0:
nodes.at(index)->select_in_browser();
break;
case 2:
bn = BrowserClass::add_class(FALSE, view);
if (bn == 0)
return;
bn->select_in_browser();
// no break
case 1: {
QString s = bn->full_name(TRUE);
if ((index = list.findIndex(s)) == -1) {
// new class, may be created through an other dialog
QStringList::Iterator iter = list.begin();
QStringList::Iterator iter_end = list.end();
index = 0;
while ((iter != iter_end) && (*iter < s)) {
++iter;
index += 1;
}
nodes.insert((unsigned) index, bn);
list.insert(iter, s);
edtype->insertItem(s, index + offset);
}
}
edtype->setCurrentItem(index + offset);
break;
default:
break;
}
}
}