title: Using QIcon does not display the image
body: <p>I'm trying to learn PyQt. While going over a tutorial to get the basics I've encountered a problem with QIcon.</p>
  
  <p>The following code is supposed to create a simple window with an icon from an image called 'web.png':</p>
  
  <pre><code>import os
  import sys
  
  import PyQt5
  
  dirname = os.path.dirname(PyQt5.__file__)
  plugin_path = os.path.join(dirname, 'plugins', 'platforms')
  os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path
  
  from PyQt5.QtWidgets import QApplication, QWidget
  from PyQt5.QtGui import QIcon
  
  
  class Example(QWidget):
  
      def __init__(self):
          super().__init__()
  
          self.initUI()
  
  
      def initUI(self):
  
          self.setGeometry(300, 300, 300, 220)
          self.setWindowTitle('Icon')
          self.setWindowIcon(QIcon('web.png'))        
  
          self.show()
  
  
  if __name__ == '__main__':
  
      app = QApplication(sys.argv)
      ex = Example()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>However, the resulting window contains a standard icon and not the wanted image:
  <a href="https://i.stack.imgur.com/WmoDC.png" rel="nofollow"><img src="https://i.stack.imgur.com/WmoDC.png" alt="Wrong Icon!"></a></p>
  
  <p>The image web.png is contained within the current working directory. I use Python 3.5.1 and PyQt 5 with Qt 5.6.2.</p>
  
  <p>Any help would be appreciated.</p>