qwt_slider.cpp
Go to the documentation of this file.
1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
10 #include "qwt_slider.h"
11 #include "qwt_painter.h"
12 #include "qwt_scale_draw.h"
13 #include "qwt_scale_map.h"
14 #include "qwt_math.h"
15 #include "qwt.h"
16 
17 #include <qevent.h>
18 #include <qdrawutil.h>
19 #include <qpainter.h>
20 #include <qstyle.h>
21 #include <qstyleoption.h>
22 #include <qmargins.h>
23 
24 static QSize qwtHandleSize( const QSize &size,
25  Qt::Orientation orientation, bool hasTrough )
26 {
27  QSize handleSize = size;
28 
29  if ( handleSize.isEmpty() )
30  {
31  const int handleThickness = 16;
32  handleSize.setWidth( 2 * handleThickness );
33  handleSize.setHeight( handleThickness );
34 
35  if ( !hasTrough )
36  handleSize.transpose();
37 
38  if ( orientation == Qt::Vertical )
39  handleSize.transpose();
40  }
41 
42  return handleSize;
43 }
44 
46  Qt::Orientation orientation, QwtSlider::ScalePosition scalePos )
47 {
49 
50  if ( orientation == Qt::Vertical )
51  {
52  // NoScale lays out like Left
53  if ( scalePos == QwtSlider::LeadingScale )
55  else
57  }
58  else
59  {
60  // NoScale lays out like Bottom
61  if ( scalePos == QwtSlider::TrailingScale )
62  align = QwtScaleDraw::TopScale;
63  else
65  }
66 
67  return align;
68 }
69 
71 {
72 public:
74  repeatTimerId( 0 ),
75  updateInterval( 150 ),
76  stepsIncrement( 0 ),
77  pendingValueChange( false ),
78  borderWidth( 2 ),
79  spacing( 4 ),
81  hasTrough( true ),
82  hasGroove( false ),
83  mouseOffset( 0 )
84  {
85  }
86 
88  bool timerTick;
92 
93  QRect sliderRect;
94 
95  QSize handleSize;
97  int spacing;
98 
99  Qt::Orientation orientation;
101 
102  bool hasTrough;
103  bool hasGroove;
104 
106 
107  mutable QSize sizeHintCache;
108 };
119 QwtSlider::QwtSlider( QWidget *parent ):
120  QwtAbstractSlider( parent )
121 {
122  initSlider( Qt::Vertical );
123 }
124 
136 QwtSlider::QwtSlider( Qt::Orientation orientation, QWidget *parent ):
137  QwtAbstractSlider( parent )
138 {
139  initSlider( orientation );
140 }
141 
144 {
145  delete d_data;
146 }
147 
148 void QwtSlider::initSlider( Qt::Orientation orientation )
149 {
150  if ( orientation == Qt::Vertical )
151  setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding );
152  else
153  setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
154 
155  setAttribute( Qt::WA_WState_OwnSizePolicy, false );
156 
158 
160 
162  qwtScaleDrawAlignment( orientation, d_data->scalePosition ) );
163  scaleDraw()->setLength( 100 );
164 
165  setScale( 0.0, 100.0 );
166  setValue( 0.0 );
167 }
168 
175 void QwtSlider::setOrientation( Qt::Orientation orientation )
176 {
177  if ( orientation == d_data->orientation )
178  return;
179 
181 
183  qwtScaleDrawAlignment( orientation, d_data->scalePosition ) );
184 
185  if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
186  {
187  QSizePolicy sp = sizePolicy();
188  sp.transpose();
189  setSizePolicy( sp );
190 
191  setAttribute( Qt::WA_WState_OwnSizePolicy, false );
192  }
193 
194  if ( testAttribute( Qt::WA_WState_Polished ) )
195  layoutSlider( true );
196 }
197 
202 Qt::Orientation QwtSlider::orientation() const
203 {
204  return d_data->orientation;
205 }
206 
214 {
215  if ( d_data->scalePosition == scalePosition )
216  return;
217 
220  qwtScaleDrawAlignment( d_data->orientation, scalePosition ) );
221 
222  if ( testAttribute( Qt::WA_WState_Polished ) )
223  layoutSlider( true );
224 }
225 
231 {
232  return d_data->scalePosition;
233 }
234 
244 void QwtSlider::setBorderWidth( int width )
245 {
246  if ( width < 0 )
247  width = 0;
248 
249  if ( width != d_data->borderWidth )
250  {
251  d_data->borderWidth = width;
252 
253  if ( testAttribute( Qt::WA_WState_Polished ) )
254  layoutSlider( true );
255  }
256 }
257 
262 int QwtSlider::borderWidth() const
263 {
264  return d_data->borderWidth;
265 }
266 
279 {
280  if ( spacing <= 0 )
281  spacing = 0;
282 
283  if ( spacing != d_data->spacing )
284  {
286 
287  if ( testAttribute( Qt::WA_WState_Polished ) )
288  layoutSlider( true );
289  }
290 }
291 
296 int QwtSlider::spacing() const
297 {
298  return d_data->spacing;
299 }
300 
311 void QwtSlider::setHandleSize( const QSize &size )
312 {
313  if ( size != d_data->handleSize )
314  {
315  d_data->handleSize = size;
316 
317  if ( testAttribute( Qt::WA_WState_Polished ) )
318  layoutSlider( true );
319  }
320 }
321 
326 QSize QwtSlider::handleSize() const
327 {
328  return d_data->handleSize;
329 }
330 
345 {
346  const QwtScaleDraw *previousScaleDraw = this->scaleDraw();
347  if ( scaleDraw == NULL || scaleDraw == previousScaleDraw )
348  return;
349 
350  if ( previousScaleDraw )
351  scaleDraw->setAlignment( previousScaleDraw->alignment() );
352 
353  setAbstractScaleDraw( scaleDraw );
354 
355  if ( testAttribute( Qt::WA_WState_Polished ) )
356  layoutSlider( true );
357 }
358 
364 {
365  return static_cast<const QwtScaleDraw *>( abstractScaleDraw() );
366 }
367 
373 {
374  return static_cast<QwtScaleDraw *>( abstractScaleDraw() );
375 }
376 
379 {
381 
382  if ( testAttribute( Qt::WA_WState_Polished ) )
383  layoutSlider( true );
384 }
385 
395 void QwtSlider::setUpdateInterval( int interval )
396 {
397  d_data->updateInterval = qMax( interval, 50 );
398 }
399 
405 {
406  return d_data->updateInterval;
407 }
408 
416  QPainter *painter, const QRect &sliderRect ) const
417 {
418  QRect innerRect( sliderRect );
419 
420  if ( d_data->hasTrough )
421  {
422  const int bw = d_data->borderWidth;
423  innerRect = sliderRect.adjusted( bw, bw, -bw, -bw );
424 
425  painter->fillRect( innerRect, palette().brush( QPalette::Mid ) );
426  qDrawShadePanel( painter, sliderRect, palette(), true, bw, NULL );
427  }
428 
429  if ( d_data->hasGroove )
430  {
431  const QSize handleSize = qwtHandleSize( d_data->handleSize,
433 
434  const int slotExtent = 4;
435  const int slotMargin = 4;
436 
437  QRect slotRect;
438  if ( orientation() == Qt::Horizontal )
439  {
440  int slotOffset = qMax( 1, handleSize.width() / 2 - slotMargin );
441  int slotHeight = slotExtent + ( innerRect.height() % 2 );
442 
443  slotRect.setWidth( innerRect.width() - 2 * slotOffset );
444  slotRect.setHeight( slotHeight );
445  }
446  else
447  {
448  int slotOffset = qMax( 1, handleSize.height() / 2 - slotMargin );
449  int slotWidth = slotExtent + ( innerRect.width() % 2 );
450 
451  slotRect.setWidth( slotWidth );
452  slotRect.setHeight( innerRect.height() - 2 * slotOffset );
453 
454  }
455 
456  slotRect.moveCenter( innerRect.center() );
457 
458  QBrush brush = palette().brush( QPalette::Dark );
459  qDrawShadePanel( painter, slotRect, palette(), true, 1 , &brush );
460  }
461 
462  if ( isValid() )
463  drawHandle( painter, handleRect(), transform( value() ) );
464 }
465 
473 void QwtSlider::drawHandle( QPainter *painter,
474  const QRect &handleRect, int pos ) const
475 {
476  const int bw = d_data->borderWidth;
477 
478  qDrawShadePanel( painter,
479  handleRect, palette(), false, bw,
480  &palette().brush( QPalette::Button ) );
481 
482  pos++; // shade line points one pixel below
483  if ( orientation() == Qt::Horizontal )
484  {
485  qDrawShadeLine( painter, pos, handleRect.top() + bw,
486  pos, handleRect.bottom() - bw, palette(), true, 1 );
487  }
488  else // Vertical
489  {
490  qDrawShadeLine( painter, handleRect.left() + bw, pos,
491  handleRect.right() - bw, pos, palette(), true, 1 );
492  }
493 }
494 
503 bool QwtSlider::isScrollPosition( const QPoint &pos ) const
504 {
505  if ( handleRect().contains( pos ) )
506  {
507  const double v = ( orientation() == Qt::Horizontal )
508  ? pos.x() : pos.y();
509 
510  d_data->mouseOffset = v - transform( value() );
511  return true;
512  }
513 
514  return false;
515 }
516 
526 double QwtSlider::scrolledTo( const QPoint &pos ) const
527 {
528  int p = ( orientation() == Qt::Horizontal )
529  ? pos.x() : pos.y();
530 
531  p -= d_data->mouseOffset;
532 
533  int min = transform( lowerBound() );
534  int max = transform( upperBound() );
535  if ( min > max )
536  qSwap( min, max );
537 
538  p = qBound( min, p, max );
539 
540  return scaleMap().invTransform( p );
541 }
542 
547 void QwtSlider::mousePressEvent( QMouseEvent *event )
548 {
549  if ( isReadOnly() )
550  {
551  event->ignore();
552  return;
553  }
554 
555  const QPoint pos = event->pos();
556 
557  if ( isValid() && d_data->sliderRect.contains( pos ) )
558  {
559  if ( !handleRect().contains( pos ) )
560  {
561  const int markerPos = transform( value() );
562 
564 
565  if ( d_data->orientation == Qt::Horizontal )
566  {
567  if ( pos.x() < markerPos )
569  }
570  else
571  {
572  if ( pos.y() < markerPos )
574  }
575 
576  if ( isInverted() )
578 
579  const double v = value();
581 
582  if ( v != value() )
583  {
584  if ( isTracking() )
585  Q_EMIT valueChanged( value() );
586  else
587  d_data->pendingValueChange = true;
588 
589  Q_EMIT sliderMoved( value() );
590  }
591 
592  d_data->timerTick = false;
593  d_data->repeatTimerId = startTimer( qMax( 250, 2 * updateInterval() ) );
594 
595  return;
596  }
597  }
598 
600 }
601 
607 {
608  if ( d_data->repeatTimerId > 0 )
609  {
610  killTimer( d_data->repeatTimerId );
611  d_data->repeatTimerId = 0;
612  d_data->timerTick = false;
613  d_data->stepsIncrement = 0;
614  }
615 
616  if ( d_data->pendingValueChange )
617  {
618  d_data->pendingValueChange = false;
619  Q_EMIT valueChanged( value() );
620  }
621 
623 }
624 
633 void QwtSlider::timerEvent( QTimerEvent *event )
634 {
635  if ( event->timerId() != d_data->repeatTimerId )
636  {
637  QwtAbstractSlider::timerEvent( event );
638  return;
639  }
640 
641  if ( !isValid() )
642  {
643  killTimer( d_data->repeatTimerId );
644  d_data->repeatTimerId = 0;
645  return;
646  }
647 
648  const double v = value();
650 
651  if ( v != value() )
652  {
653  if ( isTracking() )
654  Q_EMIT valueChanged( value() );
655  else
656  d_data->pendingValueChange = true;
657 
658  Q_EMIT sliderMoved( value() );
659  }
660 
661  if ( !d_data->timerTick )
662  {
663  // restart the timer with a shorter interval
664  killTimer( d_data->repeatTimerId );
665  d_data->repeatTimerId = startTimer( updateInterval() );
666 
667  d_data->timerTick = true;
668  }
669 }
670 
675 void QwtSlider::paintEvent( QPaintEvent *event )
676 {
677  QPainter painter( this );
678  painter.setClipRegion( event->region() );
679 
680  QStyleOption opt;
681  opt.initFrom(this);
682  style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
683 
685  {
686  if ( !d_data->sliderRect.contains( event->rect() ) )
687  scaleDraw()->draw( &painter, palette() );
688  }
689 
690  drawSlider( &painter, d_data->sliderRect );
691 
692  if ( hasFocus() )
693  QwtPainter::drawFocusRect( &painter, this, d_data->sliderRect );
694 }
695 
700 void QwtSlider::resizeEvent( QResizeEvent *event )
701 {
702  layoutSlider( false );
703  QwtAbstractSlider::resizeEvent( event );
704 }
705 
712 bool QwtSlider::event( QEvent *event )
713 {
714  if ( event->type() == QEvent::PolishRequest )
715  layoutSlider( false );
716 
717  return QwtAbstractSlider::event( event );
718 }
719 
725 {
726  if ( event->type() == QEvent::StyleChange ||
727  event->type() == QEvent::FontChange )
728  {
729  if ( testAttribute( Qt::WA_WState_Polished ) )
730  layoutSlider( true );
731  }
732 
734 }
735 
743 void QwtSlider::layoutSlider( bool update_geometry )
744 {
745  int bw = 0;
746  if ( d_data->hasTrough )
747  bw = d_data->borderWidth;
748 
749  const QSize handleSize = qwtHandleSize( d_data->handleSize,
751 
752  QRect sliderRect = contentsRect();
753 
754  /*
755  The marker line of the handle needs to be aligned to
756  the scale. But the marker is in the center
757  and we need space enough to display the rest of the handle.
758 
759  But the scale itself usually needs margins for displaying
760  the tick labels, that also might needs space beyond the
761  backbone.
762 
763  Now it depends on what needs more margins. If it is the
764  slider the scale gets shrunk, otherwise the slider.
765  */
766 
767  int scaleMargin = 0;
769  {
770  int d1, d2;
771  scaleDraw()->getBorderDistHint( font(), d1, d2 );
772 
773  scaleMargin = qMax( d1, d2 ) - bw;
774  }
775 
776  int scaleX, scaleY, scaleLength;
777 
778  if ( d_data->orientation == Qt::Horizontal )
779  {
780  const int handleMargin = handleSize.width() / 2 - 1;
781  if ( scaleMargin > handleMargin )
782  {
783  int off = scaleMargin - handleMargin;
784  sliderRect.adjust( off, 0, -off, 0 );
785  }
786 
787  scaleX = sliderRect.left() + bw + handleSize.width() / 2 - 1;
788  scaleLength = sliderRect.width() - handleSize.width();
789  }
790  else
791  {
792  int handleMargin = handleSize.height() / 2 - 1;
793  if ( scaleMargin > handleMargin )
794  {
795  int off = scaleMargin - handleMargin;
796  sliderRect.adjust( 0, off, 0, -off );
797  }
798 
799  scaleY = sliderRect.top() + bw + handleSize.height() / 2 - 1;
800  scaleLength = sliderRect.height() - handleSize.height();
801  }
802 
803  scaleLength -= 2 * bw;
804 
805  // now align slider and scale according to the ScalePosition
806 
807  if ( d_data->orientation == Qt::Horizontal )
808  {
809  const int h = handleSize.height() + 2 * bw;
810 
812  {
813  sliderRect.setTop( sliderRect.bottom() + 1 - h );
814  scaleY = sliderRect.top() - d_data->spacing;
815  }
816  else
817  {
818  sliderRect.setHeight( h );
819  scaleY = sliderRect.bottom() + 1 + d_data->spacing;
820  }
821  }
822  else // Qt::Vertical
823  {
824  const int w = handleSize.width() + 2 * bw;
825 
827  {
828  sliderRect.setWidth( w );
829  scaleX = sliderRect.right() + 1 + d_data->spacing;
830  }
831  else
832  {
833  sliderRect.setLeft( sliderRect.right() + 1 - w );
834  scaleX = sliderRect.left() - d_data->spacing;
835  }
836  }
837 
839 
840  scaleDraw()->move( scaleX, scaleY );
841  scaleDraw()->setLength( scaleLength );
842 
843  if ( update_geometry )
844  {
845  d_data->sizeHintCache = QSize(); // invalidate
846  updateGeometry();
847  update();
848  }
849 }
850 
860 void QwtSlider::setTrough( bool on )
861 {
862  if ( d_data->hasTrough != on )
863  {
864  d_data->hasTrough = on;
865 
866  if ( testAttribute( Qt::WA_WState_Polished ) )
867  layoutSlider( true );
868  }
869 }
870 
876 {
877  return d_data->hasTrough;
878 }
879 
889 void QwtSlider::setGroove( bool on )
890 {
891  if ( d_data->hasGroove != on )
892  {
893  d_data->hasGroove = on;
894 
895  if ( testAttribute( Qt::WA_WState_Polished ) )
896  layoutSlider( true );
897  }
898 }
899 
905 {
906  return d_data->hasGroove;
907 }
908 
912 QSize QwtSlider::sizeHint() const
913 {
914  const QSize hint = minimumSizeHint();
915  return qwtExpandedToGlobalStrut( hint );
916 }
917 
923 {
924  if ( !d_data->sizeHintCache.isEmpty() )
925  return d_data->sizeHintCache;
926 
927  const QSize handleSize = qwtHandleSize( d_data->handleSize,
929 
930  int bw = 0;
931  if ( d_data->hasTrough )
932  bw = d_data->borderWidth;
933 
934  int sliderLength = 0;
935  int scaleExtent = 0;
936 
938  {
939  int d1, d2;
940  scaleDraw()->getBorderDistHint( font(), d1, d2 );
941 
942  const int scaleBorderDist = 2 * ( qMax( d1, d2 ) - bw );
943 
944  int handleBorderDist;
945  if ( d_data->orientation == Qt::Horizontal )
946  handleBorderDist = handleSize.width();
947  else
948  handleBorderDist = handleSize.height();
949 
950  sliderLength = scaleDraw()->minLength( font() );
951  if ( handleBorderDist > scaleBorderDist )
952  {
953  // We need additional space for the overlapping handle
954  sliderLength += handleBorderDist - scaleBorderDist;
955  }
956 
957  scaleExtent += d_data->spacing;
958  scaleExtent += qwtCeil( scaleDraw()->extent( font() ) );
959  }
960 
961  sliderLength = qMax( sliderLength, 84 ); // from QSlider
962 
963  int w = 0;
964  int h = 0;
965 
966  if ( d_data->orientation == Qt::Horizontal )
967  {
968  w = sliderLength;
969  h = handleSize.height() + 2 * bw + scaleExtent;
970  }
971  else
972  {
973  w = handleSize.width() + 2 * bw + scaleExtent;
974  h = sliderLength;
975  }
976 
977  // finally add margins
978  const QMargins m = contentsMargins();
979 
980  w += m.left() + m.right();
981  h += m.top() + m.bottom();
982 
983  d_data->sizeHintCache = QSize( w, h );
984  return d_data->sizeHintCache;
985 }
986 
991 {
992  if ( !isValid() )
993  return QRect();
994 
995  const int markerPos = transform( value() );
996 
997  QPoint center = d_data->sliderRect.center();
998  if ( d_data->orientation == Qt::Horizontal )
999  center.setX( markerPos );
1000  else
1001  center.setY( markerPos );
1002 
1003  QRect rect;
1004  rect.setSize( qwtHandleSize( d_data->handleSize,
1006  rect.moveCenter( center );
1007 
1008  return rect;
1009 }
1010 
1015 {
1016  return d_data->sliderRect;
1017 }
1018 
1019 #if QWT_MOC_INCLUDE
1020 #include "moc_qwt_slider.cpp"
1021 #endif
int spacing() const
void setScale(double lowerBound, double upperBound)
Specify a scale.
virtual QSize sizeHint() const QWT_OVERRIDE
Definition: qwt_slider.cpp:912
void layoutSlider(bool)
Definition: qwt_slider.cpp:743
void initSlider(Qt::Orientation)
Definition: qwt_slider.cpp:148
void setAlignment(Alignment)
virtual void mouseReleaseEvent(QMouseEvent *) QWT_OVERRIDE
Definition: qwt_slider.cpp:606
void setLength(double length)
static void drawFocusRect(QPainter *, const QWidget *)
Draw a focus rectangle on a widget using its style.
void setAbstractScaleDraw(QwtAbstractScaleDraw *)
Set a scale draw.
int transform(double) const
QRect sliderRect() const
QSize qwtExpandedToGlobalStrut(const QSize &size)
Definition: qwt.cpp:21
Qt::Orientation orientation
Definition: qwt_slider.cpp:99
bool hasGroove() const
Definition: qwt_slider.cpp:904
void setValue(double value)
The scale is above.
void valueChanged(double value)
Notify a change of value.
int updateInterval() const
Definition: qwt_slider.cpp:404
virtual void scaleChange() QWT_OVERRIDE
virtual bool isScrollPosition(const QPoint &) const QWT_OVERRIDE
Determine what to do when the user presses a mouse button.
Definition: qwt_slider.cpp:503
virtual void paintEvent(QPaintEvent *) QWT_OVERRIDE
Definition: qwt_slider.cpp:675
const QwtScaleMap & scaleMap() const
virtual void mousePressEvent(QMouseEvent *) QWT_OVERRIDE
Definition: qwt_slider.cpp:547
PrivateData * d_data
Definition: qwt_slider.h:128
QwtSlider::ScalePosition scalePosition
Definition: qwt_slider.cpp:100
void getBorderDistHint(const QFont &, int &start, int &end) const
Determine the minimum border distance.
void sliderMoved(double value)
void setTrough(bool)
Definition: qwt_slider.cpp:860
virtual QSize minimumSizeHint() const QWT_OVERRIDE
Definition: qwt_slider.cpp:922
int minLength(const QFont &) const
virtual void mouseReleaseEvent(QMouseEvent *) QWT_OVERRIDE
void incrementValue(int stepCount)
An abstract base class for slider widgets with a scale.
double value() const
virtual void mousePressEvent(QMouseEvent *) QWT_OVERRIDE
void setOrientation(Qt::Orientation)
Set the orientation.
Definition: qwt_slider.cpp:175
uint pageSteps() const
void * align(std::size_t alignment, std::size_t size, void *&ptr, std::size_t &space, std::size_t &required_space)
Definition: sol.hpp:9768
Alignment alignment() const
QwtSlider(QWidget *parent=NULL)
Definition: qwt_slider.cpp:119
#define min(A, B)
Definition: Log.c:64
#define max(A, B)
Definition: Socket.h:88
The scale is left.
The slider has no scale.
Definition: qwt_slider.h:57
The scale is left of a vertical or above a horizontal slider.
Definition: qwt_slider.h:63
bool hasTrough() const
Definition: qwt_slider.cpp:875
Qt::Orientation orientation() const
const QwtAbstractScaleDraw * abstractScaleDraw() const
virtual ~QwtSlider()
Destructor.
Definition: qwt_slider.cpp:143
double invTransform(double p) const
virtual void drawSlider(QPainter *, const QRect &) const
Definition: qwt_slider.cpp:415
static QSize qwtHandleSize(const QSize &size, Qt::Orientation orientation, bool hasTrough)
Definition: qwt_slider.cpp:24
bool isInverted() const
The Slider Widget.
Definition: qwt_slider.h:30
The scale is right of a vertical or below a horizontal slider.
Definition: qwt_slider.h:60
virtual bool event(QEvent *) QWT_OVERRIDE
Definition: qwt_slider.cpp:712
virtual void draw(QPainter *, const QPalette &) const
Draw the scale.
const QwtScaleDraw * scaleDraw() const
Definition: qwt_slider.cpp:363
double lowerBound() const
QRect handleRect() const
Definition: qwt_slider.cpp:990
virtual void changeEvent(QEvent *) QWT_OVERRIDE
void setScalePosition(ScalePosition)
Change the position of the scale.
Definition: qwt_slider.cpp:213
void setUpdateInterval(int)
Specify the update interval for automatic scrolling.
Definition: qwt_slider.cpp:395
The scale is right.
virtual double scrolledTo(const QPoint &) const QWT_OVERRIDE
Determine the value for a new position of the slider handle.
Definition: qwt_slider.cpp:526
ScalePosition scalePosition() const
virtual void drawHandle(QPainter *, const QRect &, int pos) const
Definition: qwt_slider.cpp:473
A class for drawing scales.
int borderWidth() const
void setGroove(bool)
Definition: qwt_slider.cpp:889
double upperBound() const
void setSpacing(int)
Change the spacing between trough and scale.
Definition: qwt_slider.cpp:278
QSize handleSize() const
static QwtScaleDraw::Alignment qwtScaleDrawAlignment(Qt::Orientation orientation, QwtSlider::ScalePosition scalePos)
Definition: qwt_slider.cpp:45
void setScaleDraw(QwtScaleDraw *)
Set a scale draw.
Definition: qwt_slider.cpp:344
virtual void timerEvent(QTimerEvent *) QWT_OVERRIDE
Definition: qwt_slider.cpp:633
int qwtCeil(qreal value)
Definition: qwt_math.h:262
The scale is below.
virtual void scaleChange() QWT_OVERRIDE
Notify changed scale.
Definition: qwt_slider.cpp:378
void setBorderWidth(int)
Change the slider&#39;s border width.
Definition: qwt_slider.cpp:244
virtual void resizeEvent(QResizeEvent *) QWT_OVERRIDE
Definition: qwt_slider.cpp:700
virtual void changeEvent(QEvent *) QWT_OVERRIDE
Definition: qwt_slider.cpp:724
void move(double x, double y)
void setHandleSize(const QSize &)
Set the slider&#39;s handle size.
Definition: qwt_slider.cpp:311


plotjuggler
Author(s): Davide Faconti
autogenerated on Sun Dec 6 2020 03:48:10