Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_plot_item.cpp
- Timestamp:
- Mar 19, 2021, 9:15:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_item.cpp
r8127 r9383 95 95 96 96 /*! 97 \brief This method detaches a QwtPlotItem from any 97 \brief This method detaches a QwtPlotItem from any 98 98 QwtPlot it has been associated with. 99 99 … … 305 305 306 306 /*! 307 On multi core systems rendering of certain plot item 308 ( f.e QwtPlotRasterItem ) can be done in parallel in 307 On multi core systems rendering of certain plot item 308 ( f.e QwtPlotRasterItem ) can be done in parallel in 309 309 several threads. 310 310 … … 363 363 The default implementation returns an invalid icon 364 364 365 \param index Index of the legend entry 365 \param index Index of the legend entry 366 366 ( usually there is only one ) 367 367 \param size Icon size … … 369 369 \sa setLegendIconSize(), legendData() 370 370 */ 371 QwtGraphic QwtPlotItem::legendIcon( 371 QwtGraphic QwtPlotItem::legendIcon( 372 372 int index, const QSizeF &size ) const 373 373 { … … 389 389 \return A filled rectangle 390 390 */ 391 QwtGraphic QwtPlotItem::defaultIcon( 391 QwtGraphic QwtPlotItem::defaultIcon( 392 392 const QBrush &brush, const QSizeF &size ) const 393 { 393 { 394 394 QwtGraphic icon; 395 395 if ( !size.isEmpty() ) 396 396 { 397 397 icon.setDefaultSize( size ); 398 398 399 399 QRectF r( 0, 0, size.width(), size.height() ); 400 400 401 401 QPainter painter( &icon ); 402 402 painter.fillRect( r, brush ); 403 } 404 403 } 404 405 405 return icon; 406 } 406 } 407 407 408 408 //! Show the item … … 558 558 \param bottom Returns the bottom margin 559 559 560 \returnThe default implementation returns 0 for all margins560 The default implementation returns 0 for all margins 561 561 562 562 \sa QwtPlot::getCanvasMarginsHint(), QwtPlot::updateCanvasMargins() 563 563 */ 564 void QwtPlotItem::getCanvasMarginHint( const QwtScaleMap &xMap, 564 void QwtPlotItem::getCanvasMarginHint( const QwtScaleMap &xMap, 565 565 const QwtScaleMap &yMap, const QRectF &canvasRect, 566 566 double &left, double &top, double &right, double &bottom ) const … … 583 583 584 584 QwtLegendData is basically a list of QVariants that makes it 585 possible to overload and reimplement legendData() to 585 possible to overload and reimplement legendData() to 586 586 return almost any type of information, that is understood 587 587 by the receiver that acts as the legend. 588 588 589 The default implementation returns one entry with 589 The default implementation returns one entry with 590 590 the title() of the item and the legendIcon(). 591 591 … … 599 599 QwtText label = title(); 600 600 label.setRenderFlags( label.renderFlags() & Qt::AlignLeft ); 601 601 602 602 QVariant titleValue; 603 603 qVariantSetValue( titleValue, label ); 604 604 data.setValue( QwtLegendData::TitleRole, titleValue ); 605 605 606 606 const QwtGraphic graphic = legendIcon( 0, legendIconSize() ); 607 607 if ( !graphic.isNull() ) 608 { 608 { 609 609 QVariant iconValue; 610 610 qVariantSetValue( iconValue, graphic ); 611 611 data.setValue( QwtLegendData::IconRole, iconValue ); 612 } 613 612 } 613 614 614 QList<QwtLegendData> list; 615 615 list += data; … … 659 659 legendData() and legendIcon() 660 660 */ 661 void QwtPlotItem::updateLegend( const QwtPlotItem *item, 661 void QwtPlotItem::updateLegend( const QwtPlotItem *item, 662 662 const QList<QwtLegendData> &data ) 663 663 {
Note:
See TracChangeset
for help on using the changeset viewer.