@@ -164,9 +164,9 struct VisualizationGraphRenderingDelegate::VisualizationGraphRenderingDelegateP | |||
|
164 | 164 | initClosePixmapStyle(*m_ClosePixmap); |
|
165 | 165 | |
|
166 | 166 | // Connects pixmap selection to graph widget closing |
|
167 |
QObject::connect( |
|
|
168 |
[&graphWidget]( |
|
|
169 |
if ( |
|
|
167 | QObject::connect(&m_Plot, &QCustomPlot::itemClick, | |
|
168 | [&graphWidget, this](auto item, auto mouseEvent) { | |
|
169 | if (item == m_ClosePixmap) { | |
|
170 | 170 | graphWidget.close(); |
|
171 | 171 | } |
|
172 | 172 | }); |
@@ -181,15 +181,14 struct VisualizationGraphRenderingDelegate::VisualizationGraphRenderingDelegateP | |||
|
181 | 181 | initXAxisPixmapStyle(*m_XAxisPixmap); |
|
182 | 182 | |
|
183 | 183 | // Connects pixmap selection to graph x-axis showing/hiding |
|
184 | QObject::connect(m_XAxisPixmap, &QCPItemPixmap::selectionChanged, [this]() { | |
|
185 |
if (m_XAxisPixmap |
|
|
184 | QObject::connect(&m_Plot, &QCustomPlot::itemClick, [this](auto item, auto mouseEvent) { | |
|
185 | if (m_XAxisPixmap == item) { | |
|
186 | 186 | // Changes the selection state and refreshes the x-axis |
|
187 | 187 | m_ShowXAxis = !m_ShowXAxis; |
|
188 | updateXAxisState(); | |
|
188 | this->updateXAxisState(); | |
|
189 | 189 | m_Plot.layer(AXES_LAYER)->replot(); |
|
190 | 190 | |
|
191 | 191 | // Deselects the x-axis pixmap and updates icon |
|
192 | m_XAxisPixmap->setSelected(false); | |
|
193 | 192 | m_XAxisPixmap->setPixmap( |
|
194 | 193 | pixmap(m_ShowXAxis ? HIDE_AXIS_ICON_PATH : SHOW_AXIS_ICON_PATH)); |
|
195 | 194 | m_Plot.layer(OVERLAY_LAYER)->replot(); |
@@ -197,7 +197,7 VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget | |||
|
197 | 197 | // Set qcpplot properties : |
|
198 | 198 | // - zoom is enabled |
|
199 | 199 | // - Mouse wheel on qcpplot is intercepted to determine the zoom orientation |
|
200 |
ui->widget->setInteractions(QCP::iRangeZoom |
|
|
200 | ui->widget->setInteractions(QCP::iRangeZoom); | |
|
201 | 201 | ui->widget->axisRect()->setRangeDrag(Qt::Horizontal | Qt::Vertical); |
|
202 | 202 | |
|
203 | 203 | // The delegate must be initialized after the ui as it uses the plot |
General Comments 0
You need to be logged in to leave comments.
Login now