MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / setTypeX

Method setTypeX

qcustomplot.cpp:11576–11597  ·  view source on GitHub ↗

! This method sets the position type of the X coordinate to \a type. For a detailed description of what a position type is, see the documentation of \ref setType. \see setType, setTypeY */

Source from the content-addressed store, hash-verified

11574 \see setType, setTypeY
11575*/
11576void QCPItemPosition::setTypeX(QCPItemPosition::PositionType type)
11577{
11578 if (mPositionTypeX != type)
11579 {
11580 // if switching from or to coordinate type that isn't valid (e.g. because axes or axis rect
11581 // were deleted), don't try to recover the pixelPosition() because it would output a qDebug warning.
11582 bool retainPixelPosition = true;
11583 if ((mPositionTypeX == ptPlotCoords || type == ptPlotCoords) && (!mKeyAxis || !mValueAxis))
11584 retainPixelPosition = false;
11585 if ((mPositionTypeX == ptAxisRectRatio || type == ptAxisRectRatio) && (!mAxisRect))
11586 retainPixelPosition = false;
11587
11588 QPointF pixel;
11589 if (retainPixelPosition)
11590 pixel = pixelPosition();
11591
11592 mPositionTypeX = type;
11593
11594 if (retainPixelPosition)
11595 setPixelPosition(pixel);
11596 }
11597}
11598
11599/*!
11600 This method sets the position type of the Y coordinate to \a type.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected