本文整理汇总了C++中QRectF::unite方法的典型用法代码示例。如果您正苦于以下问题:C++ QRectF::unite方法的具体用法?C++ QRectF::unite怎么用?C++ QRectF::unite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QRectF
的用法示例。
在下文中一共展示了QRectF::unite方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: boundsOfChildren
QRectF boundsOfChildren( QGraphicsItem const * qgi )
{
typedef QList<QGraphicsItem*> QGIL;
QGIL ch( qboard::childItems(qgi) );
QRectF r;
for( QGIL::const_iterator it = ch.begin();
ch.end() != it; ++it )
{
QGraphicsItem const * x = *it;
QRectF r2( x->mapToParent(x->pos()), x->boundingRect().size() );
r = r.unite( r2 );
}
if(1 && ! r.isNull() ) qDebug() << "bounds of children ="<<r;
return r;
}
示例2:
QRectF k9CanvasSprite::boundingRect() const {
QRectF r;
if (m_pixmap){
r=m_pixmap->boundingRect();
r.moveTopLeft(m_pixmap->pos());
}
if (m_text) {
QRectF r2=m_text->boundingRect();
r2.moveTopLeft(m_text->pos());
r=r.unite(r2);
}
r.adjust(-m_selsize,-m_selsize,m_selsize,m_selsize);
return r;
}
示例3: _updateDataBounds
void MavPlot::_updateDataBounds () {
bool first = true;
QRectF allrect;
for (dataplotmap::const_iterator s = _series.begin(); s != _series.end(); ++s) {
const QWT_ABSTRACT_SERIESITEM * const that = s->second;
// FIXME: now we can only do curves
const QwtPlotCurve * const q = dynamic_cast<const QwtPlotCurve * const>(that);
if (q) {
QRectF rect = q->boundingRect();
if (first) {
first=false;
allrect = rect;
} else {
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
allrect = allrect.united(rect);
#else
allrect = allrect.unite(rect);
#endif
}
}
}
_databounds = allrect;
}