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


C++ BrowserNodeList::full_names方法代码示例

本文整理汇总了C++中BrowserNodeList::full_names方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserNodeList::full_names方法的具体用法?C++ BrowserNodeList::full_names怎么用?C++ BrowserNodeList::full_names使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BrowserNodeList的用法示例。


在下文中一共展示了BrowserNodeList::full_names方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: set_type

void AttributeData::set_type(const QString &value)
{
    QStringList list;
    BrowserNodeList nodes;
    BrowserClass::instances(nodes);
    nodes.full_names(list);

    AType t;
    if (!value.isEmpty())
    {
        int rank = list.indexOf(value);

        if (rank != -1)
            t.type = (BrowserClass *) nodes.at(rank);
        else
            t.explicit_type = value;
    }
    set_type(t);
}
开发者ID:gilbertoca,项目名称:douml,代码行数:19,代码来源:AttributeData.cpp

示例2: enter_child_name

bool BrowserNode::enter_child_name(QString & r, const QString & msg, UmlCode type,
				   BrowserNodeList & nodes,
				   BrowserNode ** old, bool allow_spaces,
				   bool allow_empty, bool existing) {
  
  if (existing && nodes.isEmpty()) {
    msg_warning(TR("Error"), TR("nothing available"));
    return FALSE;
  }
  
  QStringList list;
  
  nodes.full_names(list);
  list.prepend(QString::null);
  
  *old = 0;
  
  for (;;) {
    BooL ok = FALSE;
    
    r = (list.count() == 1)
      ? MyInputDialog::getText("Uml", msg, QString::null, ok)
      : MyInputDialog::getText("Uml", msg, list, QString::null, existing, ok);
    
    if (! ok)
      return FALSE;
    
    if (!r.isEmpty()) {
      int index = list.findIndex(r);
      
      if (index != -1) {
	*old = nodes.at(index - 1);
	return TRUE;
      }
    }
    if (wrong_child_name(r, type, allow_spaces, allow_empty))
      msg_critical(TR("Error"), r + "\n\n" + TR("illegal name or already used"));
    else
      return TRUE;
  }
}
开发者ID:SciBoy,项目名称:douml,代码行数:41,代码来源:BrowserNode.cpp

示例3: TypeDelegateSetup

void QuickEdit::TypeDelegateSetup()
{
    GenericDelegate* delegate = new GenericDelegate(ui->tvEditor, false);

    delegate->widgetCreator = [](QWidget* parent)
    {
        BrowserNodeList result;
        QStringList classes;
        BrowserClass::instances(result);
        result.full_names(classes);

        QStringList basics = GenerationSettings::basic_types();
        classes+=basics;
        QCompleter* completer = new QCompleter(classes, parent);
        completer->setCaseSensitivity(Qt::CaseSensitive);

        QComboBox* box = new QComboBox(parent);
        QStringListModel* model = new QStringListModel;
        model->setStringList(classes);
        box->setModel(model);
        box->setEditable(true);
        box->setCompleter(completer);
        return box;
    };

    delegate->dataAccessor = [](QWidget* editor, const QModelIndex& index)
    {
        QString value = index.model()->data(index, Qt::EditRole).toString();
        QComboBox* box = static_cast<QComboBox*>(editor);
        box->setCurrentText(value);
    };

    delegate->dataSetter = [](QWidget* editor, QAbstractItemModel* model, const QModelIndex& index)
    {
        QComboBox* box = static_cast<QComboBox*>(editor);
        QString value = box->currentText();
        model->setData(index, value, Qt::EditRole);
    };

    ui->tvEditor->setItemDelegateForColumn(columns.indexOf("type"), delegate);
}
开发者ID:ErickCastellanos,项目名称:douml,代码行数:41,代码来源:quickedit.cpp


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