qwt_thermo.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_thermo.h"
11 #include "qwt_scale_draw.h"
12 #include "qwt_scale_map.h"
13 #include "qwt_color_map.h"
14 #include "qwt_math.h"
15 
16 #include <qpainter.h>
17 #include <qevent.h>
18 #include <qdrawutil.h>
19 #include <qstyle.h>
20 #include <qstyleoption.h>
21 #include <qmargins.h>
22 
23 #include <algorithm>
24 #include <functional>
25 
26 static inline void qwtDrawLine( QPainter* painter, int pos,
27  const QColor& color, const QRect& pipeRect, const QRect& liquidRect,
28  Qt::Orientation orientation )
29 {
30  painter->setPen( color );
31  if ( orientation == Qt::Horizontal )
32  {
33  if ( pos >= liquidRect.left() && pos < liquidRect.right() )
34  painter->drawLine( pos, pipeRect.top(), pos, pipeRect.bottom() );
35  }
36  else
37  {
38  if ( pos >= liquidRect.top() && pos < liquidRect.bottom() )
39  painter->drawLine( pipeRect.left(), pos, pipeRect.right(), pos );
40  }
41 }
42 
43 static QVector< double > qwtTickList( const QwtScaleDiv& scaleDiv )
44 {
45  QVector< double > values;
46 
47  double lowerLimit = scaleDiv.interval().minValue();
48  double upperLimit = scaleDiv.interval().maxValue();
49 
50  if ( upperLimit < lowerLimit )
51  qSwap( lowerLimit, upperLimit );
52 
53  values += lowerLimit;
54 
55  for ( int tickType = QwtScaleDiv::MinorTick;
56  tickType < QwtScaleDiv::NTickTypes; tickType++ )
57  {
58  const QList< double > ticks = scaleDiv.ticks( tickType );
59 
60  for ( int i = 0; i < ticks.count(); i++ )
61  {
62  const double v = ticks[i];
63  if ( v > lowerLimit && v < upperLimit )
64  values += v;
65  }
66  }
67 
68  values += upperLimit;
69 
70  return values;
71 }
72 
74 {
75  public:
77  : orientation( Qt::Vertical )
79  , spacing( 3 )
80  , borderWidth( 2 )
81  , pipeWidth( 10 )
82  , alarmLevel( 0.0 )
83  , alarmEnabled( false )
84  , autoFillPipe( true )
86  , origin( 0.0 )
87  , colorMap( NULL )
88  , value( 0.0 )
89  {
91  }
92 
94  {
95  delete colorMap;
96  }
97 
98  Qt::Orientation orientation;
100 
101  int spacing;
104 
105  QwtInterval::BorderFlags rangeFlags;
106  double alarmLevel;
110  double origin;
111 
113 
114  double value;
115 };
116 
121 QwtThermo::QwtThermo( QWidget* parent )
122  : QwtAbstractScale( parent )
123 {
124  m_data = new PrivateData;
125 
126  QSizePolicy policy( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
127  if ( m_data->orientation == Qt::Vertical )
128  policy.transpose();
129 
130  setSizePolicy( policy );
131 
132  setAttribute( Qt::WA_WState_OwnSizePolicy, false );
133  layoutThermo( true );
134 }
135 
138 {
139  delete m_data;
140 }
141 
157 void QwtThermo::setRangeFlags( QwtInterval::BorderFlags flags )
158 {
159  if ( m_data->rangeFlags != flags )
160  {
161  m_data->rangeFlags = flags;
162  update();
163  }
164 }
165 
170 QwtInterval::BorderFlags QwtThermo::rangeFlags() const
171 {
172  return m_data->rangeFlags;
173 }
174 
181 void QwtThermo::setValue( double value )
182 {
183  if ( m_data->value != value )
184  {
185  m_data->value = value;
186  update();
187  }
188 }
189 
191 double QwtThermo::value() const
192 {
193  return m_data->value;
194 }
195 
208 {
210  layoutThermo( true );
211 }
212 
218 {
219  return static_cast< const QwtScaleDraw* >( abstractScaleDraw() );
220 }
221 
227 {
228  return static_cast< QwtScaleDraw* >( abstractScaleDraw() );
229 }
230 
235 void QwtThermo::paintEvent( QPaintEvent* event )
236 {
237  QPainter painter( this );
238  painter.setClipRegion( event->region() );
239 
240  QStyleOption opt;
241  opt.initFrom(this);
242  style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
243 
244  const QRect tRect = pipeRect();
245 
246  if ( !tRect.contains( event->rect() ) )
247  {
249  scaleDraw()->draw( &painter, palette() );
250  }
251 
252  const int bw = m_data->borderWidth;
253 
254  const QBrush brush = palette().brush( QPalette::Base );
255  qDrawShadePanel( &painter,
256  tRect.adjusted( -bw, -bw, bw, bw ),
257  palette(), true, bw,
258  m_data->autoFillPipe ? &brush : NULL );
259 
260  drawLiquid( &painter, tRect );
261 }
262 
267 void QwtThermo::resizeEvent( QResizeEvent* event )
268 {
269  Q_UNUSED( event );
270  layoutThermo( false );
271 }
272 
277 void QwtThermo::changeEvent( QEvent* event )
278 {
279  switch( event->type() )
280  {
281  case QEvent::StyleChange:
282  case QEvent::FontChange:
283  {
284  layoutThermo( true );
285  break;
286  }
287  default:
288  break;
289  }
290 }
291 
299 void QwtThermo::layoutThermo( bool update_geometry )
300 {
301  const QRect tRect = pipeRect();
302  const int bw = m_data->borderWidth + m_data->spacing;
303  const bool inverted = ( upperBound() < lowerBound() );
304 
305  int from, to;
306 
307  if ( m_data->orientation == Qt::Horizontal )
308  {
309  from = tRect.left();
310  to = tRect.right();
311 
313  {
314  if ( inverted )
315  to++;
316  else
317  from--;
318  }
320  {
321  if ( inverted )
322  from--;
323  else
324  to++;
325  }
326 
328  {
330  scaleDraw()->move( from, tRect.top() - bw );
331  }
332  else
333  {
335  scaleDraw()->move( from, tRect.bottom() + bw );
336  }
337 
338  scaleDraw()->setLength( qMax( to - from, 0 ) );
339  }
340  else // Qt::Vertical
341  {
342  from = tRect.top();
343  to = tRect.bottom();
344 
346  {
347  if ( inverted )
348  from--;
349  else
350  to++;
351  }
353  {
354  if ( inverted )
355  to++;
356  else
357  from--;
358  }
359 
361  {
363  scaleDraw()->move( tRect.right() + bw, from );
364  }
365  else
366  {
368  scaleDraw()->move( tRect.left() - bw, from );
369  }
370 
371  scaleDraw()->setLength( qMax( to - from, 0 ) );
372  }
373 
374  if ( update_geometry )
375  {
376  updateGeometry();
377  update();
378  }
379 }
380 
385 QRect QwtThermo::pipeRect() const
386 {
387  int mbd = 0;
389  {
390  int d1, d2;
391  scaleDraw()->getBorderDistHint( font(), d1, d2 );
392  mbd = qMax( d1, d2 );
393  }
394  const int bw = m_data->borderWidth;
395  const int scaleOff = bw + mbd;
396 
397  const QRect cr = contentsRect();
398 
399  QRect pipeRect = cr;
400  if ( m_data->orientation == Qt::Horizontal )
401  {
402  pipeRect.adjust( scaleOff, 0, -scaleOff, 0 );
403 
405  pipeRect.setTop( cr.top() + cr.height() - bw - m_data->pipeWidth );
406  else
407  pipeRect.setTop( bw );
408 
409  pipeRect.setHeight( m_data->pipeWidth );
410  }
411  else // Qt::Vertical
412  {
413  pipeRect.adjust( 0, scaleOff, 0, -scaleOff );
414 
416  pipeRect.setLeft( bw );
417  else
418  pipeRect.setLeft( cr.left() + cr.width() - bw - m_data->pipeWidth );
419 
420  pipeRect.setWidth( m_data->pipeWidth );
421  }
422 
423  return pipeRect;
424 }
425 
432 void QwtThermo::setOrientation( Qt::Orientation orientation )
433 {
434  if ( orientation == m_data->orientation )
435  return;
436 
438 
439  if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
440  {
441  QSizePolicy sp = sizePolicy();
442  sp.transpose();
443  setSizePolicy( sp );
444 
445  setAttribute( Qt::WA_WState_OwnSizePolicy, false );
446  }
447 
448  layoutThermo( true );
449 }
450 
455 Qt::Orientation QwtThermo::orientation() const
456 {
457  return m_data->orientation;
458 }
459 
465 {
466  if ( m == m_data->originMode )
467  return;
468 
469  m_data->originMode = m;
470  update();
471 }
472 
478 {
479  return m_data->originMode;
480 }
481 
491 void QwtThermo::setOrigin( double origin )
492 {
493  if ( origin == m_data->origin )
494  return;
495 
496  m_data->origin = origin;
497  update();
498 }
499 
504 double QwtThermo::origin() const
505 {
506  return m_data->origin;
507 }
508 
516 {
518  return;
519 
521 
522  if ( testAttribute( Qt::WA_WState_Polished ) )
523  layoutThermo( true );
524 }
525 
531 {
532  return m_data->scalePosition;
533 }
534 
537 {
538  layoutThermo( true );
539 }
540 
547  QPainter* painter, const QRect& pipeRect ) const
548 {
549  painter->save();
550  painter->setClipRect( pipeRect, Qt::IntersectClip );
551  painter->setPen( Qt::NoPen );
552 
553  const QwtScaleMap scaleMap = scaleDraw()->scaleMap();
554 
555  QRect liquidRect = fillRect( pipeRect );
556 
557  if ( m_data->colorMap != NULL )
558  {
559  const QwtInterval interval = scaleDiv().interval().normalized();
560 
561  // Because the positions of the ticks are rounded
562  // we calculate the colors for the rounded tick values
563 
565 
566  if ( scaleMap.isInverting() )
567  std::sort( values.begin(), values.end(), std::greater< double >() );
568  else
569  std::sort( values.begin(), values.end(), std::less< double >() );
570 
571  int from;
572  if ( !values.isEmpty() )
573  {
574  from = qRound( scaleMap.transform( values[0] ) );
575  qwtDrawLine( painter, from,
576  m_data->colorMap->color( interval, values[0] ),
577  pipeRect, liquidRect, m_data->orientation );
578  }
579 
580  for ( int i = 1; i < values.size(); i++ )
581  {
582  const int to = qRound( scaleMap.transform( values[i] ) );
583 
584  for ( int pos = from + 1; pos < to; pos++ )
585  {
586  const double v = scaleMap.invTransform( pos );
587 
588  qwtDrawLine( painter, pos,
589  m_data->colorMap->color( interval, v ),
590  pipeRect, liquidRect, m_data->orientation );
591  }
592 
593  qwtDrawLine( painter, to,
594  m_data->colorMap->color( interval, values[i] ),
595  pipeRect, liquidRect, m_data->orientation );
596 
597  from = to;
598  }
599  }
600  else
601  {
602  if ( !liquidRect.isEmpty() && m_data->alarmEnabled )
603  {
604  const QRect r = alarmRect( liquidRect );
605  if ( !r.isEmpty() )
606  {
607  painter->fillRect( r, palette().brush( QPalette::Highlight ) );
608  liquidRect = QRegion( liquidRect ).subtracted( r ).boundingRect();
609  }
610  }
611 
612  painter->fillRect( liquidRect, palette().brush( QPalette::ButtonText ) );
613  }
614 
615  painter->restore();
616 }
617 
629 void QwtThermo::setSpacing( int spacing )
630 {
631  if ( spacing <= 0 )
632  spacing = 0;
633 
634  if ( spacing != m_data->spacing )
635  {
637  layoutThermo( true );
638  }
639 }
640 
645 int QwtThermo::spacing() const
646 {
647  return m_data->spacing;
648 }
649 
655 void QwtThermo::setBorderWidth( int width )
656 {
657  if ( width <= 0 )
658  width = 0;
659 
660  if ( width != m_data->borderWidth )
661  {
662  m_data->borderWidth = width;
663  layoutThermo( true );
664  }
665 }
666 
671 int QwtThermo::borderWidth() const
672 {
673  return m_data->borderWidth;
674 }
675 
684 {
685  if ( colorMap != m_data->colorMap )
686  {
687  delete m_data->colorMap;
689  }
690 }
691 
698 {
699  return m_data->colorMap;
700 }
701 
707 const QwtColorMap* QwtThermo::colorMap() const
708 {
709  return m_data->colorMap;
710 }
711 
720 void QwtThermo::setFillBrush( const QBrush& brush )
721 {
722  QPalette pal = palette();
723  pal.setBrush( QPalette::ButtonText, brush );
724  setPalette( pal );
725 }
726 
731 QBrush QwtThermo::fillBrush() const
732 {
733  return palette().brush( QPalette::ButtonText );
734 }
735 
747 void QwtThermo::setAlarmBrush( const QBrush& brush )
748 {
749  QPalette pal = palette();
750  pal.setBrush( QPalette::Highlight, brush );
751  setPalette( pal );
752 }
753 
761 QBrush QwtThermo::alarmBrush() const
762 {
763  return palette().brush( QPalette::Highlight );
764 }
765 
775 void QwtThermo::setAlarmLevel( double level )
776 {
777  m_data->alarmLevel = level;
778  m_data->alarmEnabled = 1;
779  update();
780 }
781 
789 double QwtThermo::alarmLevel() const
790 {
791  return m_data->alarmLevel;
792 }
793 
800 void QwtThermo::setPipeWidth( int width )
801 {
802  if ( width > 0 )
803  {
804  m_data->pipeWidth = width;
805  layoutThermo( true );
806  }
807 }
808 
813 int QwtThermo::pipeWidth() const
814 {
815  return m_data->pipeWidth;
816 }
817 
826 {
827  m_data->alarmEnabled = on;
828  update();
829 }
830 
837 bool QwtThermo::alarmEnabled() const
838 {
839  return m_data->alarmEnabled;
840 }
841 
846 QSize QwtThermo::sizeHint() const
847 {
848  return minimumSizeHint();
849 }
850 
857 {
858  int w = 0, h = 0;
859 
860  if ( m_data->scalePosition != NoScale )
861  {
862  const int sdExtent = qwtCeil( scaleDraw()->extent( font() ) );
863  const int sdLength = scaleDraw()->minLength( font() );
864 
865  w = sdLength;
866  h = m_data->pipeWidth + sdExtent + m_data->spacing;
867 
868  }
869  else // no scale
870  {
871  w = 200;
872  h = m_data->pipeWidth;
873  }
874 
875  if ( m_data->orientation == Qt::Vertical )
876  qSwap( w, h );
877 
878  w += 2 * m_data->borderWidth;
879  h += 2 * m_data->borderWidth;
880 
881  // finally add the margins
882  const QMargins m = contentsMargins();
883  w += m.left() + m.right();
884  h += m.top() + m.bottom();
885 
886  return QSize( w, h );
887 }
888 
897 QRect QwtThermo::fillRect( const QRect& pipeRect ) const
898 {
899  double origin;
900  if ( m_data->originMode == OriginMinimum )
901  {
902  origin = qMin( lowerBound(), upperBound() );
903  }
904  else if ( m_data->originMode == OriginMaximum )
905  {
906  origin = qMax( lowerBound(), upperBound() );
907  }
908  else // OriginCustom
909  {
910  origin = m_data->origin;
911  }
912 
913  const QwtScaleMap scaleMap = scaleDraw()->scaleMap();
914 
915  int from = qRound( scaleMap.transform( m_data->value ) );
916  int to = qRound( scaleMap.transform( origin ) );
917 
918  if ( to < from )
919  qSwap( from, to );
920 
921  QRect fillRect = pipeRect;
922  if ( m_data->orientation == Qt::Horizontal )
923  {
924  fillRect.setLeft( from );
925  fillRect.setRight( to );
926  }
927  else // Qt::Vertical
928  {
929  fillRect.setTop( from );
930  fillRect.setBottom( to );
931  }
932 
933  return fillRect.normalized();
934 }
935 
944 QRect QwtThermo::alarmRect( const QRect& fillRect ) const
945 {
946  QRect alarmRect( 0, 0, -1, -1); // something invalid
947 
948  if ( !m_data->alarmEnabled )
949  return alarmRect;
950 
951  const bool inverted = ( upperBound() < lowerBound() );
952 
953  bool increasing;
954  if ( m_data->originMode == OriginCustom )
955  {
956  increasing = m_data->value > m_data->origin;
957  }
958  else
959  {
960  increasing = m_data->originMode == OriginMinimum;
961  }
962 
963  const QwtScaleMap map = scaleDraw()->scaleMap();
964  const int alarmPos = qRound( map.transform( m_data->alarmLevel ) );
965  const int valuePos = qRound( map.transform( m_data->value ) );
966 
967  if ( m_data->orientation == Qt::Horizontal )
968  {
969  int v1, v2;
970  if ( inverted )
971  {
972  v1 = fillRect.left();
973 
974  v2 = alarmPos - 1;
975  v2 = qMin( v2, increasing ? fillRect.right() : valuePos );
976  }
977  else
978  {
979  v1 = alarmPos + 1;
980  v1 = qMax( v1, increasing ? fillRect.left() : valuePos );
981 
982  v2 = fillRect.right();
983 
984  }
985  alarmRect.setRect( v1, fillRect.top(), v2 - v1 + 1, fillRect.height() );
986  }
987  else
988  {
989  int v1, v2;
990  if ( inverted )
991  {
992  v1 = alarmPos + 1;
993  v1 = qMax( v1, increasing ? fillRect.top() : valuePos );
994 
995  v2 = fillRect.bottom();
996  }
997  else
998  {
999  v1 = fillRect.top();
1000 
1001  v2 = alarmPos - 1;
1002  v2 = qMin( v2, increasing ? fillRect.bottom() : valuePos );
1003  }
1004  alarmRect.setRect( fillRect.left(), v1, fillRect.width(), v2 - v1 + 1 );
1005  }
1006 
1007  return alarmRect;
1008 }
1009 
1010 #if QWT_MOC_INCLUDE
1011 #include "moc_qwt_thermo.cpp"
1012 #endif
QwtThermo::scaleDraw
const QwtScaleDraw * scaleDraw() const
Definition: qwt_thermo.cpp:217
QwtAbstractScaleDraw::draw
virtual void draw(QPainter *, const QPalette &) const
Draw the scale.
Definition: qwt_abstract_scale_draw.cpp:169
QwtThermo::borderWidth
int borderWidth
Definition: qwt_thermo.h:63
color
color
Definition: color.h:16
QwtScaleDraw
A class for drawing scales.
Definition: qwt_scale_draw.h:35
QwtScaleDraw::RightScale
@ RightScale
The scale is right.
Definition: qwt_scale_draw.h:54
QwtThermo::~QwtThermo
virtual ~QwtThermo()
Destructor.
Definition: qwt_thermo.cpp:137
QwtScaleMap::invTransform
double invTransform(double p) const
Definition: qwt_scale_map.h:154
qwtDrawLine
static void qwtDrawLine(QPainter *painter, int pos, const QColor &color, const QRect &pipeRect, const QRect &liquidRect, Qt::Orientation orientation)
Definition: qwt_thermo.cpp:26
QwtAbstractScale::scaleMap
const QwtScaleMap & scaleMap() const
Definition: qwt_abstract_scale.cpp:357
QwtThermo::alarmBrush
QBrush alarmBrush() const
Definition: qwt_thermo.cpp:761
QwtThermo::pipeRect
QRect pipeRect() const
Definition: qwt_thermo.cpp:385
QwtThermo::OriginCustom
@ OriginCustom
The origin is specified using the origin() property.
Definition: qwt_thermo.h:100
QwtThermo::value
double value
Return the value.
Definition: qwt_thermo.h:65
QwtThermo::setScaleDraw
void setScaleDraw(QwtScaleDraw *)
Set a scale draw.
Definition: qwt_thermo.cpp:207
QwtThermo::PrivateData::originMode
QwtThermo::OriginMode originMode
Definition: qwt_thermo.cpp:109
QwtThermo::OriginMinimum
@ OriginMinimum
The origin is the minimum of the scale.
Definition: qwt_thermo.h:94
QwtInterval::ExcludeMaximum
@ ExcludeMaximum
Max value is not included in the interval.
Definition: qwt_interval.h:52
QwtScaleDraw::LeftScale
@ LeftScale
The scale is left.
Definition: qwt_scale_draw.h:51
QwtThermo::alarmEnabled
bool alarmEnabled
Definition: qwt_thermo.h:59
QVector< double >
QwtInterval::minValue
double minValue() const
Definition: qwt_interval.h:192
QwtThermo::m_data
PrivateData * m_data
Definition: qwt_thermo.h:174
QwtAbstractScaleDraw::scaleMap
const QwtScaleMap & scaleMap() const
Definition: qwt_abstract_scale_draw.cpp:121
QwtThermo::PrivateData::alarmEnabled
bool alarmEnabled
Definition: qwt_thermo.cpp:107
QwtThermo::PrivateData::origin
double origin
Definition: qwt_thermo.cpp:110
QwtThermo::minimumSizeHint
virtual QSize minimumSizeHint() const QWT_OVERRIDE
Definition: qwt_thermo.cpp:856
QwtThermo::colorMap
QwtColorMap * colorMap()
Definition: qwt_thermo.cpp:697
QwtThermo::PrivateData::colorMap
QwtColorMap * colorMap
Definition: qwt_thermo.cpp:112
QwtThermo::OriginMode
OriginMode
Definition: qwt_thermo.h:91
QwtAbstractScale
An abstract base class for widgets having a scale.
Definition: qwt_abstract_scale.h:36
QList< double >
qwt_math.h
QwtAbstractScale::lowerBound
double lowerBound
Definition: qwt_abstract_scale.h:40
QwtThermo::PrivateData::value
double value
Definition: qwt_thermo.cpp:114
QwtAbstractScale::upperBound
double upperBound
Definition: qwt_abstract_scale.h:41
QwtThermo::setColorMap
void setColorMap(QwtColorMap *)
Assign a color map for the fill color.
Definition: qwt_thermo.cpp:683
QwtThermo::PrivateData::spacing
int spacing
Definition: qwt_thermo.cpp:101
QwtThermo::setBorderWidth
void setBorderWidth(int)
Definition: qwt_thermo.cpp:655
QwtThermo::fillRect
QRect fillRect(const QRect &) const
Calculate the filled rectangle of the pipe.
Definition: qwt_thermo.cpp:897
QwtScaleMap::isInverting
bool isInverting() const
Definition: qwt_scale_map.h:164
QwtThermo::OriginMaximum
@ OriginMaximum
The origin is the maximum of the scale.
Definition: qwt_thermo.h:97
QwtAbstractScale::setAbstractScaleDraw
void setAbstractScaleDraw(QwtAbstractScaleDraw *)
Set a scale draw.
Definition: qwt_abstract_scale.cpp:277
QwtThermo::origin
double origin
Definition: qwt_thermo.h:61
QwtScaleDraw::getBorderDistHint
void getBorderDistHint(const QFont &, int &start, int &end) const
Determine the minimum border distance.
Definition: qwt_scale_draw.cpp:361
QwtScaleDiv::ticks
QList< double > ticks(int tickType) const
Definition: qwt_scale_div.cpp:309
QwtThermo::PrivateData::scalePosition
QwtThermo::ScalePosition scalePosition
Definition: qwt_thermo.cpp:99
QwtThermo::fillBrush
QBrush fillBrush() const
Definition: qwt_thermo.cpp:731
QwtThermo::setOrigin
void setOrigin(double)
Specifies the custom origin.
Definition: qwt_thermo.cpp:491
QwtThermo::rangeFlags
QwtInterval::BorderFlags rangeFlags() const
Definition: qwt_thermo.cpp:170
QwtThermo::PrivateData::rangeFlags
QwtInterval::BorderFlags rangeFlags
Definition: qwt_thermo.cpp:105
QwtThermo::PrivateData::~PrivateData
~PrivateData()
Definition: qwt_thermo.cpp:93
QwtInterval
A class representing an interval.
Definition: qwt_interval.h:22
QwtThermo::setValue
virtual void setValue(double)
Definition: qwt_thermo.cpp:181
QwtScaleDiv::NTickTypes
@ NTickTypes
Number of valid tick types.
Definition: qwt_scale_div.h:52
update
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
qwt_scale_map.h
QwtThermo::TrailingScale
@ TrailingScale
The scale is left of a vertical or above of a horizontal slider.
Definition: qwt_thermo.h:82
range_format::map
@ map
QwtColorMap::color
QColor color(const QwtInterval &, double value) const
Definition: qwt_color_map.h:248
QwtThermo::originMode
OriginMode originMode
Definition: qwt_thermo.h:57
QwtScaleDraw::TopScale
@ TopScale
The scale is above.
Definition: qwt_scale_draw.h:48
QwtThermo::ScalePosition
ScalePosition
Definition: qwt_thermo.h:73
QwtThermo::PrivateData::alarmLevel
double alarmLevel
Definition: qwt_thermo.cpp:106
QwtAbstractScale::scaleDiv
const QwtScaleDiv & scaleDiv() const
Definition: qwt_abstract_scale.cpp:349
QwtThermo::pipeWidth
int pipeWidth
Definition: qwt_thermo.h:64
qwt_color_map.h
QwtThermo::PrivateData::borderWidth
int borderWidth
Definition: qwt_thermo.cpp:102
QwtThermo
The Thermometer Widget.
Definition: qwt_thermo.h:46
QwtThermo::setOrientation
void setOrientation(Qt::Orientation)
Set the orientation.
Definition: qwt_thermo.cpp:432
QwtThermo::setPipeWidth
void setPipeWidth(int)
Definition: qwt_thermo.cpp:800
qwt_scale_draw.h
QwtThermo::scalePosition
ScalePosition scalePosition
Definition: qwt_thermo.h:56
QwtScaleDraw::move
void move(double x, double y)
Definition: qwt_scale_draw.h:118
QwtThermo::setFillBrush
void setFillBrush(const QBrush &)
Change the brush of the liquid.
Definition: qwt_thermo.cpp:720
QwtThermo::setOriginMode
void setOriginMode(OriginMode)
Change how the origin is determined.
Definition: qwt_thermo.cpp:464
QwtThermo::scaleChange
virtual void scaleChange() QWT_OVERRIDE
Notify a scale change.
Definition: qwt_thermo.cpp:536
QwtInterval::ExcludeMinimum
@ ExcludeMinimum
Min value is not included in the interval.
Definition: qwt_interval.h:49
QwtThermo::PrivateData::orientation
Qt::Orientation orientation
Definition: qwt_thermo.cpp:98
QwtThermo::setRangeFlags
void setRangeFlags(QwtInterval::BorderFlags)
Exclude/Include min/max values.
Definition: qwt_thermo.cpp:157
QwtThermo::PrivateData
Definition: qwt_thermo.cpp:73
QwtScaleMap::transform
double transform(double s) const
Definition: qwt_scale_map.h:137
QwtThermo::setSpacing
void setSpacing(int)
Change the spacing between pipe and scale.
Definition: qwt_thermo.cpp:629
QwtThermo::alarmLevel
double alarmLevel
Definition: qwt_thermo.h:60
QwtScaleDraw::minLength
int minLength(const QFont &) const
Definition: qwt_scale_draw.cpp:560
QwtThermo::setScalePosition
void setScalePosition(ScalePosition)
Change the position of the scale.
Definition: qwt_thermo.cpp:515
QwtThermo::setAlarmLevel
void setAlarmLevel(double)
Definition: qwt_thermo.cpp:775
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:26
sort
static int sort(lua_State *L)
Definition: ltablib.c:398
QwtThermo::sizeHint
virtual QSize sizeHint() const QWT_OVERRIDE
Definition: qwt_thermo.cpp:846
QwtThermo::PrivateData::autoFillPipe
bool autoFillPipe
Definition: qwt_thermo.cpp:108
QwtScaleDraw::BottomScale
@ BottomScale
The scale is below.
Definition: qwt_scale_draw.h:45
QwtThermo::changeEvent
virtual void changeEvent(QEvent *) QWT_OVERRIDE
Definition: qwt_thermo.cpp:277
QwtThermo::paintEvent
virtual void paintEvent(QPaintEvent *) QWT_OVERRIDE
Definition: qwt_thermo.cpp:235
QwtThermo::LeadingScale
@ LeadingScale
The scale is right of a vertical or below of a horizontal slider.
Definition: qwt_thermo.h:79
QwtAbstractScale::abstractScaleDraw
const QwtAbstractScaleDraw * abstractScaleDraw() const
Definition: qwt_abstract_scale.cpp:293
QwtInterval::IncludeBorders
@ IncludeBorders
Min/Max values are inside the interval.
Definition: qwt_interval.h:46
QwtInterval::normalized
QwtInterval normalized() const
Normalize the limits of the interval.
Definition: qwt_interval.cpp:29
QwtThermo::alarmRect
QRect alarmRect(const QRect &) const
Calculate the alarm rectangle of the pipe.
Definition: qwt_thermo.cpp:944
QwtThermo::resizeEvent
virtual void resizeEvent(QResizeEvent *) QWT_OVERRIDE
Definition: qwt_thermo.cpp:267
QwtInterval::maxValue
double maxValue() const
Definition: qwt_interval.h:198
QwtThermo::setAlarmEnabled
void setAlarmEnabled(bool)
Enable or disable the alarm threshold.
Definition: qwt_thermo.cpp:825
qwtCeil
int qwtCeil(qreal value)
Definition: qwt_math.h:266
QwtThermo::orientation
Qt::Orientation orientation
Definition: qwt_thermo.h:54
QwtColorMap
QwtColorMap is used to map values into colors.
Definition: qwt_color_map.h:37
QwtScaleDiv::MinorTick
@ MinorTick
Minor ticks.
Definition: qwt_scale_div.h:43
QwtScaleDiv
A class representing a scale division.
Definition: qwt_scale_div.h:33
QwtThermo::spacing
int spacing
Definition: qwt_thermo.h:62
QwtThermo::PrivateData::pipeWidth
int pipeWidth
Definition: qwt_thermo.cpp:103
QwtThermo::NoScale
@ NoScale
The slider has no scale.
Definition: qwt_thermo.h:76
qwt_thermo.h
QwtScaleDraw::setAlignment
void setAlignment(Alignment)
Definition: qwt_scale_draw.cpp:322
QwtThermo::PrivateData::PrivateData
PrivateData()
Definition: qwt_thermo.cpp:76
QwtScaleDiv::interval
QwtInterval interval() const
Definition: qwt_scale_div.cpp:111
QwtScaleDraw::setLength
void setLength(double length)
Definition: qwt_scale_draw.cpp:732
QwtThermo::drawLiquid
virtual void drawLiquid(QPainter *, const QRect &) const
Definition: qwt_thermo.cpp:546
QwtThermo::setAlarmBrush
void setAlarmBrush(const QBrush &)
Specify the liquid brush above the alarm threshold.
Definition: qwt_thermo.cpp:747
QwtThermo::layoutThermo
void layoutThermo(bool)
Definition: qwt_thermo.cpp:299
QwtThermo::QwtThermo
QwtThermo(QWidget *parent=NULL)
Definition: qwt_thermo.cpp:121
qwtTickList
static QVector< double > qwtTickList(const QwtScaleDiv &scaleDiv)
Definition: qwt_thermo.cpp:43


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