Skip to content

Commit

Permalink
Fix point picking
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jul 21, 2019
1 parent f5840a7 commit 6dc0ab5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions qgssensorinfodialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,8 @@ void QgsSensorInfoDialog::showDiagram()

//plot picker to show tooltips
QwtPlotPicker* plotPicker = new QwtPlotPicker( targetPlot->canvas() );
//plotPicker->setSelectionFlags( QwtPicker::PointSelection | QwtPicker::ClickSelection );
plotPicker->setRubberBand( QwtPlotPicker::RectRubberBand );
connect( plotPicker, SIGNAL( selected( const QwtDoublePoint& ) ), this, SLOT( onDiagramSelected( const QwtDoublePoint& ) ) );
plotPicker->setStateMachine( new QwtPickerClickPointMachine() );
connect( plotPicker, SIGNAL( selected( const QPointF& ) ), this, SLOT( onDiagramSelected( const QPointF& ) ) );

int nPlots = plotList().size();
mTabWidget->addTab( targetPlot, tr( "Plot %1" ).arg( nPlots + 1 ) );
Expand Down Expand Up @@ -308,7 +307,7 @@ QDateTime QgsSensorInfoDialog::convertIntToTime( int t ) const
}
}

void QgsSensorInfoDialog::onDiagramSelected( const QwtDoublePoint &pt )
void QgsSensorInfoDialog::onDiagramSelected( const QPointF& pt )
{
QwtPlot* cPlot = currentPlot();
if( !cPlot )
Expand Down
2 changes: 1 addition & 1 deletion qgssensorinfodialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class QgsSensorInfoDialog: public QDialog, private Ui::QgsSensorInfoDialogBase
void showDiagram();
int convertTimeToInt( const QDateTime& dt ) const;
QDateTime convertIntToTime( int t ) const;
void onDiagramSelected( const QwtDoublePoint &pt );
void onDiagramSelected( const QPointF& pt );
void on_mTabWidget_tabCloseRequested( int index );
void showAllObservables();
void exportToCSV();
Expand Down

0 comments on commit 6dc0ab5

Please sign in to comment.