本文整理汇总了C++中BrowserNode::get_comment方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserNode::get_comment方法的具体用法?C++ BrowserNode::get_comment怎么用?C++ BrowserNode::get_comment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrowserNode
的用法示例。
在下文中一共展示了BrowserNode::get_comment方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
}
示例2: 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);
}
示例3: 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"));
//
//.........这里部分代码省略.........
示例4: 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
//.........这里部分代码省略.........
示例5: TabDialog
ExpansionRegionDialog::ExpansionRegionDialog(ExpansionRegionData * nd)
: TabDialog(0, 0, FALSE, Qt::WA_DeleteOnClose), data(nd)
{
nd->browser_node->edit_start();
if (nd->browser_node->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
setWindowTitle(TR("Expansion Region dialog"));
bool visit = !hasOkButton();
// general tab
BrowserNode * bn = data->get_browser_node();
GridBox * 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(data->get_stereotype()));
if (! visit) {
edstereotype->addItems(BrowserExpansionRegion::default_stereotypes());
edstereotype->addItems(ProfiledStereotypes::defaults(UmlExpansionRegion));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentIndex(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorizontalPolicy(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
HHBox * htab;
grid->addWidget(new QLabel(TR("mode :"), grid));
grid->addWidget(htab = new HHBox(grid));
htab->addWidget(edmode = new QComboBox(htab));
UmlExpansionKind m = data->get_mode();
edmode->addItem(stringify(m));
if (! visit) {
if (m != UmlParallel)
edmode->addItem(stringify(UmlParallel));
if (m != UmlIterative)
edmode->addItem(stringify(UmlIterative));
if (m != UmlStream)
edmode->addItem(stringify(UmlStream));
}
htab->addWidget(new QLabel(" ", htab));
htab->addWidget(must_isolate_cb = new QCheckBox(TR("must isolate"), htab));
if (data->must_isolate)
must_isolate_cb->setChecked(TRUE);
must_isolate_cb->setDisabled(visit);
htab->addWidget(new QLabel("", htab));
VVBox * vtab;
grid->addWidget(vtab = new VVBox(grid));
vtab->addWidget(new QLabel(TR("description :"), vtab));
SmallPushButton* b;
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);
//.........这里部分代码省略.........
示例6: BButtonGroup
//.........这里部分代码省略.........
else
edspecification->addItem(activity->get_specification()->full_name(TRUE));
}
else {
edspecification->addItem("");
edspecification->setAutoCompletion(completion());
BrowserOperation::instances(opers);
opers.full_names(list);
edspecification->addItems(list);
edspecification->setCurrentIndex((activity->get_specification() == 0)
? 0
: opers.indexOf(activity->get_specification()) + 1);
}
grid->addWidget(new QLabel(grid));
BButtonGroup * bg;
grid->addWidget(bg =
new BButtonGroup(3, Qt::Horizontal, QString(), grid));
bg->addWidget(readonly_cb = new QCheckBox(tr("read only"), bg));
if (activity->read_only)
readonly_cb->setChecked(TRUE);
readonly_cb->setDisabled(visit);
bg->addWidget(singlexec_cb = new QCheckBox(tr("single execution"), bg));
if (activity->single_execution)
singlexec_cb->setChecked(TRUE);
singlexec_cb->setDisabled(visit);
bg->addWidget(active_cb = new QCheckBox(tr("active"), bg));
if (activity->is_active)
active_cb->setChecked(TRUE);
active_cb->setDisabled(visit);
VVBox * vtab;
grid->addWidget(vtab = new VVBox(grid));
vtab->addWidget(new QLabel(tr("description :"), vtab));
if (! visit)
{
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);
grid->addWidget(vtab = new VVBox(grid));
vtab->addWidget(new QLabel(tr("constraint :"), vtab));
if (! visit) {
connect(sButton = new SmallPushButton(tr("Editor"), vtab), SIGNAL(clicked()),
this, SLOT(edit_constraint()));
vtab->addWidget(sButton);
}
grid->addWidget(constraint = new MultiLineEdit(grid));
constraint->setReadOnly(visit);
constraint->setText(activity->constraint);
//constraint->setFont(font);
addTab(grid, "Uml");
// UML / OCL
init_tab(uml, activity->uml_condition, "Ocl", TRUE);
// CPP
init_tab(cpp, activity->cpp_condition, "C++",
GenerationSettings::cpp_get_default_defs());
// Java
init_tab(java, activity->java_condition, "Java",
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"));
//
connect(this, SIGNAL(currentChanged(QWidget *)),
this, SLOT(change_tabs(QWidget *)));
open_dialog(this);
}
示例7: QLabel
ActivityPartitionDialog::ActivityPartitionDialog(ActivityPartitionData * d)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), data(d)
{
d->browser_node->edit_start();
if (d->browser_node->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
setCaption(TR("Activity Partition dialog"));
bool visit = !hasOkButton();
// general tab
BrowserNode * bn = data->get_browser_node();
Q3Grid * grid = new Q3Grid(2, this);
umltab = grid;
grid->setMargin(5);
grid->setSpacing(5);
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(BrowserActivityPartition::default_stereotypes());
edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlActivityPartition));
edstereotype->setAutoCompletion(completion());
}
edstereotype->setCurrentItem(0);
QSizePolicy sp = edstereotype->sizePolicy();
sp.setHorData(QSizePolicy::Expanding);
edstereotype->setSizePolicy(sp);
connect(new SmallPushButton(TR("represents :"), grid), SIGNAL(clicked()),
this, SLOT(menu_represents()));
edrepresents = new Q3ComboBox(FALSE, grid);
if ((data->represents != 0) && !data->represents->deletedp()) {
represented = data->represents;
edrepresents->insertItem(*(data->represents->pixmap(0)),
data->represents->full_name(TRUE));
}
else {
represented = 0;
edrepresents->insertItem("");
}
if (! visit)
edrepresents->insertItem("");
edrepresents->setCurrentItem(0);
edrepresents->setSizePolicy(sp);
Q3HBox * htab;
new QLabel(grid);
htab = new Q3HBox(grid);
new QLabel(" ", htab);
dimension_cb = new QCheckBox(TR("is dimension"), htab);
if (data->is_dimension)
dimension_cb->setChecked(TRUE);
dimension_cb->setDisabled(visit);
new QLabel("", htab);
external_cb = new QCheckBox(TR("is external"), htab);
if (data->is_external)
external_cb->setChecked(TRUE);
external_cb->setDisabled(visit);
new QLabel("", htab);
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");
//.........这里部分代码省略.........
示例8: QLabel
FlowDialog::FlowDialog(FlowData * d)
: Q3TabDialog(0, 0, FALSE, Qt::WDestructiveClose), flow(d)
{
d->browser_node->edit_start();
if (d->browser_node->is_writable()) {
setOkButton(TR("OK"));
setCancelButton(TR("Cancel"));
}
else {
setOkButton(QString());
setCancelButton(TR("Close"));
}
setCaption(TR("Flow dialog"));
visit = !hasOkButton();
BrowserNode * bn = flow->browser_node;
Q3Grid * grid;
//
// general tab
//
grid = new Q3Grid(2, this);
umltab = grid;
grid->setMargin(5);
grid->setSpacing(5);
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(flow->get_stereotype()));
if (!visit) {
edstereotype->insertStringList(BrowserFlow::default_stereotypes());
edstereotype->insertStringList(ProfiledStereotypes::defaults(UmlFlow));
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());
addTab(grid, "Uml");
// UML / OCL
init_tab(uml, flow->uml, "Ocl", SLOT(edit_uml_guard()),
SLOT(edit_uml_selection()), SLOT(edit_uml_transformation()),
TRUE);
// CPP
init_tab(cpp, flow->cpp, "C++", SLOT(edit_cpp_guard()),
SLOT(edit_cpp_selection()), SLOT(edit_cpp_transformation()),
GenerationSettings::cpp_get_default_defs());
// Java
init_tab(java, flow->java, "Java", SLOT(edit_java_guard()),
SLOT(edit_java_selection()), SLOT(edit_java_transformation()),
GenerationSettings::java_get_default_defs());
// 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"));
//
connect(this, SIGNAL(currentChanged(QWidget *)),
this, SLOT(change_tabs(QWidget *)));
open_dialog(this);
}