I can't get my svg file to render it's alpha mask.

maxIcon16.svg:
Qt Code:
  1. <svg baseProfile="tiny" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
  2. <defs>
  3. <mask id="maskedRect1">
  4. <path d="m4,2h10v10h-10z" fill="#fff"/>
  5. <path d="m5,3h8v8h-8z"/>
  6. <path d="m3,5h8v8h-8z"/>
  7. </mask>
  8. <mask id="maskedRect2">
  9. <path d="m2,4h10v10h-10z" fill="#fff"/>
  10. <path d="m3,5h8v8h-8z"/>
  11. </mask>
  12. </defs>
  13. <title>Maximized</title>
  14. <path d="m4,2h10v10h-10z" mask="url(#maskedRect1)"/>
  15. <path d="m2,4h10v10h-10z" mask="url(#maskedRect2)"/>
  16. </svg>
To copy to clipboard, switch view to plain text mode 

maxIcon16.pyw:
Qt Code:
  1. # !/usr/bin/env python3
  2. # encoding: utf-8
  3. #
  4. import sys
  5. from PyQt4.QtCore import QSize
  6. from PyQt4.QtGui import QApplication
  7. from PyQt4.QtSvg import QSvgWidget
  8.  
  9. if __name__ == '__main__':
  10. app = QApplication(sys.argv)
  11.  
  12. widget = QSvgWidget('./maxIcon16.svg')
  13. widget.setMinimumSize(QSize(128, 128))
  14. widget.show()
  15.  
  16. sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode 

I went about it using QPixmap and QIcon as well but without any luck...

Here's the same svg only with size constraints and in a slightly more readable syntax:

maxIcon16_RAW.svg:
Qt Code:
  1. <?xml version="1.0" standalone="no"?>
  2. <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
  3. <svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink/" baseProfile="tiny" version="1.2">
  4. <title>Maximized</title>
  5. <defs>
  6. <mask id="maskedRect1">
  7. <rect x="4" y="2" width="10" height="10" style="fill:white"/>
  8. <rect x="5" y="3" width="8" height="8" style="fill:black"/>
  9. <rect x="3" y="5" width="8" height="8" style="fill:black"/>
  10. </mask>
  11. <mask id="maskedRect2">
  12. <rect x="2" y="4" width="10" height="10" style="fill:white"/>
  13. <rect x="3" y="5" width="8" height="8" style="fill:black"/>
  14. </mask>
  15. </defs>
  16. <rect x="4" y="2" width="10" height="10" style="fill:black" mask="url(#maskedRect1)"/>
  17. <rect x="2" y="4" width="10" height="10" style="fill:black" mask="url(#maskedRect2)"/>
  18. </svg>
To copy to clipboard, switch view to plain text mode 

I wrote the svg using a text editor so I can't be 100% sure it's not the svg it's self. But it's just a simple mask and it loads just fine in firefox and illustrator...