MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / drawBracket

Method drawBracket

qcustomplot/qcustomplot.cpp:16530–16563  ·  view source on GitHub ↗

! Draws the bracket shape with \a painter. The parameter \a direction is either -1 or 1 and indicates whether the bracket shall point to the left or the right (i.e. is a closing or opening bracket, respectively). The passed \a painter already contains all transformations that are necessary to position and rotate the bracket appropriately. Painting operations can be performed as if dra

Source from the content-addressed store, hash-verified

16528 reimplement.
16529*/
16530void QCPSelectionDecoratorBracket::drawBracket(QCPPainter *painter, int direction) const
16531{
16532 switch (mBracketStyle)
16533 {
16534 case bsSquareBracket:
16535 {
16536 painter->drawLine(QLineF(mBracketWidth*direction, -mBracketHeight*0.5, 0, -mBracketHeight*0.5));
16537 painter->drawLine(QLineF(mBracketWidth*direction, mBracketHeight*0.5, 0, mBracketHeight*0.5));
16538 painter->drawLine(QLineF(0, -mBracketHeight*0.5, 0, mBracketHeight*0.5));
16539 break;
16540 }
16541 case bsHalfEllipse:
16542 {
16543 painter->drawArc(-mBracketWidth*0.5, -mBracketHeight*0.5, mBracketWidth, mBracketHeight, -90*16, -180*16*direction);
16544 break;
16545 }
16546 case bsEllipse:
16547 {
16548 painter->drawEllipse(-mBracketWidth*0.5, -mBracketHeight*0.5, mBracketWidth, mBracketHeight);
16549 break;
16550 }
16551 case bsPlus:
16552 {
16553 painter->drawLine(QLineF(0, -mBracketHeight*0.5, 0, mBracketHeight*0.5));
16554 painter->drawLine(QLineF(-mBracketWidth*0.5, 0, mBracketWidth*0.5, 0));
16555 break;
16556 }
16557 default:
16558 {
16559 qDebug() << Q_FUNC_INFO << "unknown/custom bracket style can't be handeld by default implementation:" << static_cast<int>(mBracketStyle);
16560 break;
16561 }
16562 }
16563}
16564
16565/*!
16566 Draws the bracket decoration on the data points at the begin and end of each selected data

Callers

nothing calls this directly

Calls 1

drawLineMethod · 0.80

Tested by

no test coverage detected