title: "Must construct a QApplication before a QPaintDevice" from QWidget
body: <p>I'm busy porting an IRC client from Python 2.6 to 3.3 and I've stumbled across a problem with PyQt. The application originally used PyQt4, I'm also recoding it to get it to work with PyQt5 but I'm getting an error without any line references: "QWidget: Must construct a QApplication before a QPaintDevice". I have narrowed the issue down to a single class.</p>
  
  <p>I understand it's been asked here many times already but I couldn't extract a sure-fire answer for my case so I apologise if my question appears ignorant.</p>
  
  <p>Here's some of the code: <a href="http://pastebin.com/Lj60icgQ" rel="noreferrer">http://pastebin.com/Lj60icgQ</a></p>
  
  <p>Stupid me didn't put the "app" variable just after the import statements when I should've. I then put the rest of the code at the bottom of the main file and I'm not longer getting that error. Thanks for the help!</p>