本文整理汇总了C++中QPointArray::count方法的典型用法代码示例。如果您正苦于以下问题:C++ QPointArray::count方法的具体用法?C++ QPointArray::count怎么用?C++ QPointArray::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPointArray
的用法示例。
在下文中一共展示了QPointArray::count方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawPoints
void MontageView::drawPoints(const QPointArray& pa, QValueList<int>& corners, int correct)
{
if(ccv::debug) std::cerr << "MontageView::drawPoints - pa = " << pa.count() << " corners = " << corners.count() << "\n";
QIconViewItem* item = firstItem();
if( !item )
return;
m_dirty = true;
QImage img = item->pixmap()->convertToImage();
int item_nr = 0;
bool failed = corners[item_nr] != correct;
for( uint i=0; i<pa.count()+1; ++i ){
if( corners[item_nr] == 0 ) {
QPixmap pm(img);
item->setPixmap( pm );
item = item->nextItem();
if( !item )
return;
img = item->pixmap()->convertToImage();
item_nr++;
failed = corners[item_nr] != correct;
}
if(ccv::debug) std::cerr << " Point: " << i << " Image: " << item_nr
<< " (" << pa[i].x() << "," << pa[i].y() << ")"
<< " Corners: " << corners[item_nr] << "\n";
if( !failed ) {
img.setPixel( pa[i].x() , pa[i].y()-1, qRgb(255,255,0) );
img.setPixel( pa[i].x()-1, pa[i].y() , qRgb(255,255,0) );
img.setPixel( pa[i].x() , pa[i].y() , qRgb(255,0,0) );
img.setPixel( pa[i].x()+1, pa[i].y() , qRgb(255,255,0) );
img.setPixel( pa[i].x() , pa[i].y()+1, qRgb(255,255,0) );
}
else {
img.setPixel( pa[i].x() , pa[i].y()-1, qRgb(255,0,0) );
img.setPixel( pa[i].x()-1, pa[i].y() , qRgb(255,0,0) );
img.setPixel( pa[i].x() , pa[i].y() , qRgb(255,255,0) );
img.setPixel( pa[i].x()+1, pa[i].y() , qRgb(255,0,0) );
img.setPixel( pa[i].x() , pa[i].y()+1, qRgb(255,0,0) );
}
corners[item_nr]--;
}
}
示例2: drawEllipses
// --------------------------------------------------------------------------------
void QmvCanvasGrid::drawEllipses( const QPointArray & pa,
int w, int h, const QPen & pen )
{
QPainter pt;
pt.begin(&work_pixmap);
pt.setPen( pen );
// we want the centre at pa.point
for ( int i = 0; i < pa.count(); i++ )
pt.drawEllipse( pa.point(i).x() - w/2,
pa.point(i).y() - h/2, w, h );
pt.end();
updateGridImage( work_pixmap );
}
示例3: drawText
// --------------------------------------------------------------------------------
void QmvCanvasGrid::drawText( const QPointArray & pa,
const QPen & pen, const QFont font, QString text, int w, int h )
{
QPainter pt;
pt.begin(&work_pixmap);
pt.setPen( pen );
pt.setFont( font );
// we want the centre at pa.point
int x, y;
for ( int i = 0; i < pa.count(); i++ )
{
x = pa.point(i).x() - w/2;
y = pa.point(i).y() - h/2;
pt.drawText( x, y, w, h,
AlignHCenter | AlignVCenter,
text, text.length() );
}
pt.end();
updateGridImage( work_pixmap );
}