Skip to content
Permalink
Browse files

Move connect from construction for maptoolidentify.

  • Loading branch information
ismailsunni committed Mar 15, 2020
1 parent b134c77 commit 6211fe2c5b972aacc58ecb7532fadfaa513277ab
@@ -128,7 +128,7 @@ Qgs3DMapCanvasDockWidget::Qgs3DMapCanvasDockWidget( QWidget *parent )

mMapToolIdentify = new Qgs3DMapToolIdentify( mCanvas );

mMapToolMeasureLine = new Qgs3DMapToolMeasureLine( mCanvas );
// mMapToolMeasureLine = new Qgs3DMapToolMeasureLine( mCanvas );

mLabelPendingJobs = new QLabel( this );
mProgressPendingJobs = new QProgressBar( this );
@@ -223,6 +223,9 @@ void Qgs3DMapCanvasDockWidget::setMapSettings( Qgs3DMapSettings *map )

connect( mCanvas->scene(), &Qgs3DMapScene::totalPendingJobsCountChanged, this, &Qgs3DMapCanvasDockWidget::onTotalPendingJobsCountChanged );

// Update the connection after the map is updated
mMapToolIdentify->updateSignalSlots();

mAnimationWidget->setCameraController( mCanvas->scene()->cameraController() );
mAnimationWidget->setMap( map );

@@ -63,7 +63,7 @@ void Qgs3DMapToolIdentifyPickHandler::handlePickOnVectorLayer( QgsVectorLayer *v
Qgs3DMapToolIdentify::Qgs3DMapToolIdentify( Qgs3DMapCanvas *canvas )
: Qgs3DMapTool( canvas )
{
connect( mCanvas->scene(), &Qgs3DMapScene::terrainEntityChanged, this, &Qgs3DMapToolIdentify::onTerrainEntityChanged );
// connect( mCanvas->scene(), &Qgs3DMapScene::terrainEntityChanged, this, &Qgs3DMapToolIdentify::onTerrainEntityChanged );

mPickHandler.reset( new Qgs3DMapToolIdentifyPickHandler( this ) );
}
@@ -104,6 +104,11 @@ QCursor Qgs3DMapToolIdentify::cursor() const
return QgsApplication::getThemeCursor( QgsApplication::Cursor::Identify );
}

void Qgs3DMapToolIdentify::updateSignalSlots()
{
connect( mCanvas->scene(), &Qgs3DMapScene::terrainEntityChanged, this, &Qgs3DMapToolIdentify::onTerrainEntityChanged );
}

void Qgs3DMapToolIdentify::onTerrainPicked( Qt3DRender::QPickEvent *event )
{
if ( event->button() != Qt3DRender::QPickEvent::LeftButton )
@@ -45,9 +45,13 @@ class Qgs3DMapToolIdentify : public Qgs3DMapTool

QCursor cursor() const override;

void updateSignalSlots();

public slots:
void onTerrainEntityChanged();

private slots:
void onTerrainPicked( Qt3DRender::QPickEvent *event );
void onTerrainEntityChanged();

private:
std::unique_ptr<Qgs3DMapToolIdentifyPickHandler> mPickHandler;

0 comments on commit 6211fe2

Please sign in to comment.
You can’t perform that action at this time.