本文整理汇总了C++中BrowserClass::get_data方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserClass::get_data方法的具体用法?C++ BrowserClass::get_data怎么用?C++ BrowserClass::get_data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrowserClass
的用法示例。
在下文中一共展示了BrowserClass::get_data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BasicData
ClassData::ClassData(const ClassData * model, BrowserNode * bn)
: BasicData(model), constraint(model->constraint)
{
browser_node = bn;
if ((nformals = model->nformals) == 0)
formals = 0;
else {
FormalParamData * mformals = model->formals;
formals = new FormalParamData[nformals];
for (int index = 0; index != nformals; index += 1)
formals[index] = mformals[index];
}
Q3PtrListIterator<ActualParamData> it(model->actuals);
BrowserClass * cl = 0;
for (; it.current(); ++it) {
ActualParamData * actual = new ActualParamData(*(it.current()));
if (actual->get_class() != cl) {
cl = actual->get_class();
connect(cl->get_data(), SIGNAL(changed()),
this, SLOT(update_actuals()));
connect(cl->get_data(), SIGNAL(deleted()),
this, SLOT(update_actuals()));
}
actuals.append(actual);
}
set_base_type(model->base_type);
is_deleted = FALSE;
bodies_read = FALSE;
bodies_modified = FALSE;
is_abstract = model->is_abstract;
is_active = model->is_active;
cpp_external = model->cpp_external;
java_external = model->java_external;
java_final = model->java_final;
php_external = model->php_external;
php_final = model->php_final;
python_2_2 = model->python_2_2;
python_external = model->python_external;
idl_external = model->idl_external;
idl_local = model->idl_local;
idl_custom = model->idl_custom;
uml_visibility = model->uml_visibility;
cpp_visibility = model->cpp_visibility;
cpp_decl = model->cpp_decl;
java_decl = model->java_decl;
java_annotation = model->java_annotation;
php_decl = model->php_decl;
python_decl = model->python_decl;
set_switch_type(model->switch_type);
idl_decl = model->idl_decl;
connect(this, SIGNAL(changed()), this, SLOT(update_actuals()));
}
示例2: read
void ClassData::read(char * & st, char * & k) {
if (!strcmp(k, "abstract")) {
is_abstract = TRUE;
k = read_keyword(st);
}
else
is_abstract = FALSE;
if (!strcmp(k, "active")) {
is_active = TRUE;
k = read_keyword(st);
}
else
is_active = FALSE;
if (!strcmp(k, "visibility")) {
uml_visibility = ::visibility(read_keyword(st));
k = read_keyword(st);
}
else {
// old non nested class
uml_visibility = UmlPackageVisibility;
}
if (!strcmp(k, "stereotype")) {
set_stereotype(read_string(st));
if (!strcmp(stereotype, "typedef")) {
AType t;
t.read(st, "base_type", "explicit_base_type");
set_base_type(t);
}
k = read_keyword(st);
}
unsigned n, i;
if (!strcmp(k, "nformals")) {
n = read_unsigned(st);
set_n_formalparams(n);
for (i = 0; i != n; i += 1)
formals[i].read(st);
k = read_keyword(st);
}
else
set_n_formalparams(0);
if (!strcmp(k, "nactuals")) {
n = read_unsigned(st);
BrowserClass * cl = 0;
for (i = 0; i != n; i += 1) {
ActualParamData * actual = ActualParamData::read(st);
actuals.append(actual);
if (actual->get_class() != cl) {
cl = actual->get_class();
connect(cl->get_data(), SIGNAL(deleted()),
this, SLOT(update_actuals()));
connect(cl->get_data(), SIGNAL(changed()),
this, SLOT(update_actuals()));
}
}
k = read_keyword(st);
}
else {
n = 0;
actuals.clear();
}
if (!strcmp(k, "constraint")) {
constraint = read_string(st);
k = read_keyword(st);
}
else
constraint = QString::null;
if (!strcmp(k, "cpp_external")) {
cpp_external = TRUE;
k = read_keyword(st);
}
else
cpp_external = FALSE;
if (!strcmp(k, "cpp_visibility")) {
cpp_visibility = ::visibility(read_keyword(st));
k = read_keyword(st);
}
else
cpp_visibility = UmlDefaultVisibility;
if (!strcmp(k, "cpp_decl")) {
cpp_decl = read_string(st);
//.........这里部分代码省略.........
示例3: draw
void OdClassInstCanvas::draw(QPainter & p) {
if (visible()) {
QRect r = rect();
QFontMetrics fm(the_canvas()->get_font(UmlNormalFont));
QColor bckgrnd = p.backgroundColor();
double zoom = the_canvas()->zoom();
p.setBackgroundMode((used_color == UmlTransparent) ? ::Qt::TransparentMode : ::Qt::OpaqueMode);
QColor co = color(used_color);
FILE * fp = svg();
if (fp != 0)
fputs("<g>\n", fp);
if (used_color != UmlTransparent) {
const int shadow = the_canvas()->shadow();
if (shadow != 0) {
r.setRight(r.right() - shadow);
r.setBottom(r.bottom() - shadow);
p.fillRect (r.right(), r.top() + shadow,
shadow, r.height() - 1,
::Qt::darkGray);
p.fillRect (r.left() + shadow, r.bottom(),
r.width() - 1, shadow,
::Qt::darkGray);
if (fp != 0) {
fprintf(fp, "\t<rect fill=\"#%06x\" stroke=\"none\" stroke-opacity=\"1\""
" x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" />\n",
::Qt::darkGray.rgb()&0xffffff,
r.right(), r.top() + shadow, shadow - 1, r.height() - 1 - 1);
fprintf(fp, "\t<rect fill=\"#%06x\" stroke=\"none\" stroke-opacity=\"1\""
" x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" />\n",
::Qt::darkGray.rgb()&0xffffff,
r.left() + shadow, r.bottom(), r.width() - 1 - 1, shadow - 1);
}
}
}
p.setBackgroundColor(co);
if (used_color != UmlTransparent)
p.fillRect(r, co);
if (fp != 0)
fprintf(fp, "\t<rect fill=\"%s\" stroke=\"black\" stroke-width=\"1\" stroke-opacity=\"1\""
" x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" />\n",
svg_color(used_color),
r.x(), r.y(), r.width() - 1, r.height() - 1);
p.drawRect(r);
BrowserClass * cl =
((ClassInstanceData *) browser_node->get_data())->get_class();
if (((ClassData *) cl->get_data())->get_is_active()) {
const int eight = (int) (8 * zoom);
r.setLeft(r.left() + eight);
r.setRight(r.right() - eight);
p.drawLine(r.topLeft(), r.bottomLeft());
p.drawLine(r.topRight(), r.bottomRight());
if (fp != 0)
fprintf(fp,
"\t<line stroke=\"black\" stroke-opacity=\"1\""
" x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" />\n"
"\t<line stroke=\"black\" stroke-opacity=\"1\""
" x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" />\n",
r.left(), r.top(), r.left(), r.bottom(),
r.right(), r.top(), r.right(), r.bottom());
}
const int two = (int) (2 * zoom);
int he = fm.height() + two;
p.setFont(the_canvas()->get_font(UmlNormalUnderlinedFont));
r.setTop(r.top() + two);
if (horiz) {
p.drawText(r, ::Qt::AlignHCenter + ::Qt::AlignTop,
full_name());
if (fp != 0)
draw_text(r, ::Qt::AlignHCenter + ::Qt::AlignTop,
full_name(),
p.font(), fp);
}
else {
p.drawText(r, ::Qt::AlignHCenter + ::Qt::AlignTop,
get_name() + ":");
if (fp != 0)
draw_text(r, ::Qt::AlignHCenter + ::Qt::AlignTop,
get_name() + ":",
p.font(), fp);
r.setTop(r.top() + fm.height());
//.........这里部分代码省略.........