本文整理汇总了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);
}
示例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;
}
}
示例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);
}