Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_plot_marker.cpp
- Timestamp:
- Mar 19, 2021, 9:15:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_marker.cpp
r8127 r9383 135 135 const QRectF &canvasRect ) const 136 136 { 137 const QPointF pos( xMap.transform( d_data->xValue ), 137 const QPointF pos( xMap.transform( d_data->xValue ), 138 138 yMap.transform( d_data->yValue ) ); 139 139 … … 148 148 const QSizeF sz = d_data->symbol->size(); 149 149 150 const QRectF clipRect = canvasRect.adjusted( 150 const QRectF clipRect = canvasRect.adjusted( 151 151 -sz.width(), -sz.height(), sz.width(), sz.height() ); 152 152 … … 338 338 /*! 339 339 \brief Set the line style 340 \param style Line style. 340 \param style Line style. 341 341 \sa lineStyle() 342 342 */ … … 424 424 In all other styles the alignment is relative to the marker's position. 425 425 426 \param align Alignment. 426 \param align Alignment. 427 427 \sa labelAlignment(), labelOrientation() 428 428 */ … … 503 503 } 504 504 505 /*! 505 /*! 506 506 Build and assign a line pen 507 507 508 508 In Qt5 the default pen width is 1.0 ( 0.0 in Qt4 ) what makes it 509 509 non cosmetic ( see QPen::isCosmetic() ). This method has been introduced 510 510 to hide this incompatibility. 511 511 512 512 \param color Pen color 513 513 \param width Pen width 514 514 \param style Pen style 515 515 516 516 \sa pen(), brush() 517 */ 517 */ 518 518 void QwtPlotMarker::setLinePen( const QColor &color, qreal width, Qt::PenStyle style ) 519 { 519 { 520 520 setLinePen( QPen( color, width, style ) ); 521 521 } … … 549 549 QRectF QwtPlotMarker::boundingRect() const 550 550 { 551 return QRectF( d_data->xValue, d_data->yValue, 0.0, 0.0 ); 551 // width/height of -1 does not affect the autoscale calculation 552 553 switch (d_data->style) 554 { 555 case QwtPlotMarker::HLine: 556 return QRectF( d_data->xValue, d_data->yValue, -1.0, 0.0 ); 557 558 case QwtPlotMarker::VLine: 559 return QRectF( d_data->xValue, d_data->yValue, 0.0, -1.0 ); 560 561 default : 562 return QRectF( d_data->xValue, d_data->yValue, 0.0, 0.0 ); 563 } 552 564 } 553 565 … … 555 567 \return Icon representing the marker on the legend 556 568 557 \param index Index of the legend entry 569 \param index Index of the legend entry 558 570 ( usually there is only one ) 559 571 \param size Icon size … … 586 598 const double y = 0.5 * size.height(); 587 599 588 QwtPainter::drawLine( &painter, 600 QwtPainter::drawLine( &painter, 589 601 0.0, y, size.width(), y ); 590 602 } … … 595 607 const double x = 0.5 * size.width(); 596 608 597 QwtPainter::drawLine( &painter, 609 QwtPainter::drawLine( &painter, 598 610 x, 0.0, x, size.height() ); 599 611 }
Note:
See TracChangeset
for help on using the changeset viewer.