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

Method axisSelectionChanged

qcustomplot.cpp:19903–19921  ·  view source on GitHub ↗

! \internal This slot is connected to the selectionChanged signals of the four axes in the constructor. It synchronizes the selection state of the axes. */

Source from the content-addressed store, hash-verified

19901 synchronizes the selection state of the axes.
19902*/
19903void QCPColorScaleAxisRectPrivate::axisSelectionChanged(QCPAxis::SelectableParts selectedParts)
19904{
19905 // axis bases of four axes shall always (de-)selected synchronously:
19906 QList<QCPAxis::AxisType> allAxisTypes = QList<QCPAxis::AxisType>() << QCPAxis::atBottom << QCPAxis::atTop << QCPAxis::atLeft << QCPAxis::atRight;
19907 foreach (QCPAxis::AxisType type, allAxisTypes)
19908 {
19909 if (QCPAxis *senderAxis = qobject_cast<QCPAxis*>(sender()))
19910 if (senderAxis->axisType() == type)
19911 continue;
19912
19913 if (axis(type)->selectableParts().testFlag(QCPAxis::spAxis))
19914 {
19915 if (selectedParts.testFlag(QCPAxis::spAxis))
19916 axis(type)->setSelectedParts(axis(type)->selectedParts() | QCPAxis::spAxis);
19917 else
19918 axis(type)->setSelectedParts(axis(type)->selectedParts() & ~QCPAxis::spAxis);
19919 }
19920 }
19921}
19922
19923/*! \internal
19924

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected