! 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
| 17264 | reimplement. |
| 17265 | */ |
| 17266 | void QCPSelectionDecoratorBracket::drawBracket(QCPPainter *painter, int direction) const |
| 17267 | { |
| 17268 | switch (mBracketStyle) |
| 17269 | { |
| 17270 | case bsSquareBracket: |
| 17271 | { |
| 17272 | painter->drawLine(QLineF(mBracketWidth*direction, -mBracketHeight*0.5, 0, -mBracketHeight*0.5)); |
| 17273 | painter->drawLine(QLineF(mBracketWidth*direction, mBracketHeight*0.5, 0, mBracketHeight*0.5)); |
| 17274 | painter->drawLine(QLineF(0, -mBracketHeight*0.5, 0, mBracketHeight*0.5)); |
| 17275 | break; |
| 17276 | } |
| 17277 | case bsHalfEllipse: |
| 17278 | { |
| 17279 | painter->drawArc(QRectF(-mBracketWidth*0.5, -mBracketHeight*0.5, mBracketWidth, mBracketHeight), -90*16, -180*16*direction); |
| 17280 | break; |
| 17281 | } |
| 17282 | case bsEllipse: |
| 17283 | { |
| 17284 | painter->drawEllipse(QRectF(-mBracketWidth*0.5, -mBracketHeight*0.5, mBracketWidth, mBracketHeight)); |
| 17285 | break; |
| 17286 | } |
| 17287 | case bsPlus: |
| 17288 | { |
| 17289 | painter->drawLine(QLineF(0, -mBracketHeight*0.5, 0, mBracketHeight*0.5)); |
| 17290 | painter->drawLine(QLineF(-mBracketWidth*0.5, 0, mBracketWidth*0.5, 0)); |
| 17291 | break; |
| 17292 | } |
| 17293 | default: |
| 17294 | { |
| 17295 | qDebug() << Q_FUNC_INFO << "unknown/custom bracket style can't be handeld by default implementation:" << static_cast<int>(mBracketStyle); |
| 17296 | break; |
| 17297 | } |
| 17298 | } |
| 17299 | } |
| 17300 | |
| 17301 | /*! |
| 17302 | Draws the bracket decoration on the data points at the begin and end of each selected data |