Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, don't use:</p> <pre><code>from PyQt4.QtCore import * from PyQt4.QtGui import * </code></pre> <p>Instead:</p> <pre><code>from PyQt4 import QtCore, QtGui </code></pre> <p>And reference the modules explicitly.</p> <pre><code>class DlgAbout(QtGui.QDialog, Ui_DlgAbout): </code></pre> <p>etc.</p> <p>In your code, all you've done is defined a dialog box. You haven't defined any main application to run, or any way to show the dialog box.</p> <p>For an example, here's a basic main <em>application</em> to run:</p> <pre><code>from PyQt4 import QtGui import sys class MyMainWindow(QtGui.QMainWindow): def __init__(self, parent=None): super(MyMainWindow, self).__init__(parent) self.form_widget = FormWidget(self) self.setCentralWidget(self.form_widget) class FormWidget(QtGui.QWidget): def __init__(self, parent): super(FormWidget, self).__init__(parent) self.layout = QtGui.QVBoxLayout(self) self.button = QtGui.QPushButton("Button!") self.layout.addWidget(self.button) if __name__ == "__main__": app = QtGui.QApplication([]) foo = MyMainWindow() foo.show() sys.exit(app.exec_()) </code></pre> <p>This defines a main window, and a form (Which MyMainWindow sets up, as you can see). I then check if this is the main file being run (<code>if __name__ == "__main__":</code>), and I start the application (The <code>app = QtGui.QApplication([])</code>, create the main window, and <strong>show the main window</strong>.</p> <p>In your case, you could define a main application like I did, and make it alert your QDialog.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload