本文整理汇总了C++中BrowserClass::contextual_name方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserClass::contextual_name方法的具体用法?C++ BrowserClass::contextual_name怎么用?C++ BrowserClass::contextual_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrowserClass
的用法示例。
在下文中一共展示了BrowserClass::contextual_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
//.........这里部分代码省略.........
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());
p.drawText(r, ::Qt::AlignHCenter + ::Qt::AlignTop,
cl->contextual_name(used_show_context_mode));
if (fp != 0)
draw_text(r, ::Qt::AlignHCenter + ::Qt::AlignTop,
cl->contextual_name(used_show_context_mode),
p.font(), fp);
}
p.setFont(the_canvas()->get_font(UmlNormalFont));
const QValueList<SlotAttr> & attributes =
((ClassInstanceData *) browser_node->get_data())->get_attributes();
if (!attributes.isEmpty()) {
r.setTop(r.top() + he + two);
p.drawLine(r.topLeft(), r.topRight());
if (fp != 0)
fprintf(fp, "\t<line stroke=\"black\" stroke-opacity=\"1\""
" x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" />\n",
r.left(), r.top(), r.right(), r.top());
r.setTop(r.top() + two);
r.setLeft(r.left() + (int) (4 * zoom));
QValueList<SlotAttr>::ConstIterator it = attributes.begin();
QString egal = " = ";
do {
QString s = (*it).att->get_name() + egal + (*it).value;
p.drawText(r, ::Qt::AlignTop, s);
if (fp != 0)
draw_text(r, ::Qt::AlignTop, s,
p.font(), fp);
r.setTop(r.top() + he);
++it;
} while (it != attributes.end());
}
if (fp != 0)
fputs("</g>\n", fp);
if (selected())
show_mark(p, rect());
}
}