当前位置: 首页>>代码示例>>C++>>正文


C++ BrowserNode::select_in_browser方法代码示例

本文整理汇总了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);
        }
        }
    }
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:62,代码来源:CodChangeMsgDialog.cpp

示例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;
            }
        }
    }
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:72,代码来源:ParameterDialog.cpp

示例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;
        }
    }
}
开发者ID:jeremysalwen,项目名称:douml,代码行数:69,代码来源:ActivityObjectDialog.cpp


注:本文中的BrowserNode::select_in_browser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。