本文整理汇总了C++中QPointArray::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ QPointArray::isNull方法的具体用法?C++ QPointArray::isNull怎么用?C++ QPointArray::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPointArray
的用法示例。
在下文中一共展示了QPointArray::isNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void
QWindowsStyle::drawArrow( QPainter *p, ArrowType type, bool down,
int x, int y, int w, int h,
const QColorGroup &g, bool enabled, const QBrush *fill )
{
QPointArray a; // arrow polygon
switch ( type ) {
case UpArrow:
a.setPoints( 7, -4,1, 2,1, -3,0, 1,0, -2,-1, 0,-1, -1,-2 );
break;
case DownArrow:
a.setPoints( 7, -4,-2, 2,-2, -3,-1, 1,-1, -2,0, 0,0, -1,1 );
break;
case LeftArrow:
a.setPoints( 7, 1,-3, 1,3, 0,-2, 0,2, -1,-1, -1,1, -2,0 );
break;
case RightArrow:
a.setPoints( 7, -1,-3, -1,3, 0,-2, 0,2, 1,-1, 1,1, 2,0 );
break;
}
if ( a.isNull() )
return;
if ( down ) {
x++;
y++;
}
QPen savePen = p->pen(); // save current pen
if (down)
p->setBrushOrigin(p->brushOrigin() + QPoint(1,1));
if ( fill )
p->fillRect( x, y, w, h, *fill );
if (down)
p->setBrushOrigin(p->brushOrigin() - QPoint(1,1));
if ( enabled ) {
a.translate( x+w/2, y+h/2 );
p->setPen( g.buttonText() );
p->drawLineSegments( a, 0, 3 ); // draw arrow
p->drawPoint( a[6] );
} else {
a.translate( x+w/2+1, y+h/2+1 );
p->setPen( g.light() );
p->drawLineSegments( a, 0, 3 ); // draw arrow
p->drawPoint( a[6] );
a.translate( -1, -1 );
p->setPen( g.mid() );
p->drawLineSegments( a, 0, 3 ); // draw arrow
p->drawPoint( a[6] );
}
p->setPen( savePen ); // restore pen
}
示例2: qDrawWinArrow
static void qDrawWinArrow( QPainter *p, Qt::ArrowType type, bool down,
int x, int y, int w, int h,
const QColorGroup &g, bool enabled )
{
QPointArray a; // arrow polygon
switch ( type ) {
case Qt::UpArrow:
a.setPoints( 7, -3,1, 3,1, -2,0, 2,0, -1,-1, 1,-1, 0,-2 );
break;
case Qt::DownArrow:
a.setPoints( 7, -3,-1, 3,-1, -2,0, 2,0, -1,1, 1,1, 0,2 );
break;
case Qt::LeftArrow:
a.setPoints( 7, 1,-3, 1,3, 0,-2, 0,2, -1,-1, -1,1, -2,0 );
break;
case Qt::RightArrow:
a.setPoints( 7, -1,-3, -1,3, 0,-2, 0,2, 1,-1, 1,1, 2,0 );
break;
}
if ( a.isNull() )
return;
if ( down ) {
x++;
y++;
}
QPen savePen = p->pen(); // save current pen
if (down)
p->setBrushOrigin(p->brushOrigin() + QPoint(1,1));
p->fillRect( x, y, w, h, g.brush( QColorGroup::Button ) );
if (down)
p->setBrushOrigin(p->brushOrigin() - QPoint(1,1));
if ( enabled ) {
a.translate( x+w/2, y+h/2 );
p->setPen( g.foreground() );
p->drawLineSegments( a, 0, 3 ); // draw arrow
p->drawPoint( a[6] );
} else {
a.translate( x+w/2+1, y+h/2+1 );
p->setPen( g.light() );
p->drawLineSegments( a, 0, 3 ); // draw arrow
p->drawPoint( a[6] );
a.translate( -1, -1 );
p->setPen( g.mid() );
p->drawLineSegments( a, 0, 3 ); // draw arrow
p->drawPoint( a[6] );
}
p->setPen( savePen ); // restore pen
}