Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_slider.cpp
- Timestamp:
- Mar 19, 2021, 9:15:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_slider.cpp
r8127 r9383 21 21 #include <qapplication.h> 22 22 23 static QSize qwtHandleSize( const QSize &size, 23 static QSize qwtHandleSize( const QSize &size, 24 24 Qt::Orientation orientation, bool hasTrough ) 25 25 { … … 42 42 } 43 43 44 static QwtScaleDraw::Alignment qwtScaleDrawAlignment( 44 static QwtScaleDraw::Alignment qwtScaleDrawAlignment( 45 45 Qt::Orientation orientation, QwtSlider::ScalePosition scalePos ) 46 46 { … … 108 108 /*! 109 109 Construct vertical slider in QwtSlider::Trough style 110 with a scale to the left. 110 with a scale to the left. 111 111 112 112 The scale is initialized to [0.0, 100.0] and the value set to 0.0. … … 131 131 132 132 \param parent Parent widget 133 \param orientation Orientation of the slider. 133 \param orientation Orientation of the slider. 134 134 */ 135 135 QwtSlider::QwtSlider( Qt::Orientation orientation, QWidget *parent ): … … 158 158 d_data->orientation = orientation; 159 159 160 scaleDraw()->setAlignment( 160 scaleDraw()->setAlignment( 161 161 qwtScaleDrawAlignment( orientation, d_data->scalePosition ) ); 162 162 scaleDraw()->setLength( 100 ); … … 179 179 d_data->orientation = orientation; 180 180 181 scaleDraw()->setAlignment( 181 scaleDraw()->setAlignment( 182 182 qwtScaleDrawAlignment( orientation, d_data->scalePosition ) ); 183 183 … … 216 216 217 217 d_data->scalePosition = scalePosition; 218 scaleDraw()->setAlignment( 218 scaleDraw()->setAlignment( 219 219 qwtScaleDrawAlignment( d_data->orientation, scalePosition ) ); 220 220 … … 223 223 } 224 224 225 /*! 225 /*! 226 226 \return Position of the scale 227 227 \sa setScalePosition() … … 412 412 \param sliderRect Bounding rectangle of the slider 413 413 */ 414 void QwtSlider::drawSlider( 414 void QwtSlider::drawSlider( 415 415 QPainter *painter, const QRect &sliderRect ) const 416 416 { … … 434 434 const int slotMargin = 4; 435 435 436 QRect slotRect; 436 QRect slotRect; 437 437 if ( orientation() == Qt::Horizontal ) 438 438 { … … 470 470 \param pos Position of the handle marker in widget coordinates 471 471 */ 472 void QwtSlider::drawHandle( QPainter *painter, 472 void QwtSlider::drawHandle( QPainter *painter, 473 473 const QRect &handleRect, int pos ) const 474 474 { 475 475 const int bw = d_data->borderWidth; 476 476 477 qDrawShadePanel( painter, 477 qDrawShadePanel( painter, 478 478 handleRect, palette(), false, bw, 479 479 &palette().brush( QPalette::Button ) ); … … 497 497 \param pos Mouse position 498 498 499 \retval True, when handleRect() contains pos 499 \retval True, when handleRect() contains pos 500 500 \sa scrolledTo() 501 501 */ … … 504 504 if ( handleRect().contains( pos ) ) 505 505 { 506 const double v = ( orientation() == Qt::Horizontal ) 506 const double v = ( orientation() == Qt::Horizontal ) 507 507 ? pos.x() : pos.y(); 508 508 … … 525 525 double QwtSlider::scrolledTo( const QPoint &pos ) const 526 526 { 527 int p = ( orientation() == Qt::Horizontal ) 527 int p = ( orientation() == Qt::Horizontal ) 528 528 ? pos.x() : pos.y(); 529 529 … … 629 629 630 630 \param event Mouse event 631 */ 631 */ 632 632 void QwtSlider::timerEvent( QTimerEvent *event ) 633 633 { … … 663 663 killTimer( d_data->repeatTimerId ); 664 664 d_data->repeatTimerId = startTimer( updateInterval() ); 665 665 666 666 d_data->timerTick = true; 667 } 667 } 668 668 } 669 669 … … 710 710 void QwtSlider::changeEvent( QEvent *event ) 711 711 { 712 if ( event->type() == QEvent::StyleChange || 712 if ( event->type() == QEvent::StyleChange || 713 713 event->type() == QEvent::FontChange ) 714 714 { … … 740 740 /* 741 741 The marker line of the handle needs to be aligned to 742 the scale. But the marker is in the center 742 the scale. But the marker is in the center 743 743 and we need space enough to display the rest of the handle. 744 744 … … 878 878 { 879 879 d_data->hasGroove = on; 880 880 881 881 if ( testAttribute( Qt::WA_WState_Polished ) ) 882 882 layoutSlider( true ); … … 891 891 { 892 892 return d_data->hasGroove; 893 } 893 } 894 894 895 895 /*! … … 918 918 bw = d_data->borderWidth; 919 919 920 int sliderLength = 0; 920 int sliderLength = 0; 921 921 int scaleExtent = 0; 922 922
Note:
See TracChangeset
for help on using the changeset viewer.