Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_plot_multi_barchart.cpp
- Timestamp:
- Mar 19, 2021, 9:15:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_multi_barchart.cpp
r8127 r9383 109 109 /*! 110 110 Assign a series of samples 111 111 112 112 setSamples() is just a wrapper for setData() without any additional 113 113 value - beside that it is easier to find for the developer. 114 114 115 115 \param data Data 116 116 \warning The item takes ownership of the data object, deleting 117 117 it when its not used anymore. 118 */ 119 void QwtPlotMultiBarChart::setSamples( 118 */ 119 void QwtPlotMultiBarChart::setSamples( 120 120 QwtSeriesData<QwtSetSample> *data ) 121 { 121 { 122 122 setData( data ); 123 } 123 } 124 124 125 125 /*! … … 138 138 } 139 139 140 /*! 140 /*! 141 141 \return Bar titles 142 142 \sa setBarTitles(), legendData() … … 163 163 return; 164 164 165 QMap<int, QwtColumnSymbol *>::iterator it = 165 QMap<int, QwtColumnSymbol *>::iterator it = 166 166 d_data->symbolMap.find(valueIndex); 167 167 if ( it == d_data->symbolMap.end() ) … … 207 207 { 208 208 QMap<int, QwtColumnSymbol *>::const_iterator it = 209 d_data->symbolMap. find( valueIndex );210 211 return ( it == d_data->symbolMap. end() ) ? NULL : it.value();209 d_data->symbolMap.constFind( valueIndex ); 210 211 return ( it == d_data->symbolMap.constEnd() ) ? NULL : it.value(); 212 212 } 213 213 … … 220 220 \sa setSymbol(), specialSymbol(), drawBar() 221 221 */ 222 QwtColumnSymbol *QwtPlotMultiBarChart::symbol( int valueIndex ) 223 { 224 QMap<int, QwtColumnSymbol *>:: iterator it =225 d_data->symbolMap. find( valueIndex );226 227 return ( it == d_data->symbolMap. end() ) ? NULL : it.value();222 QwtColumnSymbol *QwtPlotMultiBarChart::symbol( int valueIndex ) 223 { 224 QMap<int, QwtColumnSymbol *>::const_iterator it = 225 d_data->symbolMap.constFind( valueIndex ); 226 227 return ( it == d_data->symbolMap.constEnd() ) ? NULL : it.value(); 228 228 } 229 229 … … 233 233 void QwtPlotMultiBarChart::resetSymbolMap() 234 234 { 235 for ( QMap<int, QwtColumnSymbol *>::iterator it 236 = d_data->symbolMap.begin(); it != d_data->symbolMap.end(); ++it ) 237 { 238 delete it.value(); 239 } 240 235 qDeleteAll( d_data->symbolMap ); 241 236 d_data->symbolMap.clear(); 242 237 } … … 253 248 254 249 When no symbol ( NULL ) is returned, the value will be displayed 255 with the standard symbol that is used for all symbols with the same 250 with the standard symbol that is used for all symbols with the same 256 251 valueIndex. 257 252 … … 260 255 261 256 \return NULL, meaning that the value is not special 262 257 263 258 */ 264 QwtColumnSymbol *QwtPlotMultiBarChart::specialSymbol( 259 QwtColumnSymbol *QwtPlotMultiBarChart::specialSymbol( 265 260 int sampleIndex, int valueIndex ) const 266 261 { … … 456 451 \param index Index of the sample to be painted 457 452 \param sampleWidth Boundng width for all bars of the smaple 458 \param sample Sample 453 \param sample Sample 459 454 460 455 \sa drawSeries(), sampleWidth() … … 536 531 \param index Index of the sample to be painted 537 532 \param sampleWidth Width of the bars 538 \param sample Sample 533 \param sample Sample 539 534 540 535 \sa drawSeries(), sampleWidth() … … 542 537 void QwtPlotMultiBarChart::drawStackedBars( QPainter *painter, 543 538 const QwtScaleMap &xMap, const QwtScaleMap &yMap, 544 const QRectF &canvasRect, int index, 539 const QRectF &canvasRect, int index, 545 540 double sampleWidth, const QwtSetSample& sample ) const 546 541 { … … 568 563 double sum = baseline(); 569 564 570 const int numBars = sample.set.size();571 565 for ( int i = 0; i < numBars; i++ ) 572 566 { … … 670 664 { 671 665 // we build a temporary default symbol 672 QwtColumnSymbol sym( QwtColumnSymbol::Box );673 sym.setLineWidth( 1 );674 sym.setFrameStyle( QwtColumnSymbol::Plain );675 sym.draw( painter, rect );666 QwtColumnSymbol columnSymbol( QwtColumnSymbol::Box ); 667 columnSymbol.setLineWidth( 1 ); 668 columnSymbol.setFrameStyle( QwtColumnSymbol::Plain ); 669 columnSymbol.draw( painter, rect ); 676 670 } 677 671 … … 702 696 { 703 697 QVariant iconValue; 704 qVariantSetValue( iconValue, 698 qVariantSetValue( iconValue, 705 699 legendIcon( i, legendIconSize() ) ); 706 700 … … 719 713 \param index Index of the bar 720 714 \param size Icon size 721 715 722 716 \return An icon showing a bar 723 717 \sa drawBar(), legendData()
Note:
See TracChangeset
for help on using the changeset viewer.