qwt_plot_legenditem.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_plot_legenditem.h"
11 #include "qwt_dyngrid_layout.h"
12 #include "qwt_text.h"
13 #include "qwt_graphic.h"
14 #include "qwt_legend_data.h"
15 #include "qwt_math.h"
16 
17 #include <qlayoutitem.h>
18 #include <qpen.h>
19 #include <qbrush.h>
20 #include <qpainter.h>
21 
22 namespace
23 {
24  class LayoutItem QWT_FINAL : public QLayoutItem
25  {
26  public:
27  LayoutItem( const QwtPlotLegendItem*, const QwtPlotItem* );
28  virtual ~LayoutItem();
29 
30  const QwtPlotItem* plotItem() const;
31 
32  void setData( const QwtLegendData& );
33  const QwtLegendData& data() const;
34 
35  virtual Qt::Orientations expandingDirections() const QWT_OVERRIDE;
36  virtual QRect geometry() const QWT_OVERRIDE;
37  virtual bool hasHeightForWidth() const QWT_OVERRIDE;
38  virtual int heightForWidth( int ) const QWT_OVERRIDE;
39  virtual bool isEmpty() const QWT_OVERRIDE;
40  virtual QSize maximumSize() const QWT_OVERRIDE;
41  virtual int minimumHeightForWidth( int ) const QWT_OVERRIDE;
42  virtual QSize minimumSize() const QWT_OVERRIDE;
43  virtual void setGeometry( const QRect& ) QWT_OVERRIDE;
44  virtual QSize sizeHint() const QWT_OVERRIDE;
45 
46  private:
47 
48  const QwtPlotLegendItem* m_legendItem;
49  const QwtPlotItem* m_plotItem;
50  QwtLegendData m_data;
51 
52  QRect m_rect;
53  };
54 
55  LayoutItem::LayoutItem(
56  const QwtPlotLegendItem* legendItem, const QwtPlotItem* plotItem )
57  : m_legendItem( legendItem )
58  , m_plotItem( plotItem)
59  {
60  }
61 
62  LayoutItem::~LayoutItem()
63  {
64  }
65 
66  const QwtPlotItem* LayoutItem::plotItem() const
67  {
68  return m_plotItem;
69  }
70 
71  void LayoutItem::setData( const QwtLegendData& data )
72  {
73  m_data = data;
74  }
75 
76  const QwtLegendData& LayoutItem::data() const
77  {
78  return m_data;
79  }
80 
81  Qt::Orientations LayoutItem::expandingDirections() const
82  {
83  return Qt::Horizontal;
84  }
85 
86  bool LayoutItem::hasHeightForWidth() const
87  {
88  return !m_data.title().isEmpty();
89  }
90 
91  int LayoutItem::minimumHeightForWidth( int w ) const
92  {
93  return m_legendItem->heightForWidth( m_data, w );
94  }
95 
96  int LayoutItem::heightForWidth( int w ) const
97  {
98  return m_legendItem->heightForWidth( m_data, w );
99  }
100 
101  bool LayoutItem::isEmpty() const
102  {
103  return false;
104  }
105 
106  QSize LayoutItem::maximumSize() const
107  {
108  return QSize( QLAYOUTSIZE_MAX, QLAYOUTSIZE_MAX );
109  }
110 
111  QSize LayoutItem::minimumSize() const
112  {
113  return m_legendItem->minimumSize( m_data );
114  }
115 
116  QSize LayoutItem::sizeHint() const
117  {
118  return minimumSize();
119  }
120 
121  void LayoutItem::setGeometry( const QRect& rect )
122  {
123  m_rect = rect;
124  }
125 
126  QRect LayoutItem::geometry() const
127  {
128  return m_rect;
129  }
130 }
131 
133 {
134  public:
136  : itemMargin( 4 )
137  , itemSpacing( 4 )
138  , borderRadius( 0.0 )
139  , borderPen( Qt::NoPen )
140  , backgroundBrush( Qt::NoBrush )
142  , canvasAlignment( Qt::AlignRight | Qt::AlignBottom )
143  {
144  canvasOffset[ 0 ] = canvasOffset[1] = 10;
145  layout = new QwtDynGridLayout();
146  layout->setMaxColumns( 2 );
147 
148  layout->setSpacing( 0 );
149  layout->setContentsMargins( 0, 0, 0, 0 );
150  }
151 
153  {
154  delete layout;
155  }
156 
157  QFont font;
158  QPen textPen;
161 
162  double borderRadius;
163  QPen borderPen;
166 
167  int canvasOffset[2];
168  Qt::Alignment canvasAlignment;
169 
172 };
173 
176  : QwtPlotItem( QwtText( "Legend" ) )
177 {
178  m_data = new PrivateData;
179 
181  setZ( 100.0 );
182 }
183 
186 {
187  clearLegend();
188  delete m_data;
189 }
190 
193 {
195 }
196 
210 void QwtPlotLegendItem::setAlignmentInCanvas( Qt::Alignment alignment )
211 {
212  if ( m_data->canvasAlignment != alignment )
213  {
214  m_data->canvasAlignment = alignment;
215  itemChanged();
216  }
217 }
218 
224 {
225  return m_data->canvasAlignment;
226 }
227 
238 void QwtPlotLegendItem::setMaxColumns( uint maxColumns )
239 {
240  if ( maxColumns != m_data->layout->maxColumns() )
241  {
243  itemChanged();
244  }
245 }
246 
252 {
253  return m_data->layout->maxColumns();
254 }
255 
265 {
266  margin = qMax( margin, 0 );
267  if ( margin != this->margin() )
268  {
269  m_data->layout->setContentsMargins(
270  margin, margin, margin, margin );
271 
272  itemChanged();
273  }
274 }
275 
281 {
282  int left;
283  m_data->layout->getContentsMargins( &left, NULL, NULL, NULL );
284 
285  return left;
286 }
287 
294 void QwtPlotLegendItem::setSpacing( int spacing )
295 {
296  spacing = qMax( spacing, 0 );
297  if ( spacing != m_data->layout->spacing() )
298  {
299  m_data->layout->setSpacing( spacing );
300  itemChanged();
301  }
302 }
303 
309 {
310  return m_data->layout->spacing();
311 }
312 
320 {
321  margin = qMax( margin, 0 );
322  if ( margin != m_data->itemMargin )
323  {
325 
327  itemChanged();
328  }
329 }
330 
336 {
337  return m_data->itemMargin;
338 }
339 
347 {
348  spacing = qMax( spacing, 0 );
349  if ( spacing != m_data->itemSpacing )
350  {
352 
354  itemChanged();
355  }
356 
357 }
358 
364 {
365  return m_data->itemSpacing;
366 }
367 
374 void QwtPlotLegendItem::setFont( const QFont& font )
375 {
376  if ( font != m_data->font )
377  {
378  m_data->font = font;
379 
381  itemChanged();
382  }
383 }
384 
390 {
391  return m_data->font;
392 }
393 
406  Qt::Orientations orientations, int numPixels )
407 {
408  if ( numPixels < 0 )
409  numPixels = -1;
410 
411  bool isChanged = false;
412 
413  int* offset = m_data->canvasOffset;
414 
415  if ( orientations & Qt::Horizontal )
416  {
417  if ( numPixels != offset[0] )
418  {
419  offset[0] = numPixels;
420  isChanged = true;
421  }
422  }
423 
424  if ( orientations & Qt::Vertical )
425  {
426  if ( numPixels != offset[1] )
427  {
428  offset[1] = numPixels;
429  isChanged = true;
430  }
431  }
432 
433  if ( isChanged )
434  itemChanged();
435 }
436 
445  Qt::Orientation orientation ) const
446 {
447  const int index = ( orientation == Qt::Vertical ) ? 1 : 0;
448  return m_data->canvasOffset[index];
449 }
450 
458 {
459  radius = qwtMaxF( 0.0, radius );
460 
461  if ( radius != m_data->borderRadius )
462  {
463  m_data->borderRadius = radius;
464  itemChanged();
465  }
466 }
467 
473 {
474  return m_data->borderRadius;
475 }
476 
483 void QwtPlotLegendItem::setBorderPen( const QPen& pen )
484 {
485  if ( m_data->borderPen != pen )
486  {
487  m_data->borderPen = pen;
488  itemChanged();
489  }
490 }
491 
497 {
498  return m_data->borderPen;
499 }
500 
509 void QwtPlotLegendItem::setBackgroundBrush( const QBrush& brush )
510 {
511  if ( m_data->backgroundBrush != brush )
512  {
513  m_data->backgroundBrush = brush;
514  itemChanged();
515  }
516 }
517 
523 {
524  return m_data->backgroundBrush;
525 }
526 
538 {
539  if ( mode != m_data->backgroundMode )
540  {
541  m_data->backgroundMode = mode;
542  itemChanged();
543  }
544 }
545 
551 {
552  return m_data->backgroundMode;
553 }
554 
561 void QwtPlotLegendItem::setTextPen( const QPen& pen )
562 {
563  if ( m_data->textPen != pen )
564  {
565  m_data->textPen = pen;
566  itemChanged();
567  }
568 }
569 
575 {
576  return m_data->textPen;
577 }
578 
587 void QwtPlotLegendItem::draw( QPainter* painter,
588  const QwtScaleMap& xMap, const QwtScaleMap& yMap,
589  const QRectF& canvasRect ) const
590 {
591  Q_UNUSED( xMap );
592  Q_UNUSED( yMap );
593 
594  m_data->layout->setGeometry( geometry( canvasRect ) );
595  if ( m_data->layout->geometry().isEmpty() )
596  {
597  // don't draw a legend when having no content
598  return;
599  }
600 
602  drawBackground( painter, m_data->layout->geometry() );
603 
604  for ( int i = 0; i < m_data->layout->count(); i++ )
605  {
606  const LayoutItem* layoutItem =
607  static_cast< LayoutItem* >( m_data->layout->itemAt( i ) );
608 
610  drawBackground( painter, layoutItem->geometry() );
611 
612  painter->save();
613 
614  drawLegendData( painter, layoutItem->plotItem(),
615  layoutItem->data(), layoutItem->geometry() );
616 
617  painter->restore();
618  }
619 }
620 
631  QPainter* painter, const QRectF& rect ) const
632 {
633  painter->save();
634 
635  painter->setPen( m_data->borderPen );
636  painter->setBrush( m_data->backgroundBrush );
637 
638  const double radius = m_data->borderRadius;
639  painter->drawRoundedRect( rect, radius, radius );
640 
641  painter->restore();
642 }
643 
650 QRect QwtPlotLegendItem::geometry( const QRectF& canvasRect ) const
651 {
652  QRect rect;
653  rect.setSize( m_data->layout->sizeHint() );
654 
655  if ( m_data->canvasAlignment & Qt::AlignHCenter )
656  {
657  int x = qRound( canvasRect.center().x() );
658  rect.moveCenter( QPoint( x, rect.center().y() ) );
659  }
660  else if ( m_data->canvasAlignment & Qt::AlignRight )
661  {
662  const int offset = offsetInCanvas( Qt::Horizontal );
663  rect.moveRight( qwtFloor( canvasRect.right() - offset ) );
664  }
665  else
666  {
667  const int offset = offsetInCanvas( Qt::Horizontal );
668  rect.moveLeft( qwtCeil( canvasRect.left() + offset ) );
669  }
670 
671  if ( m_data->canvasAlignment & Qt::AlignVCenter )
672  {
673  int y = qRound( canvasRect.center().y() );
674  rect.moveCenter( QPoint( rect.center().x(), y ) );
675  }
676  else if ( m_data->canvasAlignment & Qt::AlignBottom )
677  {
678  const int offset = offsetInCanvas( Qt::Vertical );
679  rect.moveBottom( qwtFloor( canvasRect.bottom() - offset ) );
680  }
681  else
682  {
683  const int offset = offsetInCanvas( Qt::Vertical );
684  rect.moveTop( qwtCeil( canvasRect.top() + offset ) );
685  }
686 
687  return rect;
688 }
689 
699 {
700  if ( plotItem == NULL )
701  return;
702 
703  QList< LayoutItem* > layoutItems;
704 
706  m_data->map.constFind( plotItem );
707  if ( it != m_data->map.constEnd() )
708  layoutItems = it.value();
709 
710  bool changed = false;
711 
712  if ( data.size() != layoutItems.size() )
713  {
714  changed = true;
715 
716  for ( int i = 0; i < layoutItems.size(); i++ )
717  {
718  m_data->layout->removeItem( layoutItems[i] );
719  delete layoutItems[i];
720  }
721  layoutItems.clear();
722 
723  if ( it != m_data->map.constEnd() )
724  m_data->map.remove( plotItem );
725 
726  if ( !data.isEmpty() )
727  {
728  layoutItems.reserve( data.size() );
729 
730  for ( int i = 0; i < data.size(); i++ )
731  {
732  LayoutItem* layoutItem =
733  new LayoutItem( this, plotItem );
734  m_data->layout->addItem( layoutItem );
735  layoutItems += layoutItem;
736  }
737 
738  m_data->map.insert( plotItem, layoutItems );
739  }
740  }
741 
742  for ( int i = 0; i < data.size(); i++ )
743  {
744  if ( layoutItems[i]->data().values() != data[i].values() )
745  {
746  layoutItems[i]->setData( data[i] );
747  changed = true;
748  }
749  }
750 
751  if ( changed )
752  {
754  itemChanged();
755  }
756 }
757 
760 {
761  if ( !m_data->map.isEmpty() )
762  {
763  m_data->map.clear();
764 
765  for ( int i = m_data->layout->count() - 1; i >= 0; i-- )
766  delete m_data->layout->takeAt( i );
767 
768  itemChanged();
769  }
770 }
771 
780 void QwtPlotLegendItem::drawLegendData( QPainter* painter,
781  const QwtPlotItem* plotItem, const QwtLegendData& data,
782  const QRectF& rect ) const
783 {
784  Q_UNUSED( plotItem );
785 
786  const int m = m_data->itemMargin;
787  const QRectF r = rect.toRect().adjusted( m, m, -m, -m );
788 
789  painter->setClipRect( r, Qt::IntersectClip );
790 
791  int titleOff = 0;
792 
793  const QwtGraphic graphic = data.icon();
794  if ( !graphic.isEmpty() )
795  {
796  QRectF iconRect( r.topLeft(), graphic.defaultSize() );
797 
798  iconRect.moveCenter(
799  QPoint( iconRect.center().x(), rect.center().y() ) );
800 
801  graphic.render( painter, iconRect, Qt::KeepAspectRatio );
802 
803  titleOff += iconRect.width() + m_data->itemSpacing;
804  }
805 
806  const QwtText text = data.title();
807  if ( !text.isEmpty() )
808  {
809  painter->setPen( textPen() );
810  painter->setFont( font() );
811 
812  const QRectF textRect = r.adjusted( titleOff, 0, 0, 0 );
813  text.draw( painter, textRect );
814  }
815 }
816 
824 {
825  QSize size( 2 * m_data->itemMargin, 2 * m_data->itemMargin );
826 
827  if ( !data.isValid() )
828  return size;
829 
830  const QwtGraphic graphic = data.icon();
831  const QwtText text = data.title();
832 
833  int w = 0;
834  int h = 0;
835 
836  if ( !graphic.isNull() )
837  {
838  w = graphic.width();
839  h = graphic.height();
840  }
841 
842  if ( !text.isEmpty() )
843  {
844  const QSizeF sz = text.textSize( font() );
845 
846  w += qwtCeil( sz.width() );
847  h = qMax( h, qwtCeil( sz.height() ) );
848  }
849 
850  if ( graphic.width() > 0 && !text.isEmpty() )
851  w += m_data->itemSpacing;
852 
853  size += QSize( w, h );
854  return size;
855 }
856 
863  const QwtLegendData& data, int width ) const
864 {
865  width -= 2 * m_data->itemMargin;
866 
867  const QwtGraphic graphic = data.icon();
868  const QwtText text = data.title();
869 
870  if ( text.isEmpty() )
871  return graphic.height();
872 
873  if ( graphic.width() > 0 )
874  width -= graphic.width() + m_data->itemSpacing;
875 
876  int h = text.heightForWidth( width, font() );
877  h += 2 * m_data->itemMargin;
878 
879  return qMax( graphic.height(), h );
880 }
881 
887 {
888  return m_data->map.keys();
889 }
890 
896  const QwtPlotItem* plotItem ) const
897 {
898  QList< LayoutItem* > layoutItems;
899 
901  m_data->map.constFind( plotItem );
902  if ( it != m_data->map.constEnd() )
903  layoutItems = it.value();
904 
905  QList< QRect > geometries;
906  geometries.reserve(layoutItems.size() );
907 
908  for ( int i = 0; i < layoutItems.size(); i++ )
909  geometries += layoutItems[i]->geometry();
910 
911  return geometries;
912 }
QwtPlotLegendItem::PrivateData::~PrivateData
~PrivateData()
Definition: qwt_plot_legenditem.cpp:152
QWT_FINAL
#define QWT_FINAL
Definition: qwt_global.h:57
QwtPlotLegendItem::spacing
int spacing() const
Definition: qwt_plot_legenditem.cpp:308
qwt_graphic.h
left
lu_byte left
Definition: lparser.c:1226
QwtLegendData
Attributes of an entry on a legend.
Definition: qwt_legend_data.h:36
QwtPlotLegendItem::backgroundMode
BackgroundMode backgroundMode() const
Definition: qwt_plot_legenditem.cpp:550
QwtDynGridLayout::takeAt
virtual QLayoutItem * takeAt(int index) QWT_OVERRIDE
Definition: qwt_dyngrid_layout.cpp:172
QwtDynGridLayout::maxColumns
uint maxColumns() const
Return the upper limit for the number of columns.
Definition: qwt_dyngrid_layout.cpp:119
QwtPlotItem::setItemInterest
void setItemInterest(ItemInterest, bool on=true)
Definition: qwt_plot_item.cpp:279
QwtGraphic::defaultSize
QSizeF defaultSize() const
Default size.
Definition: qwt_graphic.cpp:574
QwtPlotItem::Rtti_PlotLegend
@ Rtti_PlotLegend
For QwtPlotLegendItem.
Definition: qwt_plot_item.h:87
QwtPlotLegendItem::maxColumns
uint maxColumns() const
Definition: qwt_plot_legenditem.cpp:251
QwtPlotLegendItem
A class which draws a legend inside the plot canvas.
Definition: qwt_plot_legenditem.h:41
QwtDynGridLayout::isEmpty
virtual bool isEmpty() const QWT_OVERRIDE
Definition: qwt_dyngrid_layout.cpp:137
QwtPlotLegendItem::BackgroundMode
BackgroundMode
Background mode.
Definition: qwt_plot_legenditem.h:54
QwtDynGridLayout::invalidate
virtual void invalidate() QWT_OVERRIDE
Invalidate all internal caches.
Definition: qwt_dyngrid_layout.cpp:95
QwtPlotLegendItem::legendGeometries
QList< QRect > legendGeometries(const QwtPlotItem *) const
Definition: qwt_plot_legenditem.cpp:895
QwtPlotLegendItem::PrivateData::backgroundBrush
QBrush backgroundBrush
Definition: qwt_plot_legenditem.cpp:164
QwtPlotLegendItem::itemMargin
int itemMargin() const
Definition: qwt_plot_legenditem.cpp:335
QwtPlotLegendItem::LegendBackground
@ LegendBackground
The legend has a background.
Definition: qwt_plot_legenditem.h:57
QwtPlotLegendItem::setBackgroundBrush
void setBackgroundBrush(const QBrush &)
Set the background brush.
Definition: qwt_plot_legenditem.cpp:509
QwtPlotLegendItem::setMargin
void setMargin(int)
Set the margin around legend items.
Definition: qwt_plot_legenditem.cpp:264
QwtGraphic::isEmpty
bool isEmpty() const
Definition: qwt_graphic.cpp:422
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:75
QwtPlotLegendItem::PrivateData::map
QMap< const QwtPlotItem *, QList< LayoutItem * > > map
Definition: qwt_plot_legenditem.cpp:170
QwtPlotLegendItem::setMaxColumns
void setMaxColumns(uint)
Limit the number of columns.
Definition: qwt_plot_legenditem.cpp:238
QwtPlotLegendItem::setBackgroundMode
void setBackgroundMode(BackgroundMode)
Set the background mode.
Definition: qwt_plot_legenditem.cpp:537
QwtPlotLegendItem::setItemSpacing
void setItemSpacing(int)
Definition: qwt_plot_legenditem.cpp:346
QwtPlotLegendItem::setSpacing
void setSpacing(int)
Set the spacing between the legend items.
Definition: qwt_plot_legenditem.cpp:294
QwtPlotLegendItem::clearLegend
void clearLegend()
Remove all items from the legend.
Definition: qwt_plot_legenditem.cpp:759
QwtPlotLegendItem::ItemBackground
@ ItemBackground
Each item has a background.
Definition: qwt_plot_legenditem.h:60
QwtPlotLegendItem::margin
int margin() const
Definition: qwt_plot_legenditem.cpp:280
mqtt_test_proto.x
x
Definition: mqtt_test_proto.py:34
QwtPlotLegendItem::alignmentInCanvas
Qt::Alignment alignmentInCanvas() const
Definition: qwt_plot_legenditem.cpp:223
QwtPlotLegendItem::heightForWidth
virtual int heightForWidth(const QwtLegendData &, int width) const
Definition: qwt_plot_legenditem.cpp:862
QList
Definition: qwt_abstract_legend.h:17
QwtPlotLegendItem::m_data
PrivateData * m_data
Definition: qwt_plot_legenditem.h:131
qwt_math.h
qwt_legend_data.h
QwtPlotLegendItem::borderRadius
double borderRadius() const
Definition: qwt_plot_legenditem.cpp:472
QwtPlotLegendItem::setAlignmentInCanvas
void setAlignmentInCanvas(Qt::Alignment)
Set the alignmnet.
Definition: qwt_plot_legenditem.cpp:210
QwtPlotLegendItem::updateLegend
virtual void updateLegend(const QwtPlotItem *, const QList< QwtLegendData > &) QWT_OVERRIDE
Definition: qwt_plot_legenditem.cpp:697
QwtPlotLegendItem::PrivateData::PrivateData
PrivateData()
Definition: qwt_plot_legenditem.cpp:135
mqtt_test_proto.y
y
Definition: mqtt_test_proto.py:35
qwt_plot_legenditem.h
QwtPlotLegendItem::setFont
void setFont(const QFont &)
Definition: qwt_plot_legenditem.cpp:374
QwtPlotLegendItem::~QwtPlotLegendItem
virtual ~QwtPlotLegendItem()
Destructor.
Definition: qwt_plot_legenditem.cpp:185
QwtDynGridLayout::sizeHint
virtual QSize sizeHint() const QWT_OVERRIDE
Definition: qwt_dyngrid_layout.cpp:550
QMap
Definition: qwt_compass.h:19
QwtPlotLegendItem::itemSpacing
int itemSpacing() const
Definition: qwt_plot_legenditem.cpp:363
QwtPlotLegendItem::draw
virtual void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const QWT_OVERRIDE
Definition: qwt_plot_legenditem.cpp:587
nonstd::span_lite::size
span_constexpr std::size_t size(span< T, Extent > const &spn)
Definition: span.hpp:1554
QwtDynGridLayout::addItem
virtual void addItem(QLayoutItem *) QWT_OVERRIDE
Add an item to the next free position.
Definition: qwt_dyngrid_layout.cpp:128
QwtPlotLegendItem::backgroundBrush
QBrush backgroundBrush() const
Definition: qwt_plot_legenditem.cpp:522
QwtPlotLegendItem::PrivateData::layout
QwtDynGridLayout * layout
Definition: qwt_plot_legenditem.cpp:171
QwtDynGridLayout::setMaxColumns
void setMaxColumns(uint maxColumns)
Definition: qwt_dyngrid_layout.cpp:106
QwtText
A class representing a text.
Definition: qwt_text.h:51
QwtPlotLegendItem::setTextPen
void setTextPen(const QPen &)
Set the pen for drawing text labels.
Definition: qwt_plot_legenditem.cpp:561
QwtPlotLegendItem::textPen
QPen textPen() const
Definition: qwt_plot_legenditem.cpp:574
QwtPlotLegendItem::plotItems
QList< const QwtPlotItem * > plotItems() const
Definition: qwt_plot_legenditem.cpp:886
qwtMaxF
QWT_CONSTEXPR float qwtMaxF(float a, float b)
Definition: qwt_math.h:127
QwtPlotLegendItem::setBorderRadius
void setBorderRadius(double)
Definition: qwt_plot_legenditem.cpp:457
QwtPlotItem::setZ
void setZ(double z)
Set the z value.
Definition: qwt_plot_item.cpp:165
QwtPlotLegendItem::rtti
virtual int rtti() const QWT_OVERRIDE
Definition: qwt_plot_legenditem.cpp:192
QwtPlotLegendItem::PrivateData::canvasAlignment
Qt::Alignment canvasAlignment
Definition: qwt_plot_legenditem.cpp:168
QwtPlotLegendItem::PrivateData::itemSpacing
int itemSpacing
Definition: qwt_plot_legenditem.cpp:160
QwtPlotLegendItem::setBorderPen
void setBorderPen(const QPen &)
Definition: qwt_plot_legenditem.cpp:483
QwtPlotItem
Base class for items on the plot canvas.
Definition: qwt_plot_item.h:66
QwtPlotLegendItem::setOffsetInCanvas
void setOffsetInCanvas(Qt::Orientations, int numPixels)
Set the distance between the legend and the canvas border.
Definition: qwt_plot_legenditem.cpp:405
QwtPlotLegendItem::drawLegendData
virtual void drawLegendData(QPainter *, const QwtPlotItem *, const QwtLegendData &, const QRectF &) const
Definition: qwt_plot_legenditem.cpp:780
QwtPlotLegendItem::borderPen
QPen borderPen() const
Definition: qwt_plot_legenditem.cpp:496
QwtPlotLegendItem::PrivateData::font
QFont font
Definition: qwt_plot_legenditem.cpp:157
QwtPlotLegendItem::PrivateData::textPen
QPen textPen
Definition: qwt_plot_legenditem.cpp:158
QwtPlotItem::itemChanged
virtual void itemChanged()
Definition: qwt_plot_item.cpp:481
qwt_dyngrid_layout.h
QwtScaleMap
A scale map.
Definition: qwt_scale_map.h:26
QwtPlotLegendItem::PrivateData::borderPen
QPen borderPen
Definition: qwt_plot_legenditem.cpp:163
QwtPlotLegendItem::PrivateData::borderRadius
double borderRadius
Definition: qwt_plot_legenditem.cpp:162
QwtGraphic::isNull
bool isNull() const
Definition: qwt_graphic.cpp:413
QwtDynGridLayout::itemAt
virtual QLayoutItem * itemAt(int index) const QWT_OVERRIDE
Definition: qwt_dyngrid_layout.cpp:157
QwtPlotLegendItem::PrivateData::canvasOffset
int canvasOffset[2]
Definition: qwt_plot_legenditem.cpp:167
qwtFloor
int qwtFloor(qreal value)
Definition: qwt_math.h:275
QwtPlotLegendItem::PrivateData
Definition: qwt_plot_legenditem.cpp:132
QWT_OVERRIDE
#define QWT_OVERRIDE
Definition: qwt_global.h:53
mqtt_test.data
dictionary data
Definition: mqtt_test.py:22
qwtCeil
int qwtCeil(qreal value)
Definition: qwt_math.h:266
QwtPlotItem::LegendInterest
@ LegendInterest
Definition: qwt_plot_item.h:197
QwtPlotLegendItem::PrivateData::itemMargin
int itemMargin
Definition: qwt_plot_legenditem.cpp:159
QwtDynGridLayout::count
virtual int count() const QWT_OVERRIDE
Definition: qwt_dyngrid_layout.cpp:182
QwtPlotLegendItem::setItemMargin
void setItemMargin(int)
Definition: qwt_plot_legenditem.cpp:319
QwtDynGridLayout
The QwtDynGridLayout class lays out widgets in a grid, adjusting the number of columns and rows to th...
Definition: qwt_dyngrid_layout.h:27
QwtPlotLegendItem::QwtPlotLegendItem
QwtPlotLegendItem()
Constructor.
Definition: qwt_plot_legenditem.cpp:175
QwtPlotLegendItem::drawBackground
virtual void drawBackground(QPainter *, const QRectF &rect) const
Definition: qwt_plot_legenditem.cpp:630
QwtPlotLegendItem::geometry
virtual QRect geometry(const QRectF &canvasRect) const
Definition: qwt_plot_legenditem.cpp:650
qwt_text.h
QwtPlotLegendItem::PrivateData::backgroundMode
QwtPlotLegendItem::BackgroundMode backgroundMode
Definition: qwt_plot_legenditem.cpp:165
QwtPlotLegendItem::offsetInCanvas
int offsetInCanvas(Qt::Orientation) const
Definition: qwt_plot_legenditem.cpp:444
QwtDynGridLayout::setGeometry
virtual void setGeometry(const QRect &) QWT_OVERRIDE
Definition: qwt_dyngrid_layout.cpp:222
QwtPlotLegendItem::font
QFont font() const
Definition: qwt_plot_legenditem.cpp:389
QwtPlotLegendItem::minimumSize
virtual QSize minimumSize(const QwtLegendData &) const
Definition: qwt_plot_legenditem.cpp:823
QwtGraphic::render
void render(QPainter *) const
Replay all recorded painter commands.
Definition: qwt_graphic.cpp:624


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