本文整理汇总了C++中QPointArray::boundingRect方法的典型用法代码示例。如果您正苦于以下问题:C++ QPointArray::boundingRect方法的具体用法?C++ QPointArray::boundingRect怎么用?C++ QPointArray::boundingRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPointArray
的用法示例。
在下文中一共展示了QPointArray::boundingRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GpiMove
QRegion::QRegion( const QPointArray &a, bool winding )
{
data = new QRegionData;
Q_CHECK_PTR( data );
data->hgt = 0;
data->is_null = FALSE;
QRect r = a.boundingRect();
if ( a.isEmpty() || r.isEmpty() ) {
data->rgn = 0;
} else {
HPS hps = qt_display_ps();
POINTL *pts = new POINTL[ a.size() ];
for ( uint i = 0; i < a.size(); ++ i ) {
pts[i].x = a[i].x();
pts[i].y = - (a[i].y() + 1);
}
// GpiCreatePolygonRegion() is bogus and always starts a poligon from
// the current position. Make the last point the current one and reduce
// the number of points by one.
GpiMove( hps, &pts[ a.size() - 1 ] );
POLYGON poly = { a.size() - 1, pts };
ULONG opts = winding ? POLYGON_WINDING : POLYGON_ALTERNATE;
data->rgn = GpiCreatePolygonRegion( hps, 1, &poly, opts );
delete[] pts;
}
}
示例2: drawPointArray
void KIconEditGrid::drawPointArray(QPointArray a, DrawAction action)
{
QRect rect = a.boundingRect();
bool update = false;
int s = a.size(); //((rect.size().width()) * (rect.size().height()));
for(int i = 0; i < s; i++)
{
int x = a[i].x();
int y = a[i].y();
//if(img->valid(x, y) && !QSize(x, y).isNull() && rect.contains(QPoint(x, y)))
if(img->valid(x, y) && rect.contains(QPoint(x, y)))
{
//debug("x: %d - y: %d", x, y);
switch( action )
{
case Draw:
{
*((uint*)img->scanLine(y) + x) = currentcolor; //colors[cell]|OPAQUE;
int cell = y * numCols() + x;
setColor( cell, currentcolor, false );
modified = true;
update = true;
//updateCell( y, x, FALSE );
break;
}
case Mark:
case UnMark:
repaint(x*cellsize,y*cellsize, cellsize, cellsize, false);
//updateCell( y, x, true );
break;
default:
break;
}
}
}
if(update)
{
updateColors();
repaint(rect.x()*cellSize()-1, rect.y()*cellSize()-1,
rect.width()*cellSize()+1, rect.height()*cellSize()+1, false);
pntarray.resize(0);
}
}