本文整理汇总了C++中InlineFlowBox::lastChild方法的典型用法代码示例。如果您正苦于以下问题:C++ InlineFlowBox::lastChild方法的具体用法?C++ InlineFlowBox::lastChild怎么用?C++ InlineFlowBox::lastChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InlineFlowBox
的用法示例。
在下文中一共展示了InlineFlowBox::lastChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: collectHorizontalBoxCoordinates
/**
* Traverses the horizontal inline boxes and appends the point coordinates to
* the given array.
* @param box inline box
* @param pointArray array collecting coordinates
* @param bottom \c true, collect bottom coordinates, \c false, collect top
* coordinates.
* @param limit lower limit that an y-coordinate must at least reach. Note
* that limit designates the highest y-coordinate for \c bottom, and
* the lowest for !\c bottom.
*/
static void collectHorizontalBoxCoordinates(InlineBox *box, QValueVector< QPoint > &pointArray, bool bottom, int offset, int limit = -500000)
{
// kdDebug(6000) << "collectHorizontalBoxCoordinates: " << endl;
offset = bottom ? offset : -offset;
int y = box->yPos() + bottom * box->height() + offset;
if(limit != -500000 && (bottom ? y < limit : y > limit))
y = limit;
int x = box->xPos() + bottom * box->width() + offset;
QPoint newPnt(x, y);
// Add intersection point if point-array not empty.
if(!pointArray.isEmpty())
{
QPoint lastPnt = pointArray.back();
QPoint insPnt(newPnt.x(), lastPnt.y());
if(offset && ((bottom && lastPnt.y() > y) || (!bottom && lastPnt.y() < y)))
{
insPnt.rx() = lastPnt.x();
insPnt.ry() = y;
}
// kdDebug(6040) << "left: " << lastPnt << " == " << insPnt << ": " << (insPnt == lastPnt) << endl;
appendPoint(pointArray, insPnt);
}
// Insert starting point of box
appendPoint(pointArray, newPnt);
newPnt.rx() += (bottom ? -box->width() : box->width()) - 2 * offset;
if(box->isInlineFlowBox())
{
InlineFlowBox *flowBox = static_cast< InlineFlowBox * >(box);
for(InlineBox *b = bottom ? flowBox->lastChild() : flowBox->firstChild(); b; b = bottom ? b->prevOnLine() : b->nextOnLine())
{
// Don't let boxes smaller than this flow box' height influence
// the vertical position of the outline if they have a different
// x-coordinate
int l2;
if(b->xPos() != box->xPos() && b->xPos() + b->width() != box->xPos() + box->width())
l2 = y;
else
l2 = limit;
collectHorizontalBoxCoordinates(b, pointArray, bottom, kAbs(offset), l2);
}
// Add intersection point if flow box contained any children
if(flowBox->firstChild())
{
QPoint lastPnt = pointArray.back();
QPoint insPnt(lastPnt.x(), newPnt.y());
// kdDebug(6040) << "right: " << lastPnt << " == " << insPnt << ": " << (insPnt == lastPnt) << endl;
appendPoint(pointArray, insPnt);
}
}
// Insert ending point of box
appendPoint(pointArray, newPnt);
// kdDebug(6000) << "collectHorizontalBoxCoordinates: " << "ende" << endl;
}