# Picking in custom (C++) PV application

**URL:** https://discourse.paraview.org/t/picking-in-custom-c-pv-application/16977
**Category:** Development
**Created:** [July 18, 2025, 5:16pm UTC](https://discourse.paraview.org/t/picking-in-custom-c-pv-application/16977 "2025-07-18T17:16:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nenad-vujicic](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nenad-vujicic/32/1969_2.png) [@nenad-vujicic](https://discourse.paraview.org/u/nenad-vujicic)
#### Post date: [July 18, 2025, 5:16pm UTC](https://discourse.paraview.org/t/picking-in-custom-c-pv-application/16977/1 "2025-07-18T17:16:06Z")

</div>

Hello everyone,

I’m developing custom PV based application using C++ (v6.0.0-RC2, Windows, VS2022). I created manually UI (using Qt designer), created several pqRenderView instances (using pqObjectBuilder, I didn’t use PV’s multi-view), created several pqPipelineSources and pqDataRepresentations (using pqObjectBuilder) for every render view, but when I try

pqRenderView::pick() or pqRenderView::select[Points|Cells]OnSurface()

I’m always getting NULL (as a return from pqRenderView::pick()) or the last created data-representation (from pqSelectionManager::getOutputPort()-\>getRepresentation() when doing pqRenderView::select[Points|Cells]OnSurface()). Even if I pick at coordinates where there is nothing .. (of course, if view is empty (i.e. there are no representations inside) I always get NULL).

At the beginning of application I created pqParaViewBehaviors(), but nothing more. Did I miss something to initialize or I should use some other PV way to pick (I hope I don’t need to go to VTK level and use vtk[Point|Cell]Picker)?

Thanks,  
Nenad.

---

<div class="post-metadata">

### Author: ![nenad-vujicic](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nenad-vujicic/32/1969_2.png) [@nenad-vujicic](https://discourse.paraview.org/u/nenad-vujicic)
#### Post date: [July 28, 2025, 1:45pm UTC](https://discourse.paraview.org/t/picking-in-custom-c-pv-application/16977/2 "2025-07-28T13:45:43Z")

</div>

OK, found the _solution_. After adding:

qreal device\_pixel\_ratio = sending\_widget-\>devicePixelRatioF();  
picked\_position[0] = picked\_position[0] \* device\_pixel\_ratio;  
picked\_position[1] = picked\_position[1] \* device\_pixel\_ratio;

everything started working great!

Thanks!  
Nenad.
