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 <qevent.h>
15 #include <qdrawutil.h>
16 #include <qpainter.h>
17 #include <qalgorithms.h>
18 #include <qmath.h>
19 #include <qstyle.h>
20 #include <qstyleoption.h>
21 #include <qapplication.h>
22 
23 static QSize qwtHandleSize( const QSize &size,
24  Qt::Orientation orientation, bool hasTrough )
25 {
26  QSize handleSize = size;
27 
28  if ( handleSize.isEmpty() )
29  {
30  const int handleThickness = 16;
31  handleSize.setWidth( 2 * handleThickness );
32  handleSize.setHeight( handleThickness );
33 
34  if ( !hasTrough )
35  handleSize.transpose();
36 
37  if ( orientation == Qt::Vertical )
38  handleSize.transpose();
39  }
40 
41  return handleSize;
42 }
43 
45  Qt::Orientation orientation, QwtSlider::ScalePosition scalePos )
46 {
48 
49  if ( orientation == Qt::Vertical )
50  {
51  // NoScale lays out like Left
52  if ( scalePos == QwtSlider::LeadingScale )
54  else
56  }
57  else
58  {
59  // NoScale lays out like Bottom
60  if ( scalePos == QwtSlider::TrailingScale )
61  align = QwtScaleDraw::TopScale;
62  else
64  }
65 
66  return align;
67 }
68 
70 {
71 public:
73  repeatTimerId( 0 ),
74  updateInterval( 150 ),
75  stepsIncrement( 0 ),
76  pendingValueChange( false ),
77  borderWidth( 2 ),
78  spacing( 4 ),
80  hasTrough( true ),
81  hasGroove( false ),
82  mouseOffset( 0 )
83  {
84  }
85 
87  bool timerTick;
91 
92  QRect sliderRect;
93 
94  QSize handleSize;
96  int spacing;
97 
98  Qt::Orientation orientation;
100 
101  bool hasTrough;
102  bool hasGroove;
103 
105 
106  mutable QSize sizeHintCache;
107 };
118 QwtSlider::QwtSlider( QWidget *parent ):
119  QwtAbstractSlider( parent )
120 {
121  initSlider( Qt::Vertical );
122 }
123 
135 QwtSlider::QwtSlider( Qt::Orientation orientation, QWidget *parent ):
136  QwtAbstractSlider( parent )
137 {
138  initSlider( orientation );
139 }
140 
143 {
144  delete d_data;
145 }
146 
147 void QwtSlider::initSlider( Qt::Orientation orientation )
148 {
149  if ( orientation == Qt::Vertical )
150  setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding );
151  else
152  setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
153 
154  setAttribute( Qt::WA_WState_OwnSizePolicy, false );
155 
157 
159 
161  qwtScaleDrawAlignment( orientation, d_data->scalePosition ) );
162  scaleDraw()->setLength( 100 );
163 
164  setScale( 0.0, 100.0 );
165  setValue( 0.0 );
166 }
167 
174 void QwtSlider::setOrientation( Qt::Orientation orientation )
175 {
176  if ( orientation == d_data->orientation )
177  return;
178 
180 
182  qwtScaleDrawAlignment( orientation, d_data->scalePosition ) );
183 
184  if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
185  {
186  QSizePolicy sp = sizePolicy();
187  sp.transpose();
188  setSizePolicy( sp );
189 
190  setAttribute( Qt::WA_WState_OwnSizePolicy, false );
191  }
192 
193  if ( testAttribute( Qt::WA_WState_Polished ) )
194  layoutSlider( true );
195 }
196 
201 Qt::Orientation QwtSlider::orientation() const
202 {
203  return d_data->orientation;
204 }
205 
213 {
214  if ( d_data->scalePosition == scalePosition )
215  return;
216 
219  qwtScaleDrawAlignment( d_data->orientation, scalePosition ) );
220 
221  if ( testAttribute( Qt::WA_WState_Polished ) )
222  layoutSlider( true );
223 }
224 
230 {
231  return d_data->scalePosition;
232 }
233 
243 void QwtSlider::setBorderWidth( int width )
244 {
245  if ( width < 0 )
246  width = 0;
247 
248  if ( width != d_data->borderWidth )
249  {
250  d_data->borderWidth = width;
251 
252  if ( testAttribute( Qt::WA_WState_Polished ) )
253  layoutSlider( true );
254  }
255 }
256 
261 int QwtSlider::borderWidth() const
262 {
263  return d_data->borderWidth;
264 }
265 
278 {
279  if ( spacing <= 0 )
280  spacing = 0;
281 
282  if ( spacing != d_data->spacing )
283  {
285 
286  if ( testAttribute( Qt::WA_WState_Polished ) )
287  layoutSlider( true );
288  }
289 }
290 
295 int QwtSlider::spacing() const
296 {
297  return d_data->spacing;
298 }
299 
310 void QwtSlider::setHandleSize( const QSize &size )
311 {
312  if ( size != d_data->handleSize )
313  {
314  d_data->handleSize = size;
315 
316  if ( testAttribute( Qt::WA_WState_Polished ) )
317  layoutSlider( true );
318  }
319 }
320 
325 QSize QwtSlider::handleSize() const
326 {
327  return d_data->handleSize;
328 }
329 
344 {
345  const QwtScaleDraw *previousScaleDraw = this->scaleDraw();
346  if ( scaleDraw == NULL || scaleDraw == previousScaleDraw )
347  return;
348 
349  if ( previousScaleDraw )
350  scaleDraw->setAlignment( previousScaleDraw->alignment() );
351 
352  setAbstractScaleDraw( scaleDraw );
353 
354  if ( testAttribute( Qt::WA_WState_Polished ) )
355  layoutSlider( true );
356 }
357 
363 {
364  return static_cast<const QwtScaleDraw *>( abstractScaleDraw() );
365 }
366 
372 {
373  return static_cast<QwtScaleDraw *>( abstractScaleDraw() );
374 }
375 
378 {
380 
381  if ( testAttribute( Qt::WA_WState_Polished ) )
382  layoutSlider( true );
383 }
384 
394 void QwtSlider::setUpdateInterval( int interval )
395 {
396  d_data->updateInterval = qMax( interval, 50 );
397 }
398 
404 {
405  return d_data->updateInterval;
406 }
407 
415  QPainter *painter, const QRect &sliderRect ) const
416 {
417  QRect innerRect( sliderRect );
418 
419  if ( d_data->hasTrough )
420  {
421  const int bw = d_data->borderWidth;
422  innerRect = sliderRect.adjusted( bw, bw, -bw, -bw );
423 
424  painter->fillRect( innerRect, palette().brush( QPalette::Mid ) );
425  qDrawShadePanel( painter, sliderRect, palette(), true, bw, NULL );
426  }
427 
428  if ( d_data->hasGroove )
429  {
430  const QSize handleSize = qwtHandleSize( d_data->handleSize,
432 
433  const int slotExtent = 4;
434  const int slotMargin = 4;
435 
436  QRect slotRect;
437  if ( orientation() == Qt::Horizontal )
438  {
439  int slotOffset = qMax( 1, handleSize.width() / 2 - slotMargin );
440  int slotHeight = slotExtent + ( innerRect.height() % 2 );
441 
442  slotRect.setWidth( innerRect.width() - 2 * slotOffset );
443  slotRect.setHeight( slotHeight );
444  }
445  else
446  {
447  int slotOffset = qMax( 1, handleSize.height() / 2 - slotMargin );
448  int slotWidth = slotExtent + ( innerRect.width() % 2 );
449 
450  slotRect.setWidth( slotWidth );
451  slotRect.setHeight( innerRect.height() - 2 * slotOffset );
452 
453  }
454 
455  slotRect.moveCenter( innerRect.center() );
456 
457  QBrush brush = palette().brush( QPalette::Dark );
458  qDrawShadePanel( painter, slotRect, palette(), true, 1 , &brush );
459  }
460 
461  if ( isValid() )
462  drawHandle( painter, handleRect(), transform( value() ) );
463 }
464 
472 void QwtSlider::drawHandle( QPainter *painter,
473  const QRect &handleRect, int pos ) const
474 {
475  const int bw = d_data->borderWidth;
476 
477  qDrawShadePanel( painter,
478  handleRect, palette(), false, bw,
479  &palette().brush( QPalette::Button ) );
480 
481  pos++; // shade line points one pixel below
482  if ( orientation() == Qt::Horizontal )
483  {
484  qDrawShadeLine( painter, pos, handleRect.top() + bw,
485  pos, handleRect.bottom() - bw, palette(), true, 1 );
486  }
487  else // Vertical
488  {
489  qDrawShadeLine( painter, handleRect.left() + bw, pos,
490  handleRect.right() - bw, pos, palette(), true, 1 );
491  }
492 }
493 
502 bool QwtSlider::isScrollPosition( const QPoint &pos ) const
503 {
504  if ( handleRect().contains( pos ) )
505  {
506  const double v = ( orientation() == Qt::Horizontal )
507  ? pos.x() : pos.y();
508 
509  d_data->mouseOffset = v - transform( value() );
510  return true;
511  }
512 
513  return false;
514 }
515 
525 double QwtSlider::scrolledTo( const QPoint &pos ) const
526 {
527  int p = ( orientation() == Qt::Horizontal )
528  ? pos.x() : pos.y();
529 
530  p -= d_data->mouseOffset;
531 
532  int min = transform( lowerBound() );
533  int max = transform( upperBound() );
534  if ( min > max )
535  qSwap( min, max );
536 
537  p = qBound( min, p, max );
538 
539  return scaleMap().invTransform( p );
540 }
541 
546 void QwtSlider::mousePressEvent( QMouseEvent *event )
547 {
548  if ( isReadOnly() )
549  {
550  event->ignore();
551  return;
552  }
553 
554  const QPoint pos = event->pos();
555 
556  if ( isValid() && d_data->sliderRect.contains( pos ) )
557  {
558  if ( !handleRect().contains( pos ) )
559  {
560  const int markerPos = transform( value() );
561 
563 
564  if ( d_data->orientation == Qt::Horizontal )
565  {
566  if ( pos.x() < markerPos )
568  }
569  else
570  {
571  if ( pos.y() < markerPos )
573  }
574 
575  if ( isInverted() )
577 
578  const double v = value();
580 
581  if ( v != value() )
582  {
583  if ( isTracking() )
584  Q_EMIT valueChanged( value() );
585  else
586  d_data->pendingValueChange = true;
587 
588  Q_EMIT sliderMoved( value() );
589  }
590 
591  d_data->timerTick = false;
592  d_data->repeatTimerId = startTimer( qMax( 250, 2 * updateInterval() ) );
593 
594  return;
595  }
596  }
597 
599 }
600 
606 {
607  if ( d_data->repeatTimerId > 0 )
608  {
609  killTimer( d_data->repeatTimerId );
610  d_data->repeatTimerId = 0;
611  d_data->timerTick = false;
612  d_data->stepsIncrement = 0;
613  }
614 
615  if ( d_data->pendingValueChange )
616  {
617  d_data->pendingValueChange = false;
618  Q_EMIT valueChanged( value() );
619  }
620 
622 }
623 
632 void QwtSlider::timerEvent( QTimerEvent *event )
633 {
634  if ( event->timerId() != d_data->repeatTimerId )
635  {
636  QwtAbstractSlider::timerEvent( event );
637  return;
638  }
639 
640  if ( !isValid() )
641  {
642  killTimer( d_data->repeatTimerId );
643  d_data->repeatTimerId = 0;
644  return;
645  }
646 
647  const double v = value();
649 
650  if ( v != value() )
651  {
652  if ( isTracking() )
653  Q_EMIT valueChanged( value() );
654  else
655  d_data->pendingValueChange = true;
656 
657  Q_EMIT sliderMoved( value() );
658  }
659 
660  if ( !d_data->timerTick )
661  {
662  // restart the timer with a shorter interval
663  killTimer( d_data->repeatTimerId );
664  d_data->repeatTimerId = startTimer( updateInterval() );
665 
666  d_data->timerTick = true;
667  }
668 }
669 
674 void QwtSlider::paintEvent( QPaintEvent *event )
675 {
676  QPainter painter( this );
677  painter.setClipRegion( event->region() );
678 
679  QStyleOption opt;
680  opt.init(this);
681  style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
682 
684  {
685  if ( !d_data->sliderRect.contains( event->rect() ) )
686  scaleDraw()->draw( &painter, palette() );
687  }
688 
689  drawSlider( &painter, d_data->sliderRect );
690 
691  if ( hasFocus() )
692  QwtPainter::drawFocusRect( &painter, this, d_data->sliderRect );
693 }
694 
699 void QwtSlider::resizeEvent( QResizeEvent *event )
700 {
701  layoutSlider( false );
702  QwtAbstractSlider::resizeEvent( event );
703 }
704 
711 bool QwtSlider::event( QEvent *event )
712 {
713  if ( event->type() == QEvent::PolishRequest )
714  layoutSlider( false );
715 
716  return QwtAbstractSlider::event( event );
717 }
718 
724 {
725  if ( event->type() == QEvent::StyleChange ||
726  event->type() == QEvent::FontChange )
727  {
728  if ( testAttribute( Qt::WA_WState_Polished ) )
729  layoutSlider( true );
730  }
731 
733 }
734 
742 void QwtSlider::layoutSlider( bool update_geometry )
743 {
744  int bw = 0;
745  if ( d_data->hasTrough )
746  bw = d_data->borderWidth;
747 
748  const QSize handleSize = qwtHandleSize( d_data->handleSize,
750 
751  QRect sliderRect = contentsRect();
752 
753  /*
754  The marker line of the handle needs to be aligned to
755  the scale. But the marker is in the center
756  and we need space enough to display the rest of the handle.
757 
758  But the scale itself usually needs margins for displaying
759  the tick labels, that also might needs space beyond the
760  backbone.
761 
762  Now it depends on what needs more margins. If it is the
763  slider the scale gets shrunk, otherwise the slider.
764  */
765 
766  int scaleMargin = 0;
768  {
769  int d1, d2;
770  scaleDraw()->getBorderDistHint( font(), d1, d2 );
771 
772  scaleMargin = qMax( d1, d2 ) - bw;
773  }
774 
775  int scaleX, scaleY, scaleLength;
776 
777  if ( d_data->orientation == Qt::Horizontal )
778  {
779  const int handleMargin = handleSize.width() / 2 - 1;
780  if ( scaleMargin > handleMargin )
781  {
782  int off = scaleMargin - handleMargin;
783  sliderRect.adjust( off, 0, -off, 0 );
784  }
785 
786  scaleX = sliderRect.left() + bw + handleSize.width() / 2 - 1;
787  scaleLength = sliderRect.width() - handleSize.width();
788  }
789  else
790  {
791  int handleMargin = handleSize.height() / 2 - 1;
792  if ( scaleMargin > handleMargin )
793  {
794  int off = scaleMargin - handleMargin;
795  sliderRect.adjust( 0, off, 0, -off );
796  }
797 
798  scaleY = sliderRect.top() + bw + handleSize.height() / 2 - 1;
799  scaleLength = sliderRect.height() - handleSize.height();
800  }
801 
802  scaleLength -= 2 * bw;
803 
804  // now align slider and scale according to the ScalePosition
805 
806  if ( d_data->orientation == Qt::Horizontal )
807  {
808  const int h = handleSize.height() + 2 * bw;
809 
811  {
812  sliderRect.setTop( sliderRect.bottom() + 1 - h );
813  scaleY = sliderRect.top() - d_data->spacing;
814  }
815  else
816  {
817  sliderRect.setHeight( h );
818  scaleY = sliderRect.bottom() + 1 + d_data->spacing;
819  }
820  }
821  else // Qt::Vertical
822  {
823  const int w = handleSize.width() + 2 * bw;
824 
826  {
827  sliderRect.setWidth( w );
828  scaleX = sliderRect.right() + 1 + d_data->spacing;
829  }
830  else
831  {
832  sliderRect.setLeft( sliderRect.right() + 1 - w );
833  scaleX = sliderRect.left() - d_data->spacing;
834  }
835  }
836 
838 
839  scaleDraw()->move( scaleX, scaleY );
840  scaleDraw()->setLength( scaleLength );
841 
842  if ( update_geometry )
843  {
844  d_data->sizeHintCache = QSize(); // invalidate
845  updateGeometry();
846  update();
847  }
848 }
849 
859 void QwtSlider::setTrough( bool on )
860 {
861  if ( d_data->hasTrough != on )
862  {
863  d_data->hasTrough = on;
864 
865  if ( testAttribute( Qt::WA_WState_Polished ) )
866  layoutSlider( true );
867  }
868 }
869 
875 {
876  return d_data->hasTrough;
877 }
878 
888 void QwtSlider::setGroove( bool on )
889 {
890  if ( d_data->hasGroove != on )
891  {
892  d_data->hasGroove = on;
893 
894  if ( testAttribute( Qt::WA_WState_Polished ) )
895  layoutSlider( true );
896  }
897 }
898 
904 {
905  return d_data->hasGroove;
906 }
907 
911 QSize QwtSlider::sizeHint() const
912 {
913  const QSize hint = minimumSizeHint();
914  return hint.expandedTo( QApplication::globalStrut() );
915 }
916 
922 {
923  if ( !d_data->sizeHintCache.isEmpty() )
924  return d_data->sizeHintCache;
925 
926  const QSize handleSize = qwtHandleSize( d_data->handleSize,
928 
929  int bw = 0;
930  if ( d_data->hasTrough )
931  bw = d_data->borderWidth;
932 
933  int sliderLength = 0;
934  int scaleExtent = 0;
935 
937  {
938  int d1, d2;
939  scaleDraw()->getBorderDistHint( font(), d1, d2 );
940 
941  const int scaleBorderDist = 2 * ( qMax( d1, d2 ) - bw );
942 
943  int handleBorderDist;
944  if ( d_data->orientation == Qt::Horizontal )
945  handleBorderDist = handleSize.width();
946  else
947  handleBorderDist = handleSize.height();
948 
949  sliderLength = scaleDraw()->minLength( font() );
950  if ( handleBorderDist > scaleBorderDist )
951  {
952  // We need additional space for the overlapping handle
953  sliderLength += handleBorderDist - scaleBorderDist;
954  }
955 
956  scaleExtent += d_data->spacing;
957  scaleExtent += qCeil( scaleDraw()->extent( font() ) );
958  }
959 
960  sliderLength = qMax( sliderLength, 84 ); // from QSlider
961 
962  int w = 0;
963  int h = 0;
964 
965  if ( d_data->orientation == Qt::Horizontal )
966  {
967  w = sliderLength;
968  h = handleSize.height() + 2 * bw + scaleExtent;
969  }
970  else
971  {
972  w = handleSize.width() + 2 * bw + scaleExtent;
973  h = sliderLength;
974  }
975 
976  // finally add margins
977  int left, right, top, bottom;
978  getContentsMargins( &left, &top, &right, &bottom );
979 
980  w += left + right;
981  h += top + 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 }
int v
int spacing() const
void setScale(double lowerBound, double upperBound)
Specify a scale.
void layoutSlider(bool)
Definition: qwt_slider.cpp:742
void initSlider(Qt::Orientation)
Definition: qwt_slider.cpp:147
void setAlignment(Alignment)
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
Qt::Orientation orientation
Definition: qwt_slider.cpp:98
void setValue(double val)
bool hasGroove() const
Definition: qwt_slider.cpp:903
The scale is above.
void valueChanged(double value)
Notify a change of value.
int updateInterval() const
Definition: qwt_slider.cpp:403
const QwtScaleMap & scaleMap() const
PrivateData * d_data
Definition: qwt_slider.h:128
virtual void mousePressEvent(QMouseEvent *)
Definition: qwt_slider.cpp:546
virtual void scaleChange()
QwtSlider::ScalePosition scalePosition
Definition: qwt_slider.cpp:99
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:859
int minLength(const QFont &) const
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
An abstract base class for slider widgets with a scale.
double value() const
CONSTEXPR_F fields align(second_tag, fields f) noexcept
void setOrientation(Qt::Orientation)
Set the orientation.
Definition: qwt_slider.cpp:174
uint pageSteps() const
Alignment alignment() const
QwtSlider(QWidget *parent=NULL)
Definition: qwt_slider.cpp:118
virtual void scaleChange()
Notify changed scale.
Definition: qwt_slider.cpp:377
The scale is left.
virtual double scrolledTo(const QPoint &) const
Determine the value for a new position of the slider handle.
Definition: qwt_slider.cpp:525
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:874
virtual void timerEvent(QTimerEvent *)
Definition: qwt_slider.cpp:632
Qt::Orientation orientation() const
const QwtAbstractScaleDraw * abstractScaleDraw() const
virtual ~QwtSlider()
Destructor.
Definition: qwt_slider.cpp:142
double invTransform(double p) const
virtual void drawSlider(QPainter *, const QRect &) const
Definition: qwt_slider.cpp:414
static QSize qwtHandleSize(const QSize &size, Qt::Orientation orientation, bool hasTrough)
Definition: qwt_slider.cpp:23
virtual QSize minimumSizeHint() const
Definition: qwt_slider.cpp:921
bool isInverted() const
The Slider Widget.
Definition: qwt_slider.h:30
virtual void changeEvent(QEvent *)
The scale is right of a vertical or below a horizontal slider.
Definition: qwt_slider.h:60
TFSIMD_FORCE_INLINE const tfScalar & w() const
virtual void draw(QPainter *, const QPalette &) const
Draw the scale.
const QwtScaleDraw * scaleDraw() const
Definition: qwt_slider.cpp:362
double lowerBound() const
QRect handleRect() const
Definition: qwt_slider.cpp:990
void setScalePosition(ScalePosition)
Change the position of the scale.
Definition: qwt_slider.cpp:212
void setUpdateInterval(int)
Specify the update interval for automatic scrolling.
Definition: qwt_slider.cpp:394
int min(int a, int b)
virtual bool event(QEvent *)
Definition: qwt_slider.cpp:711
The scale is right.
virtual void mouseReleaseEvent(QMouseEvent *)
virtual QSize sizeHint() const
Definition: qwt_slider.cpp:911
ScalePosition scalePosition() const
virtual void drawHandle(QPainter *, const QRect &, int pos) const
Definition: qwt_slider.cpp:472
void incrementValue(int numSteps)
A class for drawing scales.
virtual void mousePressEvent(QMouseEvent *)
int borderWidth() const
void setGroove(bool)
Definition: qwt_slider.cpp:888
virtual bool isScrollPosition(const QPoint &) const
Determine what to do when the user presses a mouse button.
Definition: qwt_slider.cpp:502
virtual void mouseReleaseEvent(QMouseEvent *)
Definition: qwt_slider.cpp:605
double upperBound() const
void setSpacing(int)
Change the spacing between trough and scale.
Definition: qwt_slider.cpp:277
virtual void paintEvent(QPaintEvent *)
Definition: qwt_slider.cpp:674
QSize handleSize() const
static QwtScaleDraw::Alignment qwtScaleDrawAlignment(Qt::Orientation orientation, QwtSlider::ScalePosition scalePos)
Definition: qwt_slider.cpp:44
void setScaleDraw(QwtScaleDraw *)
Set a scale draw.
Definition: qwt_slider.cpp:343
virtual void changeEvent(QEvent *)
Definition: qwt_slider.cpp:723
virtual void resizeEvent(QResizeEvent *)
Definition: qwt_slider.cpp:699
The scale is below.
void setBorderWidth(int bw)
Change the slider&#39;s border width.
Definition: qwt_slider.cpp:243
void move(double x, double y)
void setHandleSize(const QSize &)
Set the slider&#39;s handle size.
Definition: qwt_slider.cpp:310


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:18