18 const QPalette& pal,
double lw )
22 if ( rect.width() == 0.0 )
24 p->setPen( pal.dark().color() );
25 p->drawLine( rect.topLeft(), rect.bottomLeft() );
29 if ( rect.height() == 0.0 )
31 p->setPen( pal.dark().color() );
32 p->drawLine( rect.topLeft(), rect.topRight() );
36 lw =
qwtMinF( lw, rect.height() / 2.0 - 1.0 );
37 lw =
qwtMinF( lw, rect.width() / 2.0 - 1.0 );
39 const QRectF outerRect = rect.adjusted( 0, 0, 1, 1 );
40 QPolygonF polygon( outerRect );
42 if ( outerRect.width() > 2 * lw && outerRect.height() > 2 * lw )
44 const QRectF innerRect = outerRect.adjusted( lw, lw, -lw, -lw );
45 polygon = polygon.subtracted( innerRect );
48 p->setPen( Qt::NoPen );
50 p->setBrush( pal.dark() );
51 p->drawPolygon( polygon );
54 const QRectF windowRect = rect.adjusted( lw, lw, -lw + 1, -lw + 1 );
55 if ( windowRect.isValid() )
56 p->fillRect( windowRect, pal.window() );
60 const QPalette& pal,
double lw )
64 if ( rect.width() == 0.0 )
66 painter->setPen( pal.window().color() );
67 painter->drawLine( rect.topLeft(), rect.bottomLeft() );
71 if ( rect.height() == 0.0 )
73 painter->setPen( pal.window().color() );
74 painter->drawLine( rect.topLeft(), rect.topRight() );
78 lw =
qwtMinF( lw, rect.height() / 2.0 - 1.0 );
79 lw =
qwtMinF( lw, rect.width() / 2.0 - 1.0 );
81 const QRectF outerRect = rect.adjusted( 0, 0, 1, 1 );
82 const QRectF innerRect = outerRect.adjusted( lw, lw, -lw, -lw );
86 lines[0] += outerRect.bottomLeft();
87 lines[0] += outerRect.topLeft();
88 lines[0] += outerRect.topRight();
89 lines[0] += innerRect.topRight();
90 lines[0] += innerRect.topLeft();
91 lines[0] += innerRect.bottomLeft();
93 lines[1] += outerRect.topRight();
94 lines[1] += outerRect.bottomRight();
95 lines[1] += outerRect.bottomLeft();
96 lines[1] += innerRect.bottomLeft();
97 lines[1] += innerRect.bottomRight();
98 lines[1] += innerRect.topRight();
100 painter->setPen( Qt::NoPen );
102 painter->setBrush( pal.light() );
103 painter->drawPolygon( lines[0] );
104 painter->setBrush( pal.dark() );
105 painter->drawPolygon( lines[1] );
108 painter->fillRect( rect.adjusted( lw, lw, -lw + 1, -lw + 1 ), pal.window() );
270 r.setLeft( qRound( r.left() ) );
271 r.setRight( qRound( r.right() ) );
272 r.setTop( qRound( r.top() ) );
273 r.setBottom( qRound( r.bottom() ) );
290 painter->fillRect( r.adjusted( 0, 0, 1, 1 ),
m_data->
palette.window() );
305 r.adjust( 1, 0, 0, 0 );
308 r.adjust( 0, 0, -1, 0 );
311 r.adjust( 0, 1, 0, 0 );
314 r.adjust( 0, 0, 0, -1 );