MCPcopy Create free account
hub / github.com/CieNTi/serial_port_plotter / size

Method size

qcustomplot/qcustomplot.cpp:9416–9447  ·  view source on GitHub ↗

! \internal Returns the size ("margin" in QCPAxisRect context, so measured perpendicular to the axis backbone direction) needed to fit the axis. */

Source from the content-addressed store, hash-verified

9414 direction) needed to fit the axis.
9415*/
9416int QCPAxisPainterPrivate::size() const
9417{
9418 int result = 0;
9419
9420 // get length of tick marks pointing outwards:
9421 if (!tickPositions.isEmpty())
9422 result += qMax(0, qMax(tickLengthOut, subTickLengthOut));
9423
9424 // calculate size of tick labels:
9425 if (tickLabelSide == QCPAxis::lsOutside)
9426 {
9427 QSize tickLabelsSize(0, 0);
9428 if (!tickLabels.isEmpty())
9429 {
9430 for (int i=0; i<tickLabels.size(); ++i)
9431 getMaxTickLabelSize(tickLabelFont, tickLabels.at(i), &tickLabelsSize);
9432 result += QCPAxis::orientation(type) == Qt::Horizontal ? tickLabelsSize.height() : tickLabelsSize.width();
9433 result += tickLabelPadding;
9434 }
9435 }
9436
9437 // calculate size of axis label (only height needed, because left/right labels are rotated by 90 degrees):
9438 if (!label.isEmpty())
9439 {
9440 QFontMetrics fontMetrics(labelFont);
9441 QRect bounds;
9442 bounds = fontMetrics.boundingRect(0, 0, 0, 0, Qt::TextDontClip | Qt::AlignHCenter | Qt::AlignVCenter, label);
9443 result += bounds.height() + labelPadding;
9444 }
9445
9446 return result;
9447}
9448
9449/*! \internal
9450

Callers 15

createUIMethod · 0.45
onNewDataArrivedMethod · 0.45
reallocateBufferMethod · 0.45
operator==Method · 0.45
qcustomplot.cppFile · 0.45
dataPointCountMethod · 0.45
dataRangeMethod · 0.45
simplifyMethod · 0.45
enforceTypeMethod · 0.45
containsMethod · 0.45
intersectionMethod · 0.45
inverseMethod · 0.45

Calls 3

orientationFunction · 0.85
atMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected