Changeset 9383 in ntrip for trunk/BNC/qwt/qwt_knob.cpp
- Timestamp:
- Mar 19, 2021, 9:15:03 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_knob.cpp
r8127 r9383 120 120 setValue( 0.0 ); 121 121 122 setSizePolicy( QSizePolicy::MinimumExpanding, 122 setSizePolicy( QSizePolicy::MinimumExpanding, 123 123 QSizePolicy::MinimumExpanding ); 124 124 } … … 131 131 132 132 /*! 133 \brief Set the knob type 133 \brief Set the knob type 134 134 135 135 \param knobStyle Knob type … … 186 186 have to be set using setNumTurns(). 187 187 188 The default angle is 270 degrees. 188 The default angle is 270 degrees. 189 189 190 190 \sa totalAngle(), setNumTurns() … … 206 206 } 207 207 208 /*! 208 /*! 209 209 \return the total angle 210 210 \sa setTotalAngle(), setNumTurns(), numTurns() … … 223 223 \sa numTurns(), totalAngle(), setTotalAngle() 224 224 */ 225 225 226 226 void QwtKnob::setNumTurns( int numTurns ) 227 227 { … … 245 245 246 246 /*! 247 \return Number of turns. 247 \return Number of turns. 248 248 249 249 When the total angle is below 360° numTurns() is ceiled to 1. … … 336 336 r.moveBottom( cr.bottom() - d ); 337 337 } 338 else 338 else 339 339 { 340 340 r.moveCenter( QPoint( r.center().x(), cr.center().y() ) ); … … 401 401 if ( !wrapping() ) 402 402 { 403 const double boundedAngle = 403 const double boundedAngle = 404 404 qBound( scaleMap().p1(), angle, scaleMap().p2() ); 405 405 … … 432 432 } 433 433 434 /*! 434 /*! 435 435 Handle QEvent::StyleChange and QEvent::FontChange; 436 436 \param event Change event … … 479 479 drawKnob( &painter, knobRect ); 480 480 481 drawMarker( &painter, knobRect, 481 drawMarker( &painter, knobRect, 482 482 qwtNormalizeDegrees( scaleMap().transform( value() ) ) ); 483 483 … … 514 514 gradient.setColorAt( 1.0, c2 ); 515 515 516 pen = QPen( gradient, d_data->borderWidth ); 516 pen = QPen( gradient, d_data->borderWidth ); 517 517 } 518 518 … … 525 525 QRadialGradient gradient( knobRect.center(), 526 526 knobRect.width(), knobRect.topLeft() + QPointF( off, off ) ); 527 527 528 528 gradient.setColorAt( 0.0, palette().color( QPalette::Midlight ) ); 529 529 gradient.setColorAt( 1.0, palette().color( QPalette::Button ) ); … … 553 553 case QwtKnob::Sunken: 554 554 { 555 QLinearGradient gradient( 555 QLinearGradient gradient( 556 556 knobRect.topLeft(), knobRect.bottomRight() ); 557 557 gradient.setColorAt( 0.0, palette().color( QPalette::Mid ) ); … … 578 578 \param painter Painter 579 579 \param rect Bounding rectangle of the knob without scale 580 \param angle Angle of the marker in degrees 580 \param angle Angle of the marker in degrees 581 581 ( clockwise, 0 at the 12 o'clock position ) 582 582 */ 583 void QwtKnob::drawMarker( QPainter *painter, 583 void QwtKnob::drawMarker( QPainter *painter, 584 584 const QRectF &rect, double angle ) const 585 585 { … … 608 608 case Nub: 609 609 { 610 const double dotWidth = 610 const double dotWidth = 611 611 qMin( double( markerSize ), radius); 612 612 … … 614 614 if ( dotCenterDist > 0.0 ) 615 615 { 616 const QPointF center( xm - sinA * dotCenterDist, 616 const QPointF center( xm - sinA * dotCenterDist, 617 617 ym - cosA * dotCenterDist ); 618 618 … … 626 626 qSwap( c1, c2 ); 627 627 628 QLinearGradient gradient( 628 QLinearGradient gradient( 629 629 ellipse.topLeft(), ellipse.bottomRight() ); 630 630 gradient.setColorAt( 0.0, c1 ); … … 640 640 case Dot: 641 641 { 642 const double dotWidth = 642 const double dotWidth = 643 643 qMin( double( markerSize ), radius); 644 644 … … 646 646 if ( dotCenterDist > 0.0 ) 647 647 { 648 const QPointF center( xm - sinA * dotCenterDist, 648 const QPointF center( xm - sinA * dotCenterDist, 649 649 ym - cosA * dotCenterDist ); 650 650 … … 681 681 painter->translate( rect.center() ); 682 682 painter->rotate( angle - 90.0 ); 683 683 684 684 QPolygonF polygon; 685 685 polygon += QPointF( re, 0.0 ); … … 705 705 */ 706 706 void QwtKnob::drawFocusIndicator( QPainter *painter ) const 707 { 707 { 708 708 const QRect cr = contentsRect(); 709 709 … … 723 723 724 724 QwtPainter::drawFocusRect( painter, this, focusRect ); 725 } 725 } 726 726 727 727 /*! … … 729 729 730 730 Similar to a QLabel::alignment() the flags decide how 731 to align the knob inside of contentsRect(). 731 to align the knob inside of contentsRect(). 732 732 733 733 The default setting is Qt::AlignCenter … … 758 758 \brief Change the knob's width. 759 759 760 Setting a fixed value for the diameter of the knob 760 Setting a fixed value for the diameter of the knob 761 761 is helpful for aligning several knobs in a row. 762 762 … … 764 764 765 765 \sa knobWidth(), setAlignment() 766 \note Modifies the sizePolicy() 766 \note Modifies the sizePolicy() 767 767 */ 768 768 void QwtKnob::setKnobWidth( int width ) … … 828 828 } 829 829 830 /*! 830 /*! 831 831 \return Marker size 832 832 \sa setMarkerSize()
Note:
See TracChangeset
for help on using the changeset viewer.