本文整理汇总了C++中BrowserNode::edit_start方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserNode::edit_start方法的具体用法?C++ BrowserNode::edit_start怎么用?C++ BrowserNode::edit_start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrowserNode
的用法示例。
在下文中一共展示了BrowserNode::edit_start方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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
//.........这里部分代码省略.........