KChart

KChartLeveyJenningsDiagram.cpp
1 /*
2  * Copyright (C) 2001-2015 Klaralvdalens Datakonsult AB. All rights reserved.
3  *
4  * This file is part of the KD Chart library.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
20 #include "KChartLeveyJenningsDiagram.h"
21 #include "KChartLeveyJenningsDiagram_p.h"
22 
23 #include "KChartChart.h"
24 #include "KChartTextAttributes.h"
25 #include "KChartAbstractGrid.h"
26 #include "KChartPainterSaver_p.h"
27 
28 #include <QDateTime>
29 #include <QFontMetrics>
30 #include <QPainter>
31 #include <QSvgRenderer>
32 #include <QVector>
33 
34 using namespace KChart;
35 using namespace std;
36 
37 LeveyJenningsDiagram::Private::Private()
38 {
39 }
40 
41 LeveyJenningsDiagram::Private::~Private() {}
42 
43 
44 #define d d_func()
45 
46 
47 LeveyJenningsDiagram::LeveyJenningsDiagram( QWidget* parent, LeveyJenningsCoordinatePlane* plane )
48  : LineDiagram( new Private(), parent, plane )
49 {
50  init();
51 }
52 
53 void LeveyJenningsDiagram::init()
54 {
55  d->lotChangedPosition = Qt::AlignTop;
56  d->fluidicsPackChangedPosition = Qt::AlignBottom;
57  d->sensorChangedPosition = Qt::AlignBottom;
58 
59  d->scanLinePen = QPen( Qt::blue );
60  setPen( d->scanLinePen );
61 
62  d->expectedMeanValue = 0.0;
63  d->expectedStandardDeviation = 0.0;
64 
65  d->diagram = this;
66 
67  d->icons[ LotChanged ] = QString::fromLatin1( ":/KDE/kchart/LeveyJennings/karo_black.svg" );
68  d->icons[ SensorChanged ] = QString::fromLatin1( ":/KDE/kchart/LeveyJennings/karo_red.svg" );
69  d->icons[ FluidicsPackChanged ] = QString::fromLatin1( ":/KDE/kchart/LeveyJennings/karo_blue.svg" );
70  d->icons[ OkDataPoint ] = QString::fromLatin1( ":/KDE/kchart/LeveyJennings/circle_blue.svg" );
71  d->icons[ NotOkDataPoint ] = QString::fromLatin1( ":/KDE/kchart/LeveyJennings/circle_blue_red.svg" );
72 
73  setSelectionMode( QAbstractItemView::SingleSelection );
74 }
75 
76 LeveyJenningsDiagram::~LeveyJenningsDiagram()
77 {
78 }
79 
81 {
82  LeveyJenningsDiagram* newDiagram = new LeveyJenningsDiagram( new Private( *d ) );
83  return newDiagram;
84 }
85 
87 {
88  if ( other == this ) return true;
89  if ( ! other ) {
90  return false;
91  }
92  /*
93  qDebug() <<"\n LineDiagram::compare():";
94  // compare own properties
95  qDebug() << (type() == other->type());
96  */
97  return // compare the base class
98  ( static_cast<const LineDiagram*>(this)->compare( other ) );
99 }
100 
102 {
103  if ( d->lotChangedPosition == pos )
104  return;
105 
106  d->lotChangedPosition = pos;
107  update();
108 }
109 
111 {
112  return d->lotChangedPosition;
113 }
114 
116 {
117  if ( d->fluidicsPackChangedPosition == pos )
118  return;
119 
120  d->fluidicsPackChangedPosition = pos;
121  update();
122 }
123 
125 {
126  return d->fluidicsPackChangedPosition;
127 }
128 
130 {
131  if ( d->sensorChangedPosition == pos )
132  return;
133 
134  d->sensorChangedPosition = pos;
135  update();
136 }
137 
139 {
140  return d->sensorChangedPosition;
141 }
142 
144 {
145  if ( d->fluidicsPackChanges == changes )
146  return;
147 
148  d->fluidicsPackChanges = changes;
149  update();
150 }
151 
153 {
154  return d->fluidicsPackChanges;
155 }
156 
158 {
159  if ( d->sensorChanges == changes )
160  return;
161 
162  d->sensorChanges = changes;
163  update();
164 }
165 
167 {
168  if ( d->scanLinePen == pen )
169  return;
170 
171  d->scanLinePen = pen;
172  update();
173 }
174 
176 {
177  return d->scanLinePen;
178 }
179 
180 QString LeveyJenningsDiagram::symbol( Symbol symbol ) const
181 {
182  return d->icons[ symbol ];
183 }
184 
185 void LeveyJenningsDiagram::setSymbol( Symbol symbol, const QString& filename )
186 {
187  if ( d->icons[ symbol ] == filename )
188  return;
189 
190  delete d->iconRenderer[ symbol ];
191  d->iconRenderer[ symbol ] = nullptr;
192 
193  d->icons[ symbol ] = filename;
194 
195  update();
196 }
197 
199 {
200  return d->sensorChanges;
201 }
202 
204 {
205  if ( d->expectedMeanValue == meanValue )
206  return;
207 
208  d->expectedMeanValue = meanValue;
209  d->setYAxisRange();
210  update();
211 }
212 
214 {
215  return d->expectedMeanValue;
216 }
217 
219 {
220  if ( d->expectedStandardDeviation == sd )
221  return;
222 
223  d->expectedStandardDeviation = sd;
224  d->setYAxisRange();
225  update();
226 }
227 
229 {
230  return d->expectedStandardDeviation;
231 }
232 
234 {
235  return d->calculatedMeanValue;
236 }
237 
239 {
240  return d->calculatedStandardDeviation;
241 }
242 
243 void LeveyJenningsDiagram::setModel( QAbstractItemModel* model )
244 {
245  if ( this->model() != nullptr )
246  {
247  disconnect( this->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
248  this, SLOT(calculateMeanAndStandardDeviation()) );
249  disconnect( this->model(), SIGNAL(rowsInserted(QModelIndex,int,int)),
250  this, SLOT(calculateMeanAndStandardDeviation()) );
251  disconnect( this->model(), SIGNAL(rowsRemoved(QModelIndex,int,int)),
252  this, SLOT(calculateMeanAndStandardDeviation()) );
253  disconnect( this->model(), SIGNAL(columnsInserted(QModelIndex,int,int)),
254  this, SLOT(calculateMeanAndStandardDeviation()) );
255  disconnect( this->model(), SIGNAL(columnsRemoved(QModelIndex,int,int)),
256  this, SLOT(calculateMeanAndStandardDeviation()) );
257  disconnect( this->model(), SIGNAL(modelReset()),
258  this, SLOT(calculateMeanAndStandardDeviation()) );
259  disconnect( this->model(), SIGNAL(layoutChanged()),
260  this, SLOT(calculateMeanAndStandardDeviation()) );
261  }
262  LineDiagram::setModel( model );
263  if ( this->model() != nullptr )
264  {
265  connect( this->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)),
266  this, SLOT(calculateMeanAndStandardDeviation()) );
267  connect( this->model(), SIGNAL(rowsInserted(QModelIndex,int,int)),
268  this, SLOT(calculateMeanAndStandardDeviation()) );
269  connect( this->model(), SIGNAL(rowsRemoved(QModelIndex,int,int)),
270  this, SLOT(calculateMeanAndStandardDeviation()) );
271  connect( this->model(), SIGNAL(columnsInserted(QModelIndex,int,int)),
272  this, SLOT(calculateMeanAndStandardDeviation()) );
273  connect( this->model(), SIGNAL(columnsRemoved(QModelIndex,int,int)),
274  this, SLOT(calculateMeanAndStandardDeviation()) );
275  connect( this->model(), SIGNAL(modelReset()),
276  this, SLOT(calculateMeanAndStandardDeviation()) );
277  connect( this->model(), SIGNAL(layoutChanged()),
278  this, SLOT(calculateMeanAndStandardDeviation()) );
279 
280  calculateMeanAndStandardDeviation();
281  }
282 }
283 
284 // TODO: This is the 'easy' solution
285 // evaluate whether this is enough or we need some better one or even boost here
286 void LeveyJenningsDiagram::calculateMeanAndStandardDeviation() const
287 {
289  // first fetch all values
290  const QAbstractItemModel& m = *model();
291  const int rowCount = m.rowCount( rootIndex() );
292 
293  for ( int row = 0; row < rowCount; ++row )
294  {
295  const QVariant var = m.data( m.index( row, 1, rootIndex() ) );
296  if ( !var.isValid() )
297  continue;
298  const qreal value = var.toReal();
299  if ( ISNAN( value ) )
300  continue;
301  values << value;
302  }
303 
304  qreal sum = 0.0;
305  qreal sumSquares = 0.0;
306  for ( qreal value : qAsConst(values) )
307  {
308  sum += value;
309  sumSquares += value * value;
310  }
311 
312  const int N = values.count();
313 
314  d->calculatedMeanValue = sum / N;
315  d->calculatedStandardDeviation = sqrt( ( static_cast< qreal >( N ) * sumSquares - sum * sum ) / ( N * ( N - 1 ) ) );
316 }
317 
318 // calculates the largest QDate not greater than \a dt.
319 static QDate floorDay( const QDateTime& dt )
320 {
321  return dt.date();
322 }
323 
324 // calculates the smallest QDate not less than \a dt.
325 static QDate ceilDay( const QDateTime& dt )
326 {
327  QDate result = dt.date();
328 
329  if ( QDateTime( result, QTime() ) < dt )
330  result = result.addDays( 1 );
331 
332  return result;
333 }
334 
335 // calculates the largest QDateTime like xx:00 not greater than \a dt.
336 static QDateTime floorHour( const QDateTime& dt )
337 {
338  return QDateTime( dt.date(), QTime( dt.time().hour(), 0 ) );
339 }
340 
341 // calculates the smallest QDateTime like xx:00 not less than \a dt.
342 static QDateTime ceilHour( const QDateTime& dt )
343 {
344  QDateTime result( dt.date(), QTime( dt.time().hour(), 0 ) );
345 
346  if ( result < dt )
347  result = result.addSecs( 3600 );
348 
349  return result;
350 }
351 
353 {
354  const qreal yMin = d->expectedMeanValue - 4 * d->expectedStandardDeviation;
355  const qreal yMax = d->expectedMeanValue + 4 * d->expectedStandardDeviation;
356 
357  d->setYAxisRange();
358 
359  // rounded down/up to the prev/next midnight (at least that's the default)
360  const QPair< QDateTime, QDateTime > range = timeRange();
361  const unsigned int minTime = range.first.toSecsSinceEpoch();
362  const unsigned int maxTime = range.second.toSecsSinceEpoch();
363 
364  const qreal xMin = minTime / static_cast< qreal >( 24 * 60 * 60 );
365  const qreal xMax = maxTime / static_cast< qreal >( 24 * 60 * 60 ) - xMin;
366 
367  const QPointF bottomLeft( QPointF( 0, yMin ) );
368  const QPointF topRight( QPointF( xMax, yMax ) );
369 
370  return QPair< QPointF, QPointF >( bottomLeft, topRight );
371 }
372 
374 {
375  if ( d->timeRange != QPair< QDateTime, QDateTime >() )
376  return d->timeRange;
377 
378  const QAbstractItemModel& m = *model();
379  const int rowCount = m.rowCount( rootIndex() );
380 
381  const QDateTime begin = m.data( m.index( 0, 3, rootIndex() ) ).toDateTime();
382  const QDateTime end = m.data( m.index( rowCount - 1, 3, rootIndex() ) ).toDateTime();
383 
384  if ( begin.secsTo( end ) > 86400 )
385  {
386  // if begin to end is more than 24h
387  // round down/up to the prev/next midnight
388  const QDate min = floorDay( begin );
389  const QDate max = ceilDay( end );
390  return QPair< QDateTime, QDateTime >( QDateTime( min, QTime() ), QDateTime( max, QTime() ) );
391  }
392  else if ( begin.secsTo( end ) > 3600 )
393  {
394  // more than 1h: rond down up to the prex/next hour
395  // if begin to end is more than 24h
396  const QDateTime min = floorHour( begin );
397  const QDateTime max = ceilHour( end );
398  return QPair< QDateTime, QDateTime >( min, max );
399  }
400  return QPair< QDateTime, QDateTime >( begin, end );
401 }
402 
404 {
405  if ( d->timeRange == timeRange )
406  return;
407 
408  d->timeRange = timeRange;
409  update();
410 }
411 
413 {
414  const unsigned int minTime = timeRange().first.toSecsSinceEpoch();
415 
416  for ( const QDateTime& dt : qAsConst(d->fluidicsPackChanges) )
417  {
418  const qreal xValue = ( dt.toSecsSinceEpoch() - minTime ) / static_cast< qreal >( 24 * 60 * 60 );
419  const QPointF point( xValue, 0.0 );
420  drawFluidicsPackChangedSymbol( ctx, point );
421  }
422 
423  for ( const QDateTime& dt : qAsConst(d->sensorChanges) )
424  {
425  const qreal xValue = ( dt.toSecsSinceEpoch() - minTime ) / static_cast< qreal >( 24 * 60 * 60 );
426  const QPointF point( xValue, 0.0 );
427  drawSensorChangedSymbol( ctx, point );
428  }
429 }
430 
432 {
433  d->reverseMapper.clear();
434 
435  // note: Not having any data model assigned is no bug
436  // but we can not draw a diagram then either.
437  if ( !checkInvariants( true ) ) return;
438  if ( !AbstractGrid::isBoundariesValid(dataBoundaries()) ) return;
439 
440  QPainter* const painter = ctx->painter();
441  const PainterSaver p( painter );
442  if ( model()->rowCount( rootIndex() ) == 0 || model()->columnCount( rootIndex() ) < 4 )
443  return; // nothing to paint for us
444 
445  AbstractCoordinatePlane* const plane = ctx->coordinatePlane();
446  ctx->setCoordinatePlane( plane->sharedAxisMasterPlane( painter ) );
447 
448  const QAbstractItemModel& m = *model();
449  const int rowCount = m.rowCount( rootIndex() );
450 
451  const unsigned int minTime = timeRange().first.toSecsSinceEpoch();
452 
453  painter->setRenderHint( QPainter::Antialiasing, true );
454 
455  int prevLot = -1;
456  QPointF prevPoint;
457  bool hadMissingValue = false;
458 
459  for ( int row = 0; row < rowCount; ++row )
460  {
461  const QModelIndex lotIndex = m.index( row, 0, rootIndex() );
462  const QModelIndex valueIndex = m.index( row, 1, rootIndex() );
463  const QModelIndex okIndex = m.index( row, 2, rootIndex() );
464  const QModelIndex timeIndex = m.index( row, 3, rootIndex() );
465  const QModelIndex expectedMeanIndex = m.index( row, 4, rootIndex() );
466  const QModelIndex expectedSDIndex = m.index( row, 5, rootIndex() );
467 
468  painter->setPen( pen( lotIndex ) );
469 
470  QVariant vValue = m.data( valueIndex );
471  qreal value = vValue.toReal();
472  const int lot = m.data( lotIndex ).toInt();
473  const bool ok = m.data( okIndex ).toBool();
474  const QDateTime time = m.data( timeIndex ).toDateTime();
475  const qreal xValue = ( time.toSecsSinceEpoch() - minTime ) / static_cast< qreal >( 24 * 60 * 60 );
476 
477  QVariant vExpectedMean = m.data( expectedMeanIndex );
478  const qreal expectedMean = vExpectedMean.toReal();
479  QVariant vExpectedSD = m.data( expectedSDIndex );
480  const qreal expectedSD = vExpectedSD.toReal();
481 
482  QPointF point = ctx->coordinatePlane()->translate( QPointF( xValue, value ) );
483 
484  if ( vValue.isNull() )
485  {
486  hadMissingValue = true;
487  }
488  else
489  {
490  if ( !vExpectedMean.isNull() && !vExpectedSD.isNull() )
491  {
492  // this calculates the 'logical' value relative to the expected mean and SD of this point
493  value -= expectedMean;
494  value /= expectedSD;
495  value *= d->expectedStandardDeviation;
496  value += d->expectedMeanValue;
497  point = ctx->coordinatePlane()->translate( QPointF( xValue, value ) );
498  }
499 
500  if ( prevLot == lot )
501  {
502  const QPen pen = painter->pen();
503  QPen newPen = pen;
504 
505  if ( hadMissingValue )
506  {
507  newPen.setDashPattern( QVector< qreal >() << 4.0 << 4.0 );
508  }
509 
510  painter->setPen( newPen );
511  painter->drawLine( prevPoint, point );
512  painter->setPen( pen );
513  // d->reverseMapper.addLine( valueIndex.row(), valueIndex.column(), prevPoint, point );
514  }
515  else if ( row > 0 )
516  {
517  drawLotChangeSymbol( ctx, QPointF( xValue, value ) );
518  }
519 
520  if ( value <= d->expectedMeanValue + 4 * d->expectedStandardDeviation &&
521  value >= d->expectedMeanValue - 4 * d->expectedStandardDeviation )
522  {
523  const QPointF location( xValue, value );
524  drawDataPointSymbol( ctx, location, ok );
525  d->reverseMapper.addCircle( valueIndex.row(),
526  valueIndex.column(),
527  ctx->coordinatePlane()->translate( location ),
528  iconRect().size() );
529  }
530  prevLot = lot;
531  prevPoint = point;
532  hadMissingValue = false;
533  }
534 
535  const QModelIndex current = selectionModel()->currentIndex();
536  if ( selectionModel()->rowIntersectsSelection( lotIndex.row(), lotIndex.parent() ) || current.sibling( current.row(), 0 ) == lotIndex )
537  {
538  const QPen pen = ctx->painter()->pen();
539  painter->setPen( d->scanLinePen );
540  painter->drawLine( ctx->coordinatePlane()->translate( QPointF( xValue, d->expectedMeanValue - 4 *
541  d->expectedStandardDeviation ) ),
542  ctx->coordinatePlane()->translate( QPointF( xValue, d->expectedMeanValue + 4 *
543  d->expectedStandardDeviation ) ) );
544  painter->setPen( pen );
545  }
546  }
547 
548  drawChanges( ctx );
549 
550  ctx->setCoordinatePlane( plane );
551 }
552 
554 {
555  const Symbol type = ok ? OkDataPoint : NotOkDataPoint;
556 
557  QPainter* const painter = ctx->painter();
558  const PainterSaver ps( painter );
559  const QPointF transPos = ctx->coordinatePlane()->translate( pos ).toPoint();
560  painter->translate( transPos );
561 
562  painter->setClipping( false );
563  iconRenderer( type )->render( painter, iconRect() );
564 }
565 
567 {
568  const QPointF transPos = ctx->coordinatePlane()->translate(
569  QPointF( pos.x(), d->lotChangedPosition & Qt::AlignTop ? d->expectedMeanValue +
570  4 * d->expectedStandardDeviation
571  : d->expectedMeanValue -
572  4 * d->expectedStandardDeviation ) );
573 
574 
575  QPainter* const painter = ctx->painter();
576  const PainterSaver ps( painter );
577  painter->setClipping( false );
578  painter->translate( transPos );
579  iconRenderer( LotChanged )->render( painter, iconRect() );
580 }
581 
583 {
584  const QPointF transPos = ctx->coordinatePlane()->translate(
585  QPointF( pos.x(), d->sensorChangedPosition & Qt::AlignTop ? d->expectedMeanValue +
586  4 * d->expectedStandardDeviation
587  : d->expectedMeanValue -
588  4 * d->expectedStandardDeviation ) );
589 
590  QPainter* const painter = ctx->painter();
591  const PainterSaver ps( painter );
592  painter->setClipping( false );
593  painter->translate( transPos );
594  iconRenderer( SensorChanged )->render( painter, iconRect() );
595 }
596 
598 {
599  const QPointF transPos = ctx->coordinatePlane()->translate(
600  QPointF( pos.x(), d->fluidicsPackChangedPosition & Qt::AlignTop ? d->expectedMeanValue +
601  4 * d->expectedStandardDeviation
602  : d->expectedMeanValue -
603  4 * d->expectedStandardDeviation ) );
604 
605  QPainter* const painter = ctx->painter();
606  const PainterSaver ps( painter );
607  painter->setClipping( false );
608  painter->translate( transPos );
609  iconRenderer( FluidicsPackChanged )->render( painter, iconRect() );
610 }
611 
613 {
614  const Measure m( 12.5, KChartEnums::MeasureCalculationModeAuto, KChartEnums::MeasureOrientationAuto );
615  TextAttributes test;
616  test.setFontSize( m );
617  const QFontMetrics fm( test.calculatedFont( coordinatePlane()->parent(), KChartEnums::MeasureOrientationAuto ) );
618  const qreal height = fm.height() / 1.2;
619  return QRectF( -height / 2.0, -height / 2.0, height, height );
620 }
621 
623 {
624  if ( d->iconRenderer[ symbol ] == nullptr )
625  d->iconRenderer[ symbol ] = new QSvgRenderer( d->icons[ symbol ], this );
626 
627  return d->iconRenderer[ symbol ];
628 }
LineDiagram * clone() const override
Creates an exact copy of this diagram.
Qt::Alignment lotChangedSymbolPosition() const
Returns the position of the lot change symbol.
virtual void drawLotChangeSymbol(PaintContext *paintContext, const QPointF &pos)
Draws a lot changed symbol for the data point at pos.
Class only listed here to document inheritance of some KChart classes.
virtual int rowCount(const QModelIndex &parent) const const =0
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const =0
QSvgRenderer * iconRenderer(Symbol symbol)
Returns the SVG icon renderer for symbol.
Levey Jennings coordinate plane This is actually nothing real more than a plain cartesian coordinate ...
void setRenderHint(QPainter::RenderHint hint, bool on)
virtual const QPointF translate(const QPointF &diagramPoint) const =0
Translate the given point in value space coordinates to a position in pixel space.
virtual QRectF iconRect() const
Returns the rectangle being used for drawing the icons.
static bool isBoundariesValid(const QRectF &r)
Checks whether both coordinates of r are valid according to isValueValid.
void update()
Calling update() on the plane triggers the global KChart::Chart::update()
QDateTime toDateTime() const const
LeveyDiagram defines a Levey Jennings chart.
void setClipping(bool enable)
void setTimeRange(const QPair< QDateTime, QDateTime > &timeRange)
Sets the timeRange visible on the x axis.
bool compare(const LeveyJenningsDiagram *other) const
Returns true if both diagrams have the same settings.
bool compare(const AbstractAreaBase *other) const
Returns true if both areas have the same settings.
QTime time() const const
void setSymbol(Symbol symbol, const QString &filename)
Sets the symbol being used for symbol to a SVG file filename.
void drawLine(const QLineF &line)
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
AlignTop
QVector< QDateTime > sensorChanges() const
Returns the list of all sensor changes.
void setLotChangedSymbolPosition(Qt::Alignment pos)
Sets the position of the lot change symbol to pos.
QVector< V > values(const QMultiHash< K, V > &c)
qreal x() const const
void setDashPattern(const QVector< qreal > &pattern)
const QFont calculatedFont(const QObject *autoReferenceArea, KChartEnums::MeasureOrientation autoReferenceOrientation) const
Returns the font in the size that is used at drawing time.
Stores information about painting diagrams.
int toInt(bool *ok) const const
bool isNull() const const
virtual void drawDataPointSymbol(PaintContext *paintContext, const QPointF &pos, bool ok)
Draws a data point symbol for the data point at pos.
Qt::Alignment sensorChangedSymbolPosition() const
Returns the position of the sensor changed symbol.
QString symbol(Symbol symbol) const
Returns the SVG file name usef for symbol.
void setPen(const QColor &color)
void setScanLinePen(const QPen &pen)
Sets the pen used for drawing the scan line to pen.
Base class common for all coordinate planes, CartesianCoordinatePlane, PolarCoordinatePlane, TernaryCoordinatePlane.
virtual void drawSensorChangedSymbol(PaintContext *paintContext, const QPointF &pos)
Draws a sensor changed symbol for the data point at pos.
int row() const const
void setFluidicsPackChangedSymbolPosition(Qt::Alignment pos)
Sets the position of the fluidics pack changed symbol to pos.
virtual QVariant data(const QModelIndex &index, int role) const const =0
float calculatedMeanValue() const
Returns the calculated mean values over all QC values.
QPair< QDateTime, QDateTime > timeRange() const
Returns the timerange of the diagram&#39;s data.
QModelIndex parent() const const
int hour() const const
void setExpectedStandardDeviation(float sd)
Sets the expected standard deviaction over all QC values to sd.
void setFluidicsPackChanges(const QVector< QDateTime > &changes)
Sets the date/time of all fluidics pack changes to changes.
QCA_EXPORT void init()
Qt::Alignment fluidicsPackChangedSymbolPosition() const
Returns the position of the fluidics pack changed symbol.
virtual void drawFluidicsPackChangedSymbol(PaintContext *paintContext, const QPointF &pos)
Draws a fluidics pack changed symbol for the data point at pos.
QDate date() const const
QPoint toPoint() const const
qint64 secsTo(const QDateTime &other) const const
qint64 toSecsSinceEpoch() const const
QModelIndex sibling(int row, int column) const const
void setFontSize(const Measure &measure)
Set the size of the font used for rendering text.
int height() const const
int count(const T &value) const const
int column() const const
bool toBool() const const
void translate(const QPointF &offset)
A set of text attributes.
float calculatedStandardDeviation() const
Returns the calculated standard deviation over all QC values.
QString fromLatin1(const char *str, int size)
bool isValid() const const
float expectedStandardDeviation() const
Returns the expected standard deviation over all QC values.
LineDiagram defines a common line diagram.
QDate addDays(qint64 ndays) const const
qreal toReal(bool *ok) const const
void setSensorChanges(const QVector< QDateTime > &changes)
Sets the date/time of all sensor changes to changes.
QDateTime addSecs(qint64 s) const const
void setSensorChangedSymbolPosition(Qt::Alignment pos)
Sets the position of the sensor changed symbol to pos.
QVector< QDateTime > fluidicsPackChanges() const
Returns the list of all fluidics pack changes.
Global namespace.
void drawChanges(PaintContext *paintContext)
Draws the fluidics pack and sensor changed symbols.
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
const QPen & pen() const const
const QPair< QPointF, QPointF > calculateDataBoundaries() const override
void setExpectedMeanValue(float meanValue)
Sets the expected mean value over all QC values to meanValue.
QPen scanLinePen() const
Returns the pen being used for drawing the scan line.
Measure is used to specify relative and absolute sizes in KChart, e.g.
Definition: KChartMeasure.h:48
void paint(PaintContext *paintContext) override
float expectedMeanValue() const
Returns the expected mean values over all QC values.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Jan 14 2021 22:38:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.