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

Method drawSubGridLines

qcustomplot/qcustomplot.cpp:7347–7369  ·  view source on GitHub ↗

! \internal Draws the sub grid lines with the specified painter. This is a helper function called by \ref draw. */

Source from the content-addressed store, hash-verified

7345 This is a helper function called by \ref draw.
7346*/
7347void QCPGrid::drawSubGridLines(QCPPainter *painter) const
7348{
7349 if (!mParentAxis) { qDebug() << Q_FUNC_INFO << "invalid parent axis"; return; }
7350
7351 applyAntialiasingHint(painter, mAntialiasedSubGrid, QCP::aeSubGrid);
7352 double t; // helper variable, result of coordinate-to-pixel transforms
7353 painter->setPen(mSubGridPen);
7354 if (mParentAxis->orientation() == Qt::Horizontal)
7355 {
7356 for (int i=0; i<mParentAxis->mSubTickVector.size(); ++i)
7357 {
7358 t = mParentAxis->coordToPixel(mParentAxis->mSubTickVector.at(i)); // x
7359 painter->drawLine(QLineF(t, mParentAxis->mAxisRect->bottom(), t, mParentAxis->mAxisRect->top()));
7360 }
7361 } else
7362 {
7363 for (int i=0; i<mParentAxis->mSubTickVector.size(); ++i)
7364 {
7365 t = mParentAxis->coordToPixel(mParentAxis->mSubTickVector.at(i)); // y
7366 painter->drawLine(QLineF(mParentAxis->mAxisRect->left(), t, mParentAxis->mAxisRect->right(), t));
7367 }
7368 }
7369}
7370
7371
7372////////////////////////////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 5

setPenMethod · 0.80
coordToPixelMethod · 0.80
atMethod · 0.80
drawLineMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected