Transitioning from QTDesigners style class to more regularly referenced style
<p>So I'm working on getting a popup working in multiple imported files, and come upon many answers and they all have the same format(see: <a href="http://stackoverflow.com/questions/9074195/displaying-pop-up-windows-in-python-pyqt4">Displaying pop-up windows in Python (PyQt4)</a> )</p>

<p>They use this(summary):</p>

<pre><code>class MyForm(QtGui.QDialog):
    def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)

        # Usual setup stuff
        self.ui = Ui_Dialog()
        self.ui.setupUi(self)
if __name__ == "__main__":
   app = QtGui.QApplication(sys.argv)
   myapp= MyForm()
   myapp.show()
   sys.exit(app.exec_())
</code></pre>

<p>This is crucial because to open the popup you need to keep a reference to it, like myapp is doing here.</p>

<p>In QTDesigner, it sets it up something like this in the <code>if (__name__ == '__main__')</code></p>

<pre><code>app = QtGui.QApplication(sys.argv)
m = Ui_Frame()
Frame = QtGui.QWidget()
m.setupUi(Frame)
Frame.show()
</code></pre>

<p>With the actual class/ui setup like this:</p>

<pre><code>class Ui_Frame(object):

    def setupUi(self, Frame):
</code></pre>

<p>I tried to merge the two, but I am just getting a blank popup window like the setupUi isn't running. My code:</p>

<p>Edit: The new code with the disappearing window problem:</p>

<p>importedfile.py</p>

<pre><code>from PyQt4 import QtCore, QtGui
try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    _fromUtf8 = lambda s: s

class Ui_Frame(QtGui.QWidget):
def __init__(self, xlist, y, parent=None):
    QtGui.QWidget.__init__(self, parent)
    self.setupUi(xlist,y)

def setupUi(self, xlist, y):
    self.setObjectName(_fromUtf8("Frame"))
    self.resize(800, 400)
    self.tableWidget = QtGui.QTableWidget(self)
    ...

def startup(xlist, y):
     myapp= Ui_Frame(xlist, y)
     myapp.show()

if __name__ == "__main__":
     app = QtGui.QApplication(sys.argv)
     myapp= Ui_Frame()
     myapp.show()
     sys.exit(app.exec_())
</code></pre>

<p>other.py is just a simple:</p>

<pre><code>import importedfile
#app = QtGui.QApplication(sys.argv) and sys.exit are somewhere up here for the other       frame
...code...
tempholder = importedfile.startup(xlist,y)
#Using a var for the startup() or not using has the same results
</code></pre>

<p>I'm obviously missing something simple. setupUi is actually running, as everything in it is printing and such, but just nothing is showing up in the main window, just a blank frame</p>
