void Linie:: paintEvent (QPaintEvent *c)
{
//lines
QPainter Linie (diese);
line.setRenderHint (QPainter:: Antialiasing, richten) aus;
line.setPen (QPen (Quart:: Schwarzes, 2, Quart:: SolidLine, Quart:: RoundCap, Quart:: MiterJoin));
line.setBrush (QBrush (Quart:: Schwarzes, Quart:: SolidPattern));
line.drawLine (50.50.50.200); Mittellinie //-Y
line.drawLine (50.200.250.200); Mittellinie //-x
//-Viereck
int a [5] = {20.60.120.30.200}; //length = a []
int x= 50.0;
int y= 200;
für (int i=0; i<5; i++)
{
int Inc. = 200/5;
für (int j=0; j<200; j=j+inc)
{
QRectF rect ((x+j), (y-a [i]), 0.0, a [i]);
line.setPen (QPen (Quart:: Grün, 8, Quart:: SolidLine, Quart:: RoundCap, Quart:: MiterJoin));
line.drawRect (rect);
}
}
}
|