本文整理汇总了C++中BrowserNode::get_name方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserNode::get_name方法的具体用法?C++ BrowserNode::get_name怎么用?C++ BrowserNode::get_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrowserNode
的用法示例。
在下文中一共展示了BrowserNode::get_name方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PickPreviousSibling
void EdgeMenuDialogBase::PickPreviousSibling()
{
bool continueSearch = true;
BrowserNode * previousNode = 0;
BrowserNode * originalNode = GetCurrentNode();
int originalDepth = originalNode->depth();
BrowserNode * currentNode = originalNode;
while (continueSearch)
{
QLOG_INFO() << "CurrentNode is: " << currentNode->get_name();
previousNode = dynamic_cast<BrowserNode *>(currentNode->itemBelow());
QLOG_INFO() << "Nodename is: " << previousNode->get_name() << " " << previousNode->depth();
if (!previousNode)
break;
QLOG_INFO() << "Previous Node is: "<< previousNode->get_name();
int previousDepth = previousNode->depth();
bool sameType = originalNode->get_stype() == previousNode->get_stype();
QLOG_INFO() << "PREVIOUS: " << "Origin level : " << originalDepth;
QLOG_INFO() << "PREVIOUS: " << "Current level : " << previousDepth;
bool sameLevel = originalDepth == previousDepth;
if (sameLevel && sameType)
continueSearch = false;
currentNode = previousNode;
}
if (previousNode == 0)
return;
SaveData();
FillGuiElements(previousNode);
}
示例2: search
void BrowserNodeList::search(BrowserNode * bn, UmlCode k, const QString & s,
bool cs, bool even_deleted, bool for_name,
bool for_stereotype)
{
Q3ListViewItem * child;
for (child = bn->firstChild(); child != 0; child = child->nextSibling()) {
if (even_deleted || !((BrowserNode *) child)->deletedp()) {
BrowserNode * ch = (BrowserNode *) child;
if (((k == UmlCodeSup) ||
((k == UmlRelations)
? IsaRelation(ch->get_type())
: (ch->get_type() == k))) &&
(s.isEmpty() ||
(QString((for_name)
? ch->get_name()
: ((for_stereotype) ? ch->get_stereotype()
: ch->get_comment()))
.find(s, 0, cs) != -1)))
append((BrowserNode *) child);
search((BrowserNode *) child, k, s, cs, even_deleted,
for_name, for_stereotype);
}
}
}
示例3: accept
void BasicDialog::accept() {
if (!check_edits(edits) || !kvtable->check_unique())
return;
BrowserNode * bn = data->get_browser_node();
if (edname != 0) {
QString s = edname->text().stripWhiteSpace();
if ((s != bn->get_name()) &&
((BrowserNode *) bn->parent())->wrong_child_name(s, bn->get_type(),
bn->allow_spaces(),
bn->allow_empty())) {
msg_critical(TR("Error"), edname->text() + TR("\n\nillegal name or already used"));
return;
}
else
bn->set_name(s);
}
bool newst = data->set_stereotype(fromUnicode(edstereotype->currentText().stripWhiteSpace()));
bn->set_comment(comment->text());
UmlWindow::update_comment_if_needed(bn);
kvtable->update(bn);
ProfiledStereotypes::modified(bn, newst);
bn->package_modified();
data->modified();
Q3TabDialog::accept();
}
示例4: add_annotation
void AnnotationDialog::add_annotation()
{
const int ndefault =
sizeof(DefaultAnnotations) / sizeof(*DefaultAnnotations);
int added_index = cb->currentItem();
QString added;
if (added_index < ndefault)
added = DefaultAnnotations[added_index];
else {
BrowserNode * cl = annotations.at(added_index - ndefault);
added = cl->get_name();
// have member ?
int n = 0;
QString first_name;
Q3ListViewItem * child;
for (child = cl->firstChild(); child != 0; child = child->nextSibling()) {
if (!((BrowserNode *) child)->deletedp()) {
switch (((BrowserNode *) child)->get_type()) {
case UmlClass:
case UmlExtraMember:
break;
default:
switch (++n) {
case 1:
first_name = ((BrowserNode *) child)->get_name();
break;
case 2:
added += "(" + first_name + QString("=, ")
+ ((BrowserNode *) child)->get_name() + "=";
break;
default:
added += QString(", ") + ((BrowserNode *) child)->get_name() + QString("=");
}
}
}
}
switch (n) {
case 0:
break;
case 1:
added += "()";
break;
default:
added += ")";
}
}
e->insert("@" + added + "\n");
e->setFocus();
}
示例5:
QList<std::function<bool (TreeItemInterface *)> > QuickEdit::CreateCheckList()
{
QList<std::function<bool (TreeItemInterface *)> > result;
if(!ui->leSearch->text().trimmed().isEmpty())
{
QString value = ui->leSearch->text();
std::function<bool(TreeItemInterface*)> addressFilterFunc = [value](TreeItemInterface* iface)
{
BrowserNode* data = static_cast<BrowserNode*>(iface->InternalPointer());
QString name = data->get_name();
bool match = data->get_name().contains(value, Qt::CaseInsensitive);
return match;
};
result.append(addressFilterFunc);
}
return result;
}
示例6: PickNextSibling
void EdgeMenuDialogBase::PickNextSibling()
{
bool continueSearch = true;
BrowserNode * nextNode = 0;
BrowserNode * originalNode = GetCurrentNode();
BrowserNode * currentNode = originalNode;
while (continueSearch)
{
nextNode = dynamic_cast<BrowserNode *>(currentNode->itemAbove());
QLOG_INFO() << "CurrentNode is: "<< currentNode->get_name();
if (!nextNode)
break;
QLOG_INFO() << "NEXT: " << nextNode->get_name() << " " << nextNode->depth();
QLOG_INFO() << "NextNode is: "<< nextNode->get_name();
bool sameLevel = originalNode->depth() == nextNode->depth();
bool sameType = originalNode->get_stype() == nextNode->get_stype();
QLOG_INFO() << originalNode->get_stype();
QLOG_INFO() << nextNode->get_stype();
// QLOG_INFO() << "NEXT: " << "Origin level : " << originalNode->depth();
// QLOG_INFO() << "NEXT: " << "Current level : " << nextNode->depth();
if (sameLevel && sameType)
continueSearch = false;
currentNode = nextNode;
}
if (nextNode == 0)
return;
SaveData();
FillGuiElements(nextNode);
}
示例7: accept
void ActivityDialog::accept()
{
if (!check_edits(edits) || !kvtable->check_unique())
return;
BrowserNode * bn = activity->browser_node;
QString s;
s = edname->text().trimmed();
if ((s != bn->get_name()) &&
((BrowserNode *) bn->parent())->wrong_child_name(s, UmlActivity,
bn->allow_spaces(),
bn->allow_empty()))
msg_critical(tr("Error"), s + tr("\n\nillegal name or already used"));
else {
bn->set_name(s);
bool newst = activity->set_stereotype(fromUnicode(edstereotype->currentText().trimmed()));
int index = list.indexOf(edspecification->currentText().trimmed());
activity->set_specification((index != -1)
? (BrowserOperation *) opers.at(index)
: 0);
activity->read_only = readonly_cb->isChecked();
activity->single_execution = singlexec_cb->isChecked();
activity->is_active = active_cb->isChecked();
uml.accept(activity->uml_condition);
cpp.accept(activity->cpp_condition);
java.accept(activity->java_condition);
bn->set_comment(comment->text());
UmlWindow::update_comment_if_needed(bn);
activity->constraint = constraint->trimmedText();
kvtable->updateNodeFromThis(bn);
ProfiledStereotypes::modified(bn, newst);
bn->modified();
bn->package_modified();
activity->modified();
TabDialog::accept();
}
}
示例8: add_decorator
void DecoratorDialog::add_decorator() {
const int ndefault =
sizeof(DefaultDecorators)/sizeof(*DefaultDecorators);
int added_index = cb->currentItem();
QString added;
if (added_index < ndefault)
added = DefaultDecorators[added_index];
else {
BrowserNode * cl = decorators.at(added_index - ndefault);
added = cl->get_name();
}
e->insert("@" + added + "\n");
e->setFocus();
}
示例9: accept
void TransitionDialog::accept()
{
if (!check_edits(edits) || !kvtable->check_unique())
return;
BrowserNode * bn = rel->browser_node;
QString s;
s = edname->text().trimmed();
if (s.isEmpty())
s = "<transition>";
if ((s != bn->get_name()) &&
((BrowserNode *) bn->parent())->wrong_child_name(s, UmlTransition,
bn->allow_spaces(),
bn->allow_empty()))
msg_critical(tr("Error"), s + tr("\n\nillegal name or already used"));
else {
bn->set_name(s);
bool newst = rel->set_stereotype(fromUnicode(edstereotype->currentText().trimmed()));
if (internal_cb != 0)
rel->set_internal(internal_cb->isChecked());
uml.accept(rel->uml);
cpp.accept(rel->cpp);
java.accept(rel->java);
bn->set_comment(comment->text());
UmlWindow::update_comment_if_needed(bn);
kvtable->updateNodeFromThis(bn);
ProfiledStereotypes::modified(bn, newst);
bn->modified();
bn->package_modified();
rel->modified();
TabDialog::accept();
}
}
示例10: accept
void ExpansionRegionDialog::accept()
{
if (!check_edits(edits) || !kvtable->check_unique())
return;
BrowserNode * bn = data->get_browser_node();
if (edname != 0) {
QString s = edname->text().trimmed();
if ((s != bn->get_name()) &&
((BrowserNode *) bn->parent())->wrong_child_name(s, bn->get_type(),
bn->allow_spaces(),
bn->allow_empty())) {
msg_critical(TR("Error"), edname->text() + TR("\n\nillegal name or already used"));
return;
}
else
bn->set_name(s);
}
data->must_isolate = must_isolate_cb->isChecked();
data->mode = expansion_mode_kind(edmode->currentText().toLatin1().constData());
bool newst = data->set_stereotype(fromUnicode(edstereotype->currentText().trimmed()));
bn->set_comment(comment->text());
UmlWindow::update_comment_if_needed(bn);
kvtable->updateNodeFromThis(bn);
ProfiledStereotypes::modified(bn, newst);
bn->package_modified();
data->modified();
TabDialog::accept();
}
示例11: accept
void FlowDialog::accept()
{
if (!check_edits(edits) || !kvtable->check_unique())
return;
BrowserNode * bn = flow->browser_node;
QString s;
s = edname->text().stripWhiteSpace();
if ((s != bn->get_name()) &&
((BrowserNode *) bn->parent())->wrong_child_name(s, UmlFlow,
bn->allow_spaces(),
bn->allow_empty()))
msg_critical(TR("Error"), s + TR("\n\nillegal name or already used"));
else {
bn->set_name(s);
bool newst = flow->set_stereotype(fromUnicode(edstereotype->currentText().stripWhiteSpace()));
uml.accept(flow->uml);
cpp.accept(flow->cpp);
java.accept(flow->java);
bn->set_comment(comment->text());
UmlWindow::update_comment_if_needed(bn);
kvtable->updateNodeFromThis(bn);
ProfiledStereotypes::modified(bn, newst);
bn->modified();
bn->package_modified();
flow->modified();
Q3TabDialog::accept();
}
}
示例12: TabDialog
StateDialog::StateDialog(StateData * d)
: TabDialog(0, 0, FALSE, Qt::WA_DeleteOnClose), state(d)
{
d->browser_node->edit_start();
if (d->browser_node->is_writable()) {
setOkButton(tr("OK"));
setCancelButton(tr("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(tr("Close"));
}
setWindowTitle(tr("State dialog"));
visit = !hasOkButton();
BrowserNode * bn = state->browser_node;
GridBox * grid;
//
// general tab
//
grid = new GridBox(2, this);
umltab = grid;
grid->setMargin(5);
grid->setSpacing(5);
grid->addWidget(new QLabel(tr("name : "), grid));
grid->addWidget(edname = new LineEdit(bn->get_name(), grid));
edname->setReadOnly(visit);
grid->addWidget(new QLabel(tr("stereotype : "), grid));
grid->addWidget(edstereotype = new QComboBox( grid));
edstereotype->setEditable(!visit);
edstereotype->addItem(toUnicode(state->get_stereotype()));
if (!visit) {
edstereotype->addItems(BrowserState::default_stereotypes());
edstereotype->addItems(ProfiledStereotypes::defaults(UmlState));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentIndex(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorizontalPolicy(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
SmallPushButton* sButton;
connect(sButton = new SmallPushButton(tr("specification :"), grid), SIGNAL(clicked()),
this, SLOT(menu_specification()));
grid->addWidget(sButton);
grid->addWidget(edspecification = new QComboBox(grid));
edspecification->setSizePolicy(sp);
if (visit) {
if (state->get_specification() == 0)
edspecification->addItem("");
else
edspecification->addItem(state->get_specification()->full_name(TRUE));
}
else {
edspecification->addItem("");
edspecification->setAutoCompletion(completion());
BrowserOperation::instances(opers);
opers.full_names(speclist);
edspecification->addItems(speclist);
edspecification->setCurrentIndex((state->get_specification() == 0)
? 0
: opers.indexOf(state->get_specification()) + 1);
}
switch (((BrowserNode *) bn->parent())->get_type()) {
case UmlState:
case UmlRegion:
if ((state->get_reference() != 0) || (bn->firstChild() == 0)) {
connect(sButton = new SmallPushButton(tr("reference :"), grid), SIGNAL(clicked()),
this, SLOT(menu_reference()));
grid->addWidget(sButton);
grid->addWidget(edreference = new QComboBox(grid));
edreference->setSizePolicy(sp);
if (visit) {
if (state->get_reference() == 0)
edreference->addItem("");
else
edreference->addItem(state->get_reference()->full_name(TRUE));
}
else {
edreference->addItem("");
edreference->setAutoCompletion(completion());
if (((BrowserState *) bn)->can_reference()) {
BrowserState::instances(states, TRUE);
QMutableListIterator<BrowserNode *> it(states);
while (it.hasNext()) {
BrowserState *state = (BrowserState *)it.next();
if (!((BrowserState *) bn)->can_reference(state) ||
//.........这里部分代码省略.........
示例13: QLabel
BasicDialog::BasicDialog(BasicData * nd, QString s,
const QStringList & default_stereotypes,
QSize & sz, bool unnamed)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), data(nd), previous_size(sz) {
nd->get_browser_node()->edit_start();
if (nd->get_browser_node()->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString::null);
setCancelButton(TR("Close"));
}
setCaption(TR(s + " dialog"));
bool visit = !hasOkButton();
// general tab
BrowserNode * bn = data->get_browser_node();
Q3Grid * grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
if (unnamed)
edname = 0;
else {
new QLabel(TR("name : "), grid);
edname = new LineEdit(bn->get_name(), grid);
edname->setReadOnly(visit);
}
new QLabel(TR("stereotype : "), grid);
edstereotype = new Q3ComboBox(!visit, grid);
edstereotype->insertItem(toUnicode(data->get_stereotype()));
if (! visit) {
edstereotype->insertStringList(default_stereotypes);
edstereotype->insertStringList(ProfiledStereotypes::defaults(bn->get_type()));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentItem(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorData(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
Q3VBox * vtab = new Q3VBox(grid);
new QLabel(TR("description :"), vtab);
if (! visit)
connect(new SmallPushButton(TR("Editor"), vtab), SIGNAL(clicked()),
this, SLOT(edit_description()));
comment = new MultiLineEdit(grid);
comment->setReadOnly(visit);
comment->setText(bn->get_comment());
QFont font = comment->font();
if (! hasCodec())
font.setFamily("Courier");
font.setFixedPitch(TRUE);
comment->setFont(font);
addTab(grid, "Uml");
// USER : list key - value
grid = new Q3Grid(2, this);
grid->setMargin(5);
grid->setSpacing(5);
kvtable = new KeyValuesTable(bn, grid, visit);
addTab(grid, TR("Properties"));
open_dialog(this);
}
示例14: TabDialog
TransitionDialog::TransitionDialog(TransitionData * r)
: TabDialog(0, 0, true, Qt::WA_DeleteOnClose), rel(r)
{
r->browser_node->edit_start();
if (r->browser_node->is_writable()) {
setOkButton(tr("OK"));
setCancelButton(tr("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(tr("Close"));
}
setWindowTitle(tr("Transition dialog"));
visit = !hasOkButton();
BrowserNode * bn = rel->browser_node;
GridBox * grid;
//
// general tab
//
grid = new GridBox(2, this);
umltab = grid;
grid->setMargin(5);
grid->setSpacing(5);
grid->addWidget(new QLabel(tr("name : "), grid));
grid->addWidget(edname = new LineEdit(bn->get_name(), grid));
edname->setReadOnly(visit);
grid->addWidget(new QLabel(tr("stereotype : "), grid));
grid->addWidget(edstereotype = new QComboBox(grid));
edstereotype->setEditable(!visit);
edstereotype->addItem(toUnicode(rel->get_stereotype()));
if (!visit) {
//edstereotype->addItems(rel->get_start()->default_stereotypes(type));
edstereotype->setAutoCompletion(completion());
edstereotype->addItems(ProfiledStereotypes::defaults(UmlTransition));
}
edstereotype->setCurrentIndex(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorizontalPolicy(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
if (r->get_start_node() != r->get_end_node())
internal_cb = 0;
else {
grid->addWidget(new QLabel(grid));
grid->addWidget(internal_cb = new QCheckBox(tr("internal"), grid));
internal_cb->setChecked(r->internal());
}
VVBox * vtab;
grid->addWidget(vtab = new VVBox(grid));
vtab->addWidget(new QLabel(tr("description :"), vtab));
if (! visit)
{
SmallPushButton* sButton;
connect(sButton = new SmallPushButton(tr("Editor"), vtab), SIGNAL(clicked()),
this, SLOT(edit_description()));
vtab->addWidget(sButton);
}
grid->addWidget(comment = new MultiLineEdit(grid));
comment->setReadOnly(visit);
comment->setText(bn->get_comment());
//comment->setFont(font);
addTab(grid, "Uml");
// UML / OCL
init_tab(ocltab, uml, rel->uml, "Ocl", SLOT(edit_uml_trigger()),
SLOT(edit_uml_guard()), SLOT(edit_uml_expr()), TRUE);
// CPP
init_tab(cppTab, cpp, rel->cpp, "C++", SLOT(edit_cpp_trigger()),
SLOT(edit_cpp_guard()), SLOT(edit_cpp_expr()),
GenerationSettings::cpp_get_default_defs());
// Java
init_tab(javatab, java, rel->java, "Java", SLOT(edit_java_trigger()),
SLOT(edit_java_guard()), SLOT(edit_java_expr()),
GenerationSettings::java_get_default_defs());
// USER : list key - value
grid = new GridBox(2, this);
grid->setMargin(5);
grid->setSpacing(5);
grid->addWidget(kvtable = new KeyValuesTable(bn, grid, visit));
addTab(grid, tr("Properties"));
//
//.........这里部分代码省略.........
示例15: TabDialog
ClassInstanceDialog::ClassInstanceDialog(ClassInstanceData * i)
: TabDialog(0, "class instance dialog", FALSE, Qt::WA_DeleteOnClose),
inst(i), atbl(0), rtbl(0)
{
setWindowTitle(tr("Class instance dialog"));
BrowserNode * bn = inst->get_browser_node();
bn->edit_start();
if (bn->is_writable()) {
setOkButton(tr("OK"));
setCancelButton(tr("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(tr("Close"));
}
visit = !hasOkButton();
GridBox * grid;
// general tab
grid = new GridBox(2, this);
grid->setMargin(5);
grid->setSpacing(5);
grid->addWidget(new QLabel(tr("name : "), grid));
grid->addWidget(edname = new LineEdit(bn->get_name(), grid));
if (visit)
edname->setReadOnly(TRUE);
grid->addWidget(new QLabel(tr("stereotype :"), grid));
grid->addWidget(edstereotype = new QComboBox( grid));
edstereotype->setEditable(!visit);
edstereotype->addItem(toUnicode(bn->get_stereotype()));
if (! visit) {
edstereotype->addItems(ProfiledStereotypes::defaults(UmlClassInstance));
edstereotype->setAutoCompletion(completion());
}
SmallPushButton * b;
grid->addWidget(b = new SmallPushButton(tr("class :"), grid));
connect(b, SIGNAL(clicked()), this, SLOT(menu_class()));
grid->addWidget(edtype = new QComboBox(grid));
if (visit) {
edtype->addItem(inst->get_class()->full_name());
nodes.append(inst->get_class());
}
else {
BrowserClass::instances(nodes);
nodes.full_names(list);
edtype->addItems(list);
edtype->setCurrentIndex(nodes.indexOf(inst->get_class()));
connect(edtype, SIGNAL(activated(int)), this, SLOT(type_changed(int)));
}
if (visit)
cl_container = 0;
else {
cl_container = (BrowserNode *) bn->parent();
if ((cl_container != 0) && !cl_container->is_writable())
cl_container = 0;
}
VVBox * vtab;
grid->addWidget(vtab = new VVBox(grid));
vtab->addWidget(new QLabel(tr("description :"), vtab));
if (! visit) {
connect(b =new SmallPushButton(tr("Editor"), vtab), SIGNAL(clicked()),
this, SLOT(edit_description()));
vtab->addWidget(b);
}
grid->addWidget(comment = new MultiLineEdit(grid));
comment->setReadOnly(visit);
comment->setText(bn->get_comment());
QFont font = comment->font();
if (! hasCodec())
font.setFamily("Courier");
font.setFixedPitch(TRUE);
comment->setFont(font);
addTab(grid, "Uml");
// attributes tab
//.........这里部分代码省略.........