<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi Elvis,</p>
    <p>I have a workaround for this in my own code: Basically I have a
      subclass of QVTKOpenGLWidget, which disables the base class DPI
      support and passes Qt's DPI value manually to the internal
      vtkRenderWindow. See
<a class="moz-txt-link-freetext" href="https://github.com/kateyy/geohazardvis/blob/master/gui/data_view/t_QVTKWidget.cpp">https://github.com/kateyy/geohazardvis/blob/master/gui/data_view/t_QVTKWidget.cpp</a>
      especially lines 288 and 306.</p>
    <p>(In the code, don't get confused about the name of the class, it
      provides some support to inherit from QVTKWidget2, but you can
      assume OPTION_USE_QVTKOPENGLWIDGET to be enabled.)</p>
    <p>Cheers,<br>
      Karsten<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 09-02-18 08:43, Elvis Stansvik
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAE-7VJ=9y_hpxXH6wKVoCY1BukZE+XLv+y4mys8CejggcmwT=Q@mail.gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <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"
                moz-do-not-send="true">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"
                  moz-do-not-send="true">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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Search the list archives at: <a class="moz-txt-link-freetext" href="http://markmail.org/search/?q=vtk-developers">http://markmail.org/search/?q=vtk-developers</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="https://vtk.org/mailman/listinfo/vtk-developers">https://vtk.org/mailman/listinfo/vtk-developers</a>

</pre>
    </blockquote>
    <br>
  </body>
</html>