title: How can I troubleshoot an "hello world" program in Qt Designer?
body: <p>I tried to follow just the first part of this guide:
  <a href="http://talk.maemo.org/archive/index.php/t-39879.html" rel="nofollow">http://talk.maemo.org/archive/index.php/t-39879.html</a>
  to make only the hello world part work. It doesn't</p>
  
  <p>here is the error</p>
  
  <pre><code>Traceback (most recent call last):
    File "helloworld2.py", line 69, in &lt;module&gt;
      mainWindow = MainWin(None, "main window")
    File "helloworld2.py", line 49, in __init__
      self.setupUi(rootWidget)
    File "helloworld2.py", line 25, in setupUi
      MainWindow.setCentralWidget(self.centralwidget)
  AttributeError: 'QWidget' object has no attribute 'setCentralWidget'
  </code></pre>
  
  <p>Should this be working(after tweaking), or should I go a whole different route? 
  If it should be working, what are the things to do to troubleshoot?</p>
  
  <p>Here are the ingredients of the .py file. I'm not sure I have it entered into here correctly, I'm not sure I understand the correct way to enter it, so it will appear the same as in the file. If this doesn't look right I'll try again. </p>
  
  <pre><code>from PyKDE4 import kdecore
  from PyKDE4 import kdeui
  from PyQt4 import QtCore, QtGui
  
  try:
      _fromUtf8 = QtCore.QString.fromUtf8
  except AttributeError:
      _fromUtf8 = lambda s: s
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName(_fromUtf8("MainWindow"))
          MainWindow.resize(800, 400)
          self.centralwidget = QtGui.QWidget(MainWindow)
          self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
          self.label = QtGui.QLabel(self.centralwidget)
          self.label.setGeometry(QtCore.QRect(80, 110, 271, 51))
          font = QtGui.QFont()
          font.setPointSize(24)
          self.label.setFont(font)
          self.label.setObjectName(_fromUtf8("label"))
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtGui.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 20))
          self.menubar.setObjectName(_fromUtf8("menubar"))
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtGui.QStatusBar(MainWindow)
          self.statusbar.setObjectName(_fromUtf8("statusbar"))
          MainWindow.setStatusBar(self.statusbar)
  
      self.retranslateUi(MainWindow)
      QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
  def retranslateUi(self, MainWindow):
      MainWindow.setWindowTitle(kdecore.i18n(_fromUtf8("MainWindow")))
      self.label.setText(kdecore.i18n(_fromUtf8("Hello World!")))
  
  
  if __name__ == '__main__':
      import sys
      global app
  class MainWin(kdeui.KMainWindow, Ui_MainWindow):
      def __init__ (self, *args):
          kdeui.KMainWindow.__init__ (self)
          rootWidget = QtGui.QWidget(self)
          self.setupUi(rootWidget)
          self.resize(640, 480)
          self.setCentralWidget(rootWidget)
  
  appName     = "default"
  catalog     = ""
  programName = kdecore.ki18n("default")
  version     = "1.0"
  description = kdecore.ki18n("Default Example")
  license     = kdecore.KAboutData.License_GPL
  copyright   = kdecore.ki18n("unknown")
  text        = kdecore.ki18n("none")
  homePage    = ""
  bugEmail    = "email"
  
  aboutData   = kdecore.KAboutData(appName, catalog, programName, version, description,
                            license, copyright, text, homePage, bugEmail)
  kdecore.KCmdLineArgs.init(sys.argv, aboutData)
  
  app = kdeui.KApplication()
  mainWindow = MainWin(None, "main window")
  mainWindow.show()
  app.lastWindowClosed.connect(app.quit)
  app.exec_ ()
  </code></pre>