Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_wheel.cpp
- Timestamp:
- Mar 19, 2021, 9:15:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_wheel.cpp
r8127 r9383 55 55 wrapping( false ) 56 56 { 57 } ;57 } 58 58 59 59 Qt::Orientation orientation; … … 114 114 \brief En/Disable tracking 115 115 116 If tracking is enabled (the default), the wheel emits the valueChanged() 117 signal while the wheel is moving. If tracking is disabled, the wheel 116 If tracking is enabled (the default), the wheel emits the valueChanged() 117 signal while the wheel is moving. If tracking is disabled, the wheel 118 118 emits the valueChanged() signal only when the wheel movement is terminated. 119 119 … … 162 162 \brief Mouse press event handler 163 163 164 Start movement of the wheel. 164 Start movement of the wheel. 165 165 166 166 \param event Mouse event … … 209 209 d_data->speed = ( mouseValue - d_data->mouseValue ) / ms; 210 210 } 211 212 d_data->mouseValue = mouseValue; 211 212 d_data->mouseValue = mouseValue; 213 213 214 214 double value = boundedValue( mouseValue - d_data->mouseOffset ); 215 215 if ( d_data->stepAlignment ) 216 216 value = alignedValue( value ); 217 217 218 218 if ( value != d_data->value ) 219 219 { … … 238 238 239 239 \param event Mouse event 240 */ 240 */ 241 241 242 242 void QwtWheel::mouseReleaseEvent( QMouseEvent *event ) … … 260 260 if ( startFlying ) 261 261 { 262 d_data->flyingValue = 262 d_data->flyingValue = 263 263 boundedValue( d_data->mouseValue - d_data->mouseOffset ); 264 264 … … 281 281 282 282 The flying wheel effect is implemented using a timer 283 283 284 284 \param event Timer event 285 285 … … 323 323 \brief Handle wheel events 324 324 325 In/Decrement the value 325 In/Decrement the value 326 326 327 327 \param event Wheel event … … 342 342 double increment = 0.0; 343 343 344 if ( ( event->modifiers() & Qt::ControlModifier) || 344 if ( ( event->modifiers() & Qt::ControlModifier) || 345 345 ( event->modifiers() & Qt::ShiftModifier ) ) 346 346 { … … 384 384 385 385 - Qt::Key_Up\n 386 In case of a horizontal or not inverted vertical wheel the value 386 In case of a horizontal or not inverted vertical wheel the value 387 387 will be incremented by the step size. For an inverted vertical wheel 388 388 the value will be decremented by the step size. 389 389 390 390 - Qt::Key_Down\n 391 In case of a horizontal or not inverted vertical wheel the value 391 In case of a horizontal or not inverted vertical wheel the value 392 392 will be decremented by the step size. For an inverted vertical wheel 393 393 the value will be incremented by the step size. … … 482 482 if ( event->isAccepted() ) 483 483 stopFlying(); 484 484 485 485 if ( increment != 0.0 ) 486 486 { … … 552 552 553 553 /*! 554 \return Wheel border width 554 \return Wheel border width 555 555 \sa setWheelBorderWidth() 556 556 */ … … 561 561 562 562 /*! 563 \brief Set the border width 563 \brief Set the border width 564 564 565 565 The border defaults to 2. … … 575 575 576 576 /*! 577 \return Border width 577 \return Border width 578 578 \sa setBorderWidth() 579 579 */ … … 683 683 } 684 684 685 /*! 685 /*! 686 686 Determine the value corresponding to a specified point 687 687 … … 724 724 } 725 725 726 /*! 726 /*! 727 727 \brief Qt Paint Event 728 728 \param event Paint event … … 737 737 style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this); 738 738 739 qDrawShadePanel( &painter, 739 qDrawShadePanel( &painter, 740 740 contentsRect(), palette(), true, d_data->borderWidth ); 741 741 … … 753 753 \param rect Geometry for the wheel 754 754 */ 755 void QwtWheel::drawWheelBackground( 755 void QwtWheel::drawWheelBackground( 756 756 QPainter *painter, const QRectF &rect ) 757 757 { … … 761 761 762 762 // draw shaded background 763 QLinearGradient gradient( rect.topLeft(), 763 QLinearGradient gradient( rect.topLeft(), 764 764 ( d_data->orientation == Qt::Horizontal ) ? rect.topRight() : rect.bottomLeft() ); 765 765 gradient.setColorAt( 0.0, pal.color( QPalette::Button ) ); … … 772 772 // draw internal border 773 773 774 const QPen lightPen( palette().color( QPalette::Light ), 774 const QPen lightPen( palette().color( QPalette::Light ), 775 775 d_data->wheelBorderWidth, Qt::SolidLine, Qt::FlatCap ); 776 const QPen darkPen( pal.color( QPalette::Dark ), 776 const QPen darkPen( pal.color( QPalette::Dark ), 777 777 d_data->wheelBorderWidth, Qt::SolidLine, Qt::FlatCap ); 778 778 … … 782 782 { 783 783 painter->setPen( lightPen ); 784 painter->drawLine( QPointF( rect.left(), rect.top() + bw2 ), 784 painter->drawLine( QPointF( rect.left(), rect.top() + bw2 ), 785 785 QPointF( rect.right(), rect.top() + bw2 ) ); 786 786 787 787 painter->setPen( darkPen ); 788 painter->drawLine( QPointF( rect.left(), rect.bottom() - bw2 ), 788 painter->drawLine( QPointF( rect.left(), rect.bottom() - bw2 ), 789 789 QPointF( rect.right(), rect.bottom() - bw2 ) ); 790 790 } … … 792 792 { 793 793 painter->setPen( lightPen ); 794 painter->drawLine( QPointF( rect.left() + bw2, rect.top() ), 794 painter->drawLine( QPointF( rect.left() + bw2, rect.top() ), 795 795 QPointF( rect.left() + bw2, rect.bottom() ) ); 796 796 797 797 painter->setPen( darkPen ); 798 painter->drawLine( QPointF( rect.right() - bw2, rect.top() ), 798 painter->drawLine( QPointF( rect.right() - bw2, rect.top() ), 799 799 QPointF( rect.right() - bw2, rect.bottom() ) ); 800 800 } … … 818 818 } 819 819 820 const QPen lightPen( palette().color( QPalette::Light ), 820 const QPen lightPen( palette().color( QPalette::Light ), 821 821 0, Qt::SolidLine, Qt::FlatCap ); 822 const QPen darkPen( palette().color( QPalette::Dark ), 822 const QPen darkPen( palette().color( QPalette::Dark ), 823 823 0, Qt::SolidLine, Qt::FlatCap ); 824 824 … … 857 857 858 858 double tickPos; 859 if ( d_data->inverted ) 859 if ( d_data->inverted ) 860 860 tickPos = rect.left() + off; 861 861 else … … 865 865 { 866 866 painter->setPen( darkPen ); 867 painter->drawLine( QPointF( tickPos - 1 , l1 ), 867 painter->drawLine( QPointF( tickPos - 1 , l1 ), 868 868 QPointF( tickPos - 1, l2 ) ); 869 869 painter->setPen( lightPen ); 870 painter->drawLine( QPointF( tickPos, l1 ), 870 painter->drawLine( QPointF( tickPos, l1 ), 871 871 QPointF( tickPos, l2 ) ); 872 872 } … … 907 907 { 908 908 painter->setPen( darkPen ); 909 painter->drawLine( QPointF( l1, tickPos - 1 ), 909 painter->drawLine( QPointF( l1, tickPos - 1 ), 910 910 QPointF( l2, tickPos - 1 ) ); 911 911 painter->setPen( lightPen ); 912 painter->drawLine( QPointF( l1, tickPos ), 912 painter->drawLine( QPointF( l1, tickPos ), 913 913 QPointF( l2, tickPos ) ); 914 914 } … … 1014 1014 1015 1015 /*! 1016 \brief Set the page step count 1017 1016 \brief Set the page step count 1017 1018 1018 pageStepCount is a multiplicator for the single step size 1019 1019 that typically corresponds to the user pressing PageUp or PageDown. 1020 1021 A value of 0 disables page stepping. 1020 1021 A value of 0 disables page stepping. 1022 1022 1023 1023 The default value is 1. … … 1031 1031 } 1032 1032 1033 /*! 1033 /*! 1034 1034 \return Page step count 1035 1035 \sa setPageStepCount(), singleStep() … … 1150 1150 The direction of an inverted horizontal wheel will be from right to left 1151 1151 an inverted vertical wheel will increase from bottom to top. 1152 1152 1153 1153 \param on En/Disable inverted appearance 1154 1154 \sa isInverted() 1155 1155 1156 1156 */ 1157 1157 void QwtWheel::setInverted( bool on ) … … 1176 1176 \brief En/Disable wrapping 1177 1177 1178 If wrapping is true stepping up from maximum() value will take 1179 you to the minimum() value and vice versa. 1178 If wrapping is true stepping up from maximum() value will take 1179 you to the minimum() value and vice versa. 1180 1180 1181 1181 \param on En/Disable wrapping … … 1251 1251 { 1252 1252 const double range = d_data->maximum - d_data->minimum; 1253 1253 1254 1254 if ( d_data->wrapping && range >= 0.0 ) 1255 1255 { … … 1257 1257 { 1258 1258 value += ::ceil( ( d_data->minimum - value ) / range ) * range; 1259 } 1259 } 1260 1260 else if ( value > d_data->maximum ) 1261 1261 { … … 1293 1293 } 1294 1294 } 1295 } 1295 } 1296 1296 1297 1297 return value;
Note:
See TracChangeset
for help on using the changeset viewer.