@@ -127,6 +127,7 @@ void PlotWindow1D::setSettings(QVariantMap settings) {
127127 this ->panel ->spinBoxLine ->setValue (this ->line );
128128
129129 this ->dataCursorEnabled = settings.value (PLOT1D_DATA_CURSOR, false ).toBool ();
130+ this ->plotArea ->setDataCursorMode (this ->dataCursorEnabled );
130131 if (this ->dataCursorEnabled ) {
131132 this ->plotArea ->setCursor (Qt::CrossCursor);
132133 } else {
@@ -492,6 +493,7 @@ void PlotWindow1D::enableBitshift(bool enable) {
492493
493494void PlotWindow1D::toggleDualCoordinates (bool enabled) {
494495 this ->dataCursorEnabled = enabled;
496+ this ->plotArea ->setDataCursorMode (enabled);
495497 if (enabled){
496498 this ->plotArea ->setCursor (Qt::CrossCursor);
497499 } else {
@@ -669,7 +671,8 @@ void StatsLabel::enterEvent(QEvent *event) {
669671// ---------------------- PlotArea1D Implementation ----------------------
670672PlotArea1D::PlotArea1D (QWidget *parent) : QCustomPlot(parent),
671673 draggingLegend(false ),
672- showInfoInLegend(false )
674+ showInfoInLegend(false ),
675+ dataCursorEnabled(false )
673676{
674677 this ->rawLineName = tr (" Raw Line" );
675678 this ->processedLineName = tr (" A-scan" );
@@ -953,6 +956,8 @@ void PlotArea1D::mouseMoveEvent(QMouseEvent* event) {
953956 // Cursor handling
954957 if (this ->legend ->selectTest (event->pos (), false ) > 0 ) {
955958 this ->setCursor (Qt::OpenHandCursor);
959+ } else if (this ->dataCursorEnabled ) {
960+ this ->setCursor (Qt::CrossCursor);
956961 } else {
957962 this ->unsetCursor ();
958963 }
@@ -968,6 +973,8 @@ void PlotArea1D::mouseReleaseEvent(QMouseEvent *event) {
968973 // Restore cursor
969974 if (this ->legend ->selectTest (event->pos (), false ) > 0 ) {
970975 this ->setCursor (Qt::OpenHandCursor);
976+ } else if (this ->dataCursorEnabled ) {
977+ this ->setCursor (Qt::CrossCursor);
971978 } else {
972979 this ->unsetCursor ();
973980 }
0 commit comments