Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_abstract_scale_draw.cpp
- Timestamp:
- May 10, 2017, 3:20:54 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_abstract_scale_draw.cpp
r4271 r8127 38 38 39 39 QwtScaleMap map; 40 QwtScaleDiv sc ldiv;40 QwtScaleDiv scaleDiv; 41 41 42 42 double spacing; … … 86 86 /*! 87 87 Check if a component is enabled 88 89 \param component Component type 90 \return true, when component is enabled 88 91 \sa enableComponent() 89 92 */ … … 95 98 /*! 96 99 Change the scale division 97 \param s dNew scale division98 */ 99 void QwtAbstractScaleDraw::setScaleDiv( const QwtScaleDiv &s d)100 { 101 d_data->sc ldiv = sd;102 d_data->map.setScaleInterval( s d.lowerBound(), sd.upperBound() );100 \param scaleDiv New scale division 101 */ 102 void QwtAbstractScaleDraw::setScaleDiv( const QwtScaleDiv &scaleDiv ) 103 { 104 d_data->scaleDiv = scaleDiv; 105 d_data->map.setScaleInterval( scaleDiv.lowerBound(), scaleDiv.upperBound() ); 103 106 d_data->labelCache.clear(); 104 107 } … … 109 112 */ 110 113 void QwtAbstractScaleDraw::setTransformation( 111 Qwt ScaleTransformation*transformation )114 QwtTransform *transformation ) 112 115 { 113 116 d_data->map.setTransformation( transformation ); … … 129 132 const QwtScaleDiv& QwtAbstractScaleDraw::scaleDiv() const 130 133 { 131 return d_data->sc ldiv;134 return d_data->scaleDiv; 132 135 } 133 136 … … 179 182 180 183 const QList<double> &majorTicks = 181 d_data->sc ldiv.ticks( QwtScaleDiv::MajorTick );184 d_data->scaleDiv.ticks( QwtScaleDiv::MajorTick ); 182 185 183 186 for ( int i = 0; i < majorTicks.count(); i++ ) 184 187 { 185 188 const double v = majorTicks[i]; 186 if ( d_data->sc ldiv.contains( v ) )187 drawLabel( painter, majorTicks[i]);189 if ( d_data->scaleDiv.contains( v ) ) 190 drawLabel( painter, v ); 188 191 } 189 192 … … 204 207 tickType < QwtScaleDiv::NTickTypes; tickType++ ) 205 208 { 206 const QList<double> &ticks = d_data->scldiv.ticks( tickType ); 209 const double tickLen = d_data->tickLength[tickType]; 210 if ( tickLen <= 0.0 ) 211 continue; 212 213 const QList<double> &ticks = d_data->scaleDiv.ticks( tickType ); 207 214 for ( int i = 0; i < ticks.count(); i++ ) 208 215 { 209 216 const double v = ticks[i]; 210 if ( d_data->sc ldiv.contains( v ) )211 drawTick( painter, v, d_data->tickLength[tickType]);217 if ( d_data->scaleDiv.contains( v ) ) 218 drawTick( painter, v, tickLen ); 212 219 } 213 220 } … … 258 265 The default spacing is 4 pixels. 259 266 267 \return Spacing 260 268 \sa setSpacing() 261 269 */ … … 268 276 \brief Set a minimum for the extent 269 277 270 The extent is calculated from the co omponents of the278 The extent is calculated from the components of the 271 279 scale draw. In situations, where the labels are 272 280 changing and the layout depends on the extent (f.e scrolling … … 288 296 /*! 289 297 Get the minimum extent 298 \return Minimum extent 290 299 \sa extent(), setMinimumExtent() 291 300 */ … … 323 332 324 333 /*! 325 Return the length of the ticks 326 334 \return Length of the ticks 327 335 \sa setTickLength(), maxTickLength() 328 336 */ … … 357 365 358 366 The value is converted to a plain text using 359 QLocale ::system().toString(value).367 QLocale().toString(value). 360 368 This method is often overloaded by applications to have individual 361 369 labels. … … 401 409 402 410 /*! 403 Invalidate the cache used by QwtAbstractScaleDraw::tickLabel411 Invalidate the cache used by tickLabel() 404 412 405 413 The cache is invalidated, when a new QwtScaleDiv is set. If
Note:
See TracChangeset
for help on using the changeset viewer.