##// END OF EJS Templates
Calls 'close graph' action when selecting close item in overlay
Alexandre Leroux -
r727:b6674f74bf0c
parent child
Show More
@@ -90,6 +90,15 struct VisualizationGraphRenderingDelegate::VisualizationGraphRenderingDelegateP
90 90 // Inits "close button" in plot overlay
91 91 m_ClosePixmap->setLayer(OVERLAY_LAYER);
92 92 initClosePixmapStyle(*m_ClosePixmap);
93
94 // Connects pixmap selection to graph widget closing
95 QObject::connect(m_ClosePixmap, &QCPItemPixmap::selectionChanged,
96 [&graphWidget](bool selected) {
97 if (selected) {
98 graphWidget.close();
99 }
100 });
101
93 102 // Inits graph name in plot overlay
94 103 m_TitleText->setLayer(OVERLAY_LAYER);
95 104 m_TitleText->setText(graphWidget.name());
@@ -59,7 +59,7 VisualizationGraphWidget::VisualizationGraphWidget(const QString &name, QWidget
59 59 // Set qcpplot properties :
60 60 // - Drag (on x-axis) and zoom are enabled
61 61 // - Mouse wheel on qcpplot is intercepted to determine the zoom orientation
62 ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
62 ui->widget->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectItems);
63 63 ui->widget->axisRect()->setRangeDrag(Qt::Horizontal);
64 64
65 65 // 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