MCPcopy Create free account
hub / github.com/KDAB/KDChart / currentIndexChanged

Method currentIndexChanged

examples/demo/axissettings.cpp:70–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void AxisSettings::Private::currentIndexChanged(int index)
71{
72 m_currentAxis = nullptr;
73 const CartesianAxis::Position pos = ( CartesianAxis::Position )ui.axisSelection->itemData(index).toInt();
74 auto *plane = qobject_cast<CartesianCoordinatePlane *>(m_chart->coordinatePlane());
75 auto *diag = qobject_cast<AbstractCartesianDiagram *>(m_chart->coordinatePlane()->diagram());
76 if (plane && diag) {
77 QVector<CartesianAxis *> axes = diag->axes().toVector();
78 Q_FOREACH (CartesianAxis *axis, axes) {
79 if (axis->position() == pos) {
80 m_currentAxis = axis;
81 break;
82 }
83 }
84 }
85 updateUiForCurrentAxis();
86}
87
88void AxisSettings::Private::updateUiForCurrentAxis()
89{

Callers 1

diagramTypeChangedMethod · 0.80

Calls 3

coordinatePlaneMethod · 0.45
diagramMethod · 0.45
axesMethod · 0.45

Tested by

no test coverage detected