qwt_scale_widget.cpp
Go to the documentation of this file.
1 /******************************************************************************
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_scale_widget.h"
11 #include "qwt_painter.h"
12 #include "qwt_color_map.h"
13 #include "qwt_scale_map.h"
14 #include "qwt_math.h"
15 #include "qwt_scale_div.h"
16 #include "qwt_text.h"
17 #include "qwt_interval.h"
18 #include "qwt_scale_engine.h"
19 
20 #include <qpainter.h>
21 #include <qevent.h>
22 #include <qstyle.h>
23 #include <qstyleoption.h>
24 #include <qapplication.h>
25 #include <qmargins.h>
26 
28 {
29  public:
30  PrivateData()
31  : scaleDraw( NULL )
32  {
33  colorBar.colorMap = NULL;
34  }
35 
36  ~PrivateData()
37  {
38  delete scaleDraw;
39  delete colorBar.colorMap;
40  }
41 
43 
44  int borderDist[2];
45  int minBorderDist[2];
46  int scaleLength;
47  int margin;
48 
50  int spacing;
52 
53  QwtScaleWidget::LayoutFlags layoutFlags;
54 
55  struct t_colorBar
56  {
57  bool isEnabled;
58  int width;
61  } colorBar;
62 };
63 
69  : QWidget( parent )
70 {
72 }
73 
80  : QWidget( parent )
81 {
82  initScale( align );
83 }
84 
87 {
88  delete m_data;
89 }
90 
93 {
94  m_data = new PrivateData;
95 
98 
99  m_data->borderDist[0] = 0;
100  m_data->borderDist[1] = 0;
101  m_data->minBorderDist[0] = 0;
102  m_data->minBorderDist[1] = 0;
103  m_data->margin = 4;
104  m_data->titleOffset = 0;
105  m_data->spacing = 2;
106 
109  m_data->scaleDraw->setLength( 10 );
110 
112  QwtLinearScaleEngine().divideScale( 0.0, 100.0, 10, 5 ) );
113 
115  m_data->colorBar.isEnabled = false;
116  m_data->colorBar.width = 10;
117 
118  const int flags = Qt::AlignHCenter
119  | Qt::TextExpandTabs | Qt::TextWordWrap;
120  m_data->title.setRenderFlags( flags );
121  m_data->title.setFont( font() );
122 
123  QSizePolicy policy( QSizePolicy::MinimumExpanding,
124  QSizePolicy::Fixed );
125  if ( m_data->scaleDraw->orientation() == Qt::Vertical )
126  policy.transpose();
127 
128  setSizePolicy( policy );
129 
130  setAttribute( Qt::WA_WState_OwnSizePolicy, false );
131 }
132 
142 {
143  if ( ( ( m_data->layoutFlags & flag ) != 0 ) != on )
144  {
145  if ( on )
146  m_data->layoutFlags |= flag;
147  else
148  m_data->layoutFlags &= ~flag;
149 
150  update();
151  }
152 }
153 
162 {
163  return ( m_data->layoutFlags & flag );
164 }
165 
172 void QwtScaleWidget::setTitle( const QString& title )
173 {
174  if ( m_data->title.text() != title )
175  {
177  layoutScale();
178  }
179 }
180 
190 void QwtScaleWidget::setTitle( const QwtText& title )
191 {
192  QwtText t = title;
193  const int flags = title.renderFlags() & ~( Qt::AlignTop | Qt::AlignBottom );
194  t.setRenderFlags( flags );
195 
196  if ( t != m_data->title )
197  {
198  m_data->title = t;
199  layoutScale();
200  }
201 }
202 
210 {
211  if ( m_data->scaleDraw == nullptr )
212  return;
213 
215 
216  if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
217  {
218  QSizePolicy policy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
219  if ( m_data->scaleDraw->orientation() == Qt::Vertical )
220  policy.transpose();
221 
222  setSizePolicy( policy );
223 
224  setAttribute( Qt::WA_WState_OwnSizePolicy, false );
225  }
226 
227  layoutScale();
228 }
229 
230 
236 {
237  if ( !scaleDraw() )
239 
240  return scaleDraw()->alignment();
241 }
242 
251 void QwtScaleWidget::setBorderDist( int dist1, int dist2 )
252 {
253  if ( dist1 != m_data->borderDist[0] || dist2 != m_data->borderDist[1] )
254  {
255  m_data->borderDist[0] = dist1;
256  m_data->borderDist[1] = dist2;
257  layoutScale();
258  }
259 }
260 
266 void QwtScaleWidget::setMargin( int margin )
267 {
268  margin = qMax( 0, margin );
269  if ( margin != m_data->margin )
270  {
271  m_data->margin = margin;
272  layoutScale();
273  }
274 }
275 
281 void QwtScaleWidget::setSpacing( int spacing )
282 {
283  spacing = qMax( 0, spacing );
284  if ( spacing != m_data->spacing )
285  {
287  layoutScale();
288  }
289 }
290 
296 void QwtScaleWidget::setLabelAlignment( Qt::Alignment alignment )
297 {
299  layoutScale();
300 }
301 
309 void QwtScaleWidget::setLabelRotation( double rotation )
310 {
311  m_data->scaleDraw->setLabelRotation( rotation );
312  layoutScale();
313 }
314 
327 {
328  if ( ( scaleDraw == NULL ) || ( scaleDraw == m_data->scaleDraw ) )
329  return;
330 
331  const QwtScaleDraw* sd = m_data->scaleDraw;
332  if ( sd )
333  {
334  scaleDraw->setAlignment( sd->alignment() );
335  scaleDraw->setScaleDiv( sd->scaleDiv() );
336 
337  QwtTransform* transform = NULL;
338  if ( sd->scaleMap().transformation() )
339  transform = sd->scaleMap().transformation()->copy();
340 
341  scaleDraw->setTransformation( transform );
342  }
343 
344  delete m_data->scaleDraw;
346 
347  layoutScale();
348 }
349 
355 {
356  return m_data->scaleDraw;
357 }
358 
364 {
365  return m_data->scaleDraw;
366 }
367 
373 {
374  return m_data->title;
375 }
376 
382 {
383  return m_data->borderDist[0];
384 }
385 
391 {
392  return m_data->borderDist[1];
393 }
394 
400 {
401  return m_data->margin;
402 }
403 
409 {
410  return m_data->spacing;
411 }
412 
416 void QwtScaleWidget::paintEvent( QPaintEvent* event )
417 {
418  QPainter painter( this );
419  painter.setClipRegion( event->region() );
420 
421  QStyleOption opt;
422  opt.initFrom(this);
423  style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
424 
425  draw( &painter );
426 }
427 
431 void QwtScaleWidget::draw( QPainter* painter ) const
432 {
433  m_data->scaleDraw->draw( painter, palette() );
434 
435  if ( m_data->colorBar.isEnabled && m_data->colorBar.width > 0 &&
437  {
438  drawColorBar( painter, colorBarRect( contentsRect() ) );
439  }
440 
441  QRect r = contentsRect();
442  if ( m_data->scaleDraw->orientation() == Qt::Horizontal )
443  {
444  r.setLeft( r.left() + m_data->borderDist[0] );
445  r.setWidth( r.width() - m_data->borderDist[1] );
446  }
447  else
448  {
449  r.setTop( r.top() + m_data->borderDist[0] );
450  r.setHeight( r.height() - m_data->borderDist[1] );
451  }
452 
453  if ( !m_data->title.isEmpty() )
454  drawTitle( painter, m_data->scaleDraw->alignment(), r );
455 }
456 
463 QRectF QwtScaleWidget::colorBarRect( const QRectF& rect ) const
464 {
465  QRectF cr = rect;
466 
467  if ( m_data->scaleDraw->orientation() == Qt::Horizontal )
468  {
469  cr.setLeft( cr.left() + m_data->borderDist[0] );
470  cr.setWidth( cr.width() - m_data->borderDist[1] + 1 );
471  }
472  else
473  {
474  cr.setTop( cr.top() + m_data->borderDist[0] );
475  cr.setHeight( cr.height() - m_data->borderDist[1] + 1 );
476  }
477 
478  switch ( m_data->scaleDraw->alignment() )
479  {
481  {
482  cr.setLeft( cr.right() - m_data->margin
483  - m_data->colorBar.width );
484  cr.setWidth( m_data->colorBar.width );
485  break;
486  }
487 
489  {
490  cr.setLeft( cr.left() + m_data->margin );
491  cr.setWidth( m_data->colorBar.width );
492  break;
493  }
494 
496  {
497  cr.setTop( cr.top() + m_data->margin );
498  cr.setHeight( m_data->colorBar.width );
499  break;
500  }
501 
503  {
504  cr.setTop( cr.bottom() - m_data->margin
505  - m_data->colorBar.width );
506  cr.setHeight( m_data->colorBar.width );
507  break;
508  }
509  }
510 
511  return cr;
512 }
513 
520 void QwtScaleWidget::changeEvent( QEvent* event )
521 {
522  if ( event->type() == QEvent::LocaleChange )
523  {
525  }
526 
527  QWidget::changeEvent( event );
528 }
529 
534 void QwtScaleWidget::resizeEvent( QResizeEvent* event )
535 {
536  Q_UNUSED( event );
537  layoutScale( false );
538 }
539 
548 void QwtScaleWidget::layoutScale( bool update_geometry )
549 {
550  int bd0, bd1;
551  getBorderDistHint( bd0, bd1 );
552  if ( m_data->borderDist[0] > bd0 )
553  bd0 = m_data->borderDist[0];
554  if ( m_data->borderDist[1] > bd1 )
555  bd1 = m_data->borderDist[1];
556 
557  int colorBarWidth = 0;
560 
561  const QRectF r = contentsRect();
562  double x, y, length;
563 
564  if ( m_data->scaleDraw->orientation() == Qt::Vertical )
565  {
566  y = r.top() + bd0;
567  length = r.height() - ( bd0 + bd1 );
568 
570  x = r.right() - 1.0 - m_data->margin - colorBarWidth;
571  else
572  x = r.left() + m_data->margin + colorBarWidth;
573  }
574  else
575  {
576  x = r.left() + bd0;
577  length = r.width() - ( bd0 + bd1 );
578 
580  y = r.top() + m_data->margin + colorBarWidth;
581  else
582  y = r.bottom() - 1.0 - m_data->margin - colorBarWidth;
583  }
584 
585  m_data->scaleDraw->move( x, y );
586  m_data->scaleDraw->setLength( length );
587 
588  const int extent = qwtCeil( m_data->scaleDraw->extent( font() ) );
589 
591  m_data->margin + m_data->spacing + colorBarWidth + extent;
592 
593  if ( update_geometry )
594  {
595  updateGeometry();
596 
597 #if 1
598  /*
599  for some reason updateGeometry does not send a LayoutRequest event
600  when the parent is not visible and has no layout
601  */
602 
603  if ( QWidget* w = parentWidget() )
604  {
605  if ( !w->isVisible() && w->layout() == NULL )
606  {
607  if ( w->testAttribute( Qt::WA_WState_Polished ) )
608  QApplication::postEvent( w, new QEvent( QEvent::LayoutRequest ) );
609  }
610  }
611 #endif
612 
613  update();
614  }
615 }
616 
625 void QwtScaleWidget::drawColorBar( QPainter* painter, const QRectF& rect ) const
626 {
627  if ( !m_data->colorBar.interval.isValid() )
628  return;
629 
630  const QwtScaleDraw* sd = m_data->scaleDraw;
631 
634  sd->orientation(), rect );
635 }
636 
645 void QwtScaleWidget::drawTitle( QPainter* painter,
646  QwtScaleDraw::Alignment align, const QRectF& rect ) const
647 {
648  QRectF r = rect;
649  double angle;
650  int flags = m_data->title.renderFlags() &
651  ~( Qt::AlignTop | Qt::AlignBottom | Qt::AlignVCenter );
652 
653  switch ( align )
654  {
656  angle = -90.0;
657  flags |= Qt::AlignTop;
658  r.setRect( r.left(), r.bottom(),
659  r.height(), r.width() - m_data->titleOffset );
660  break;
661 
663  angle = -90.0;
664  flags |= Qt::AlignTop;
665  r.setRect( r.left() + m_data->titleOffset, r.bottom(),
666  r.height(), r.width() - m_data->titleOffset );
667  break;
668 
670  angle = 0.0;
671  flags |= Qt::AlignBottom;
672  r.setTop( r.top() + m_data->titleOffset );
673  break;
674 
676  default:
677  angle = 0.0;
678  flags |= Qt::AlignTop;
679  r.setBottom( r.bottom() - m_data->titleOffset );
680  break;
681  }
682 
684  {
687  {
688  angle = -angle;
689  r.setRect( r.x() + r.height(), r.y() - r.width(),
690  r.width(), r.height() );
691  }
692  }
693 
694  painter->save();
695  painter->setFont( font() );
696  painter->setPen( palette().color( QPalette::Text ) );
697 
698  painter->translate( r.x(), r.y() );
699  if ( angle != 0.0 )
700  painter->rotate( angle );
701 
703  title.setRenderFlags( flags );
704  title.draw( painter, QRectF( 0.0, 0.0, r.width(), r.height() ) );
705 
706  painter->restore();
707 }
708 
718 {
719  layoutScale();
720 }
721 
726 {
727  return minimumSizeHint();
728 }
729 
734 {
735  const Qt::Orientation o = m_data->scaleDraw->orientation();
736 
737  // Border Distance cannot be less than the scale borderDistHint
738  // Note, the borderDistHint is already included in minHeight/minWidth
739  int length = 0;
740  int mbd1, mbd2;
741  getBorderDistHint( mbd1, mbd2 );
742  length += qMax( 0, m_data->borderDist[0] - mbd1 );
743  length += qMax( 0, m_data->borderDist[1] - mbd2 );
744  length += m_data->scaleDraw->minLength( font() );
745 
746  int dim = dimForLength( length, font() );
747  if ( length < dim )
748  {
749  // compensate for long titles
750  length = dim;
751  dim = dimForLength( length, font() );
752  }
753 
754  QSize size( length + 2, dim );
755  if ( o == Qt::Vertical )
756  size.transpose();
757 
758  const QMargins m = contentsMargins();
759  return size + QSize( m.left() + m.right(), m.top() + m.bottom() );
760 }
761 
769 {
770  return qwtCeil( m_data->title.heightForWidth( width, font() ) );
771 }
772 
782 int QwtScaleWidget::dimForLength( int length, const QFont& scaleFont ) const
783 {
784  const int extent = qwtCeil( m_data->scaleDraw->extent( scaleFont ) );
785 
786  int dim = m_data->margin + extent + 1;
787 
788  if ( !m_data->title.isEmpty() )
789  dim += titleHeightForWidth( length ) + m_data->spacing;
790 
792  dim += m_data->colorBar.width + m_data->spacing;
793 
794  return dim;
795 }
796 
815 void QwtScaleWidget::getBorderDistHint( int& start, int& end ) const
816 {
817  m_data->scaleDraw->getBorderDistHint( font(), start, end );
818 
819  if ( start < m_data->minBorderDist[0] )
820  start = m_data->minBorderDist[0];
821 
822  if ( end < m_data->minBorderDist[1] )
823  end = m_data->minBorderDist[1];
824 }
825 
836 void QwtScaleWidget::setMinBorderDist( int start, int end )
837 {
838  m_data->minBorderDist[0] = start;
839  m_data->minBorderDist[1] = end;
840 }
841 
853 void QwtScaleWidget::getMinBorderDist( int& start, int& end ) const
854 {
855  start = m_data->minBorderDist[0];
856  end = m_data->minBorderDist[1];
857 }
858 
868 {
870  if ( sd->scaleDiv() != scaleDiv )
871  {
872  sd->setScaleDiv( scaleDiv );
873  layoutScale();
874 
875  Q_EMIT scaleDivChanged();
876  }
877 }
878 
886 {
887  m_data->scaleDraw->setTransformation( transformation );
888  layoutScale();
889 }
890 
896 {
897  if ( on != m_data->colorBar.isEnabled )
898  {
899  m_data->colorBar.isEnabled = on;
900  layoutScale();
901  }
902 }
903 
909 {
910  return m_data->colorBar.isEnabled;
911 }
912 
920 {
921  if ( width != m_data->colorBar.width )
922  {
923  m_data->colorBar.width = width;
924  if ( isColorBarEnabled() )
925  layoutScale();
926  }
927 }
928 
934 {
935  return m_data->colorBar.width;
936 }
937 
943 {
944  return m_data->colorBar.interval;
945 }
946 
957  const QwtInterval& interval, QwtColorMap* colorMap )
958 {
959  m_data->colorBar.interval = interval;
960 
961  if ( colorMap != m_data->colorBar.colorMap )
962  {
963  delete m_data->colorBar.colorMap;
965  }
966 
967  if ( isColorBarEnabled() )
968  layoutScale();
969 }
970 
976 {
977  return m_data->colorBar.colorMap;
978 }
979 
980 #if QWT_MOC_INCLUDE
981 #include "moc_qwt_scale_widget.cpp"
982 #endif
QwtScaleWidget::PrivateData::spacing
int spacing
Definition: qwt_scale_widget.cpp:57
QwtScaleWidget::PrivateData::title
QwtText title
Definition: qwt_scale_widget.cpp:58
QwtInterval::isValid
bool isValid() const
Definition: qwt_interval.h:210
QwtScaleWidget::setScaleDiv
void setScaleDiv(const QwtScaleDiv &)
Assign a scale division.
Definition: qwt_scale_widget.cpp:867
QwtAbstractScaleDraw::draw
virtual void draw(QPainter *, const QPalette &) const
Draw the scale.
Definition: qwt_abstract_scale_draw.cpp:169
QwtScaleWidget::QwtScaleWidget
QwtScaleWidget(QWidget *parent=NULL)
Create a scale with the position QwtScaleWidget::Left.
Definition: qwt_scale_widget.cpp:68
QwtScaleDraw
A class for drawing scales.
Definition: qwt_scale_draw.h:35
QwtScaleDraw::alignment
Alignment alignment() const
Definition: qwt_scale_draw.cpp:309
QwtScaleDraw::RightScale
@ RightScale
The scale is right.
Definition: qwt_scale_draw.h:54
QwtTransform::copy
virtual QwtTransform * copy() const =0
Virtualized copy operation.
QwtText::setText
void setText(const QString &, QwtText::TextFormat textFormat=AutoText)
Definition: qwt_text.cpp:277
QwtScaleWidget::PrivateData::titleOffset
int titleOffset
Definition: qwt_scale_widget.cpp:56
QwtScaleWidget::setLabelRotation
void setLabelRotation(double rotation)
Change the rotation for the labels. See QwtScaleDraw::setLabelRotation().
Definition: qwt_scale_widget.cpp:309
align
Definition: core.h:2016
QwtAbstractScaleDraw::setTransformation
void setTransformation(QwtTransform *)
Definition: qwt_abstract_scale_draw.cpp:115
QwtScaleWidget::setTitle
void setTitle(const QString &title)
Definition: qwt_scale_widget.cpp:172
QwtScaleWidget::PrivateData::~PrivateData
~PrivateData()
Definition: qwt_scale_widget.cpp:43
qwt_scale_div.h
QwtScaleWidget::setTransformation
void setTransformation(QwtTransform *)
Definition: qwt_scale_widget.cpp:885
QwtLinearColorMap
QwtLinearColorMap builds a color map from color stops.
Definition: qwt_color_map.h:98
QwtScaleWidget::getBorderDistHint
void getBorderDistHint(int &start, int &end) const
Calculate a hint for the border distances.
Definition: qwt_scale_widget.cpp:815
QwtScaleWidget::layoutScale
void layoutScale(bool update_geometry=true)
Definition: qwt_scale_widget.cpp:548
QwtScaleWidget::colorMap
const QwtColorMap * colorMap() const
Definition: qwt_scale_widget.cpp:975
QwtScaleWidget::PrivateData::borderDist
int borderDist[2]
Definition: qwt_scale_widget.cpp:51
QwtScaleDraw::LeftScale
@ LeftScale
The scale is left.
Definition: qwt_scale_draw.h:51
QwtScaleWidget::PrivateData::colorBar
struct QwtScaleWidget::PrivateData::t_colorBar colorBar
QwtAbstractScaleDraw::scaleMap
const QwtScaleMap & scaleMap() const
Definition: qwt_abstract_scale_draw.cpp:121
QwtAbstractScaleDraw::setScaleDiv
void setScaleDiv(const QwtScaleDiv &)
Definition: qwt_abstract_scale_draw.cpp:104
QwtScaleWidget::margin
int margin() const
Definition: qwt_scale_widget.cpp:399
QwtTransform
A transformation between coordinate systems.
Definition: qwt_transform.h:35
QwtScaleWidget::PrivateData::minBorderDist
int minBorderDist[2]
Definition: qwt_scale_widget.cpp:52
QwtScaleDraw::orientation
Qt::Orientation orientation() const
Definition: qwt_scale_draw.cpp:337
QwtScaleWidget::title
QwtText title() const
Definition: qwt_scale_widget.cpp:372
QwtAbstractScaleDraw::invalidateCache
void invalidateCache()
Definition: qwt_abstract_scale_draw.cpp:420
QwtAbstractScaleDraw::scaleDiv
const QwtScaleDiv & scaleDiv() const
Definition: qwt_abstract_scale_draw.cpp:133
qwt_interval.h
mqtt_test_proto.x
x
Definition: mqtt_test_proto.py:34
QwtScaleWidget::PrivateData::t_colorBar::interval
QwtInterval interval
Definition: qwt_scale_widget.cpp:66
QwtText::setRenderFlags
void setRenderFlags(int)
Change the render flags.
Definition: qwt_text.cpp:304
QwtScaleWidget::paintEvent
virtual void paintEvent(QPaintEvent *) QWT_OVERRIDE
paintEvent
Definition: qwt_scale_widget.cpp:416
QwtLinearScaleEngine
A scale engine for linear scales.
Definition: qwt_scale_engine.h:151
QwtScaleWidget::LayoutFlag
LayoutFlag
Layout flags of the title.
Definition: qwt_scale_widget.h:40
QwtScaleWidget::PrivateData::t_colorBar::colorMap
QwtColorMap * colorMap
Definition: qwt_scale_widget.cpp:67
QwtScaleWidget::drawTitle
void drawTitle(QPainter *, QwtScaleDraw::Alignment, const QRectF &rect) const
Definition: qwt_scale_widget.cpp:645
QwtScaleWidget::minimumSizeHint
virtual QSize minimumSizeHint() const QWT_OVERRIDE
Definition: qwt_scale_widget.cpp:733
qwt_math.h
mqtt_test_proto.y
y
Definition: mqtt_test_proto.py:35
QwtScaleWidget::setMargin
void setMargin(int)
Specify the margin to the colorBar/base line.
Definition: qwt_scale_widget.cpp:266
QwtScaleWidget::startBorderDist
int startBorderDist() const
Definition: qwt_scale_widget.cpp:381
QwtScaleWidget::~QwtScaleWidget
virtual ~QwtScaleWidget()
Destructor.
Definition: qwt_scale_widget.cpp:86
QwtScaleDraw::setLabelRotation
void setLabelRotation(double rotation)
Definition: qwt_scale_draw.cpp:930
QwtScaleDraw::getBorderDistHint
void getBorderDistHint(const QFont &, int &start, int &end) const
Determine the minimum border distance.
Definition: qwt_scale_draw.cpp:361
QwtScaleWidget::setColorBarEnabled
void setColorBarEnabled(bool)
Definition: qwt_scale_widget.cpp:895
QwtScaleWidget::sizeHint
virtual QSize sizeHint() const QWT_OVERRIDE
Definition: qwt_scale_widget.cpp:725
QwtScaleWidget::m_data
PrivateData * m_data
Definition: qwt_scale_widget.h:131
nonstd::span_lite::size
span_constexpr std::size_t size(span< T, Extent > const &spn)
Definition: span.hpp:1554
QwtScaleWidget::setScaleDraw
void setScaleDraw(QwtScaleDraw *)
Definition: qwt_scale_widget.cpp:326
QwtScaleWidget::PrivateData::t_colorBar::isEnabled
bool isEnabled
Definition: qwt_scale_widget.cpp:64
QwtScaleWidget::colorBarWidth
int colorBarWidth() const
Definition: qwt_scale_widget.cpp:933
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:22
update
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
qwt_scale_map.h
QwtScaleWidget::dimForLength
int dimForLength(int length, const QFont &scaleFont) const
Find the minimum dimension for a given length. dim is the height, length the width seen in direction ...
Definition: qwt_scale_widget.cpp:782
QwtText
A class representing a text.
Definition: qwt_text.h:51
QwtScaleWidget::isColorBarEnabled
bool isColorBarEnabled() const
Definition: qwt_scale_widget.cpp:908
QwtScaleWidget::scaleDraw
const QwtScaleDraw * scaleDraw() const
Definition: qwt_scale_widget.cpp:354
QwtScaleDraw::TopScale
@ TopScale
The scale is above.
Definition: qwt_scale_draw.h:48
QwtScaleWidget::alignment
QwtScaleDraw::Alignment alignment() const
Definition: qwt_scale_widget.cpp:235
qwt_color_map.h
QwtScaleWidget::PrivateData::layoutFlags
QwtScaleWidget::LayoutFlags layoutFlags
Definition: qwt_scale_widget.cpp:60
QwtScaleDraw::Alignment
Alignment
Definition: qwt_scale_draw.h:42
QwtScaleWidget::setAlignment
void setAlignment(QwtScaleDraw::Alignment)
Definition: qwt_scale_widget.cpp:209
QwtScaleWidget::PrivateData::margin
int margin
Definition: qwt_scale_widget.cpp:54
QwtScaleDraw::move
void move(double x, double y)
Definition: qwt_scale_draw.h:118
QwtText::text
QString text() const
Definition: qwt_text.cpp:289
QwtScaleDraw::extent
virtual double extent(const QFont &) const QWT_OVERRIDE
Definition: qwt_scale_draw.cpp:523
QwtText::renderFlags
int renderFlags() const
Definition: qwt_text.cpp:317
QwtText::heightForWidth
double heightForWidth(double width) const
Definition: qwt_text.cpp:522
QwtScaleWidget::setMinBorderDist
void setMinBorderDist(int start, int end)
Definition: qwt_scale_widget.cpp:836
QwtScaleWidget::colorBarRect
QRectF colorBarRect(const QRectF &) const
Definition: qwt_scale_widget.cpp:463
QwtScaleDraw::minLength
int minLength(const QFont &) const
Definition: qwt_scale_draw.cpp:560
QwtText::setFont
void setFont(const QFont &)
Definition: qwt_text.cpp:329
QwtScaleWidget::setColorBarWidth
void setColorBarWidth(int)
Definition: qwt_scale_widget.cpp:919
QwtScaleWidget::titleHeightForWidth
int titleHeightForWidth(int width) const
Find the height of the title for a given width.
Definition: qwt_scale_widget.cpp:768
QwtScaleWidget::setLabelAlignment
void setLabelAlignment(Qt::Alignment)
Change the alignment for the labels.
Definition: qwt_scale_widget.cpp:296
QwtScaleWidget::testLayoutFlag
bool testLayoutFlag(LayoutFlag) const
Definition: qwt_scale_widget.cpp:161
QwtScaleWidget::TitleInverted
@ TitleInverted
Definition: qwt_scale_widget.h:46
QwtScaleWidget::setBorderDist
void setBorderDist(int dist1, int dist2)
Definition: qwt_scale_widget.cpp:251
QwtScaleDraw::BottomScale
@ BottomScale
The scale is below.
Definition: qwt_scale_draw.h:45
start
ROSCPP_DECL void start()
QwtScaleWidget::PrivateData
Definition: qwt_scale_widget.cpp:27
qwt_painter.h
qwt_scale_engine.h
QwtScaleWidget::setColorMap
void setColorMap(const QwtInterval &, QwtColorMap *)
Definition: qwt_scale_widget.cpp:956
QwtScaleWidget::initScale
void initScale(QwtScaleDraw::Alignment)
Initialize the scale.
Definition: qwt_scale_widget.cpp:92
QwtText::isEmpty
bool isEmpty() const
Definition: qwt_text.cpp:739
QwtScaleDraw::setLabelAlignment
void setLabelAlignment(Qt::Alignment)
Change the label flags.
Definition: qwt_scale_draw.cpp:969
QwtScaleWidget::PrivateData::t_colorBar::width
int width
Definition: qwt_scale_widget.cpp:65
QwtInterval::normalized
QwtInterval normalized() const
Normalize the limits of the interval.
Definition: qwt_interval.cpp:29
QwtScaleWidget::scaleDivChanged
void scaleDivChanged()
Signal emitted, whenever the scale division changes.
QwtScaleWidget::PrivateData::scaleDraw
QwtScaleDraw * scaleDraw
Definition: qwt_scale_widget.cpp:49
QwtScaleWidget::scaleChange
void scaleChange()
Notify a change of the scale.
Definition: qwt_scale_widget.cpp:717
QwtScaleWidget::draw
void draw(QPainter *) const
draw the scale
Definition: qwt_scale_widget.cpp:431
qwtCeil
int qwtCeil(qreal value)
Definition: qwt_math.h:266
qwt_scale_widget.h
QwtScaleWidget::colorBarInterval
QwtInterval colorBarInterval() const
Definition: qwt_scale_widget.cpp:942
QwtText::draw
void draw(QPainter *painter, const QRectF &rect) const
Definition: qwt_text.cpp:615
QwtColorMap
QwtColorMap is used to map values into colors.
Definition: qwt_color_map.h:37
QwtPainter::drawColorBar
static void drawColorBar(QPainter *, const QwtColorMap &, const QwtInterval &, const QwtScaleMap &, Qt::Orientation, const QRectF &)
Definition: qwt_painter.cpp:1205
QwtScaleWidget::PrivateData::t_colorBar
Definition: qwt_scale_widget.cpp:62
QwtScaleDiv
A class representing a scale division.
Definition: qwt_scale_div.h:33
QwtScaleWidget::PrivateData::PrivateData
PrivateData()
Definition: qwt_scale_widget.cpp:37
qwt_text.h
QwtScaleMap::transformation
const QwtTransform * transformation() const
Get the transformation.
Definition: qwt_scale_map.cpp:88
QwtScaleWidget::setLayoutFlag
void setLayoutFlag(LayoutFlag, bool on)
Definition: qwt_scale_widget.cpp:141
QwtScaleWidget::changeEvent
virtual void changeEvent(QEvent *) QWT_OVERRIDE
Definition: qwt_scale_widget.cpp:520
QwtScaleWidget::resizeEvent
virtual void resizeEvent(QResizeEvent *) QWT_OVERRIDE
Definition: qwt_scale_widget.cpp:534
QwtScaleDraw::setAlignment
void setAlignment(Alignment)
Definition: qwt_scale_draw.cpp:322
QwtScaleWidget::setSpacing
void setSpacing(int)
Specify the distance between color bar, scale and title.
Definition: qwt_scale_widget.cpp:281
QwtScaleWidget::drawColorBar
void drawColorBar(QPainter *, const QRectF &) const
Definition: qwt_scale_widget.cpp:625
QwtScaleWidget::getMinBorderDist
void getMinBorderDist(int &start, int &end) const
Definition: qwt_scale_widget.cpp:853
QwtScaleDraw::setLength
void setLength(double length)
Definition: qwt_scale_draw.cpp:732
QwtScaleWidget::PrivateData::scaleLength
int scaleLength
Definition: qwt_scale_widget.cpp:53
QwtScaleWidget::spacing
int spacing() const
Definition: qwt_scale_widget.cpp:408
QwtScaleWidget::endBorderDist
int endBorderDist() const
Definition: qwt_scale_widget.cpp:390


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46