<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">Den 5 feb. 2018 3:20 em skrev "Elvis Stansvik" <<a href="mailto:elvis.stansvik@orexplore.com">elvis.stansvik@orexplore.com</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
My pointy-haired boss got a new laptop with a high-DPI monitor, and<br>
started using a fractional DPI scaling factor (under KDE screen<br>
settings). He's now reporting that our Qt/VTK app has problems with<br>
this. The VTK windows are not correctly sized.<br>
<br>
I've also gotten the same report from a Windows 10 user that had this problem.<br>
<br>
I had a look at the VTK code that sizes the render window [1]:<br>
<br>
  const int devicePixelRatio_ = this->devicePixelRatio();<br>
  const QSize widgetSize = this->size();<br>
  const QSize deviceSize = widgetSize * devicePixelRatio_;<br>
<br>
and then<br>
<br>
  this->RenderWindow->SetSize(<wbr>deviceSize.width(), deviceSize.height());<br>
<br>
Note the use of the int devicePixelRatio() API, not qreal<br>
devicePixelRatioF() (available from Qt 5.6).<br>
<br>
Does this mean there's no way to get correctly sized VTK windows when<br>
using a fractional DPI scaling factor? If so, has anyone looked into<br>
supporting this? Would it be a lot of work?<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Noone knows? :)</div><div dir="auto"><br></div><div dir="auto">If it's (like I suspect) currently not supported, I'd be willing to try to fix it myself. But it would be good to know whether there are dragons here (maybe that's why it's not supported yet) or if someone else is already working on it.</div><div dir="auto"><br></div><div dir="auto">Elvis</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Best regards,<br>
Elvis<br>
<br>
[1] <a href="https://gitlab.kitware.com/vtk/vtk/blob/master/GUISupport/Qt/QVTKOpenGLWidget.cxx#L340-351" rel="noreferrer" target="_blank">https://gitlab.kitware.com/<wbr>vtk/vtk/blob/master/<wbr>GUISupport/Qt/<wbr>QVTKOpenGLWidget.cxx#L340-351</a><br>
</blockquote></div><br></div></div></div>