<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi all,<br>
    <br>
    so I have realised that its not the QLabel but the QPixmap in
    combination to a vector graphic (svg).<br>
    Below is my test code which works fine on osx but crops the image on
    the right hand side when run under windows.<br>
    The svg was saved with a 200 pixel output resolution in the header,
    and when I check the QPixmap's width it does return 200, still it
    crops the image.<br>
    Do I actually have to start using Qt.QSvgRender for something simple
    like this?<br>
    <br>
    Cheers,<br>
    frank<br>
    <br>
    <br>
    from PySide import QtGui<br>
    def pixmapTest(imgPath):<br>
        l = QtGui.QLabel()<br>
        l.setPixmap(QtGui.QPixmap(imgPath))<br>
        return l<br>
    <br>
    if __name__ == '__main__':<br>
        import sys<br>
        app = QtGui.QApplication([])<br>
        if sys.platform == 'win32':<br>
            imgPath = 'z:/path/to/svg/image.svg'<br>
        else:<br>
            imgPath = '/server/path/path/to/svg/image.svg'<br>
        l = pixmapTest(imgPath)<br>
        l.show()<br>
        sys.exit(app.exec_())<br>
    <br>
    <div class="moz-cite-prefix">On 11/03/16 7:46 pm, Frank Rueter |
      OHUfx wrote:<br>
    </div>
    <blockquote cite="mid:56E269E3.8030709@ohufx.com" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <meta name="qrichtext" content="1">
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hi,
</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">I have been using something like the below code on osx without trouble (simple QLabel with setPixmap to show an svg file from my resource module).
</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">When running the same code on windows, the label crops the image on the right, and I cannot figure out how to make it behave the same as under osx (adjust to the pixmap's size). Even brudte forcing it's width to somethign much larger than the pixmap will still result in a cropped display.</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Does anybody know what might be going on?
</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
Cheers,
frank
</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<!--StartFragment--></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">import common</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">from PySide.QtGui import * # for testing only</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">from PySide.QtCore import * # for testing only

</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">class TestImageLabel(QLabel):</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    def __init__(self, parent=None):</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">        super(TestImageLabel, self).__init__(parent)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">        self.pm = common.IconCache.getPixmap('nuBridge_logo')</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">        self.setPixmap(self.pm)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">    def showEvent(self, e):</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">        super(TestImageLabel, self).showEvent(e)</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">        print self.pm.width()</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">        print self.width()</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">w = TestImageLabel()</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">w.show()</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">

<!--EndFragment--></p>
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css">
p, li { white-space: pre-wrap; }
</style>
      <div class="moz-signature">-- <br>
        <table style="width: 524px; height: 58px;" border="0">
          <tbody>
            <tr>
              <td style="text-align: center;"><a moz-do-not-send="true"
                  href="http://www.ohufx.com"><img
                    src="cid:part1.07050300.04050302@ohufx.com"
                    alt="ohufxLogo 50x50"></a></td>
              <td style="text-align: center;"><strong><span
                    style="font-size: 10pt;"><a moz-do-not-send="true"
                      href="http://ohufx.com/index.php/vfx-compositing">vfx

                      compositing</a></span> | <span style="font-size:
                    10pt;"><strong><a moz-do-not-send="true"
                        href="http://ohufx.com/index.php/vfx-customising">workflow

                        customisation and consulting</a></strong> </span>
                </strong></td>
            </tr>
          </tbody>
        </table>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
PySide mailing list
<a class="moz-txt-link-abbreviated" href="mailto:PySide@qt-project.org">PySide@qt-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.qt-project.org/mailman/listinfo/pyside">http://lists.qt-project.org/mailman/listinfo/pyside</a>
</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <table style="width: 524px; height: 58px;" border="0">
        <tbody>
          <tr>
            <td style="text-align: center;"><a
                href="http://www.ohufx.com"><img
                  src="cid:part5.08000903.04090602@ohufx.com"
                  alt="ohufxLogo 50x50"></a></td>
            <td style="text-align: center;"><strong><span
                  style="font-size: 10pt;"><a
                    href="http://ohufx.com/index.php/vfx-compositing">vfx
                    compositing</a></span> | <span style="font-size:
                  10pt;"><strong><a
                      href="http://ohufx.com/index.php/vfx-customising">workflow
                      customisation and consulting</a></strong> </span>
              </strong></td>
          </tr>
        </tbody>
      </table>
    </div>
  </body>
</html>