Hi Matthias,

did you already try to get the position of the parent QWidget? See [1].

Best,
Stefan

[1] http://doc.qt.io/qt-5/qwidget.html#mapToGlobal

From: Noll, Matthias [mailto:[email protected]]
Sent: Mittwoch, 31. Oktober 2018 10:21
To: [email protected]
Subject: [mitk-users] How to obtain mitk render window screen positions

Hi everybody,

I was wondering if somebody knows how to obtain the screen position of an mitk 
render window e.g. the 3D render window (stdmulti.widget4, 3d)
I've already tried to obtain the position the following two ways

1:
vtkRenderWindow *renderWindow = 
mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget4");
auto pos = renderWindow->GetPosition();
std::cout << "posx " << pos[0] << "posy " << pos[1] << std::endl;

2:
mitk::IRenderWindowPart *renderWindowPart = GetRenderWindowPart();
auto qrwin = renderWindowPart->GetQmitkRenderWindow("3d");
auto qpoint = qrwin ->pos();
std::cout << "posx1 " << pos[0] << "posy1 " << pos[1] << std::endl;

Both ways result produce coordinates (0,0) every time, which should not be the 
case?

Any help would be appreciated,
Matthias
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to