title: How to set application's taskbar icon in Windows 7
body: <p>How do I set an application's taskbar icon in PyQt4?</p>
  
  <p>I have tried setWindowIcon, and it successfully sets the icon in the top-left of the main window, but it does not affect the icon shown in the Windows 7 taskbar -- the taskbar icon remains the default Python pyw icon. Here is my code:</p>
  
  <pre><code>from PyQt4 import QtGui
  
  app = QtGui.QApplication([])
  mainwindow = QtGui.QMainWindow()
  mainwindow.show()
  
  app.setWindowIcon(QtGui.QIcon('chalk.ico'))
  mainwindow.setWindowIcon(QtGui.QIcon('chalk.ico'))
  app.exec_()
  </code></pre>
  
  <p>[update] I've tried placing the <code>setWindowIcon()</code> before the <code>show()</code>. I've tried it with other images, ico and png. Nothing helps.</p>