def __init__(self, parent=None): QWidget.__init__(self, parent) self.ui = Ui_openCoin_MainWindow() self.ui.setupUi(self) # Set up signal-slot connections defined in the .ui files and # those providing higher-level functionality. QMetaObject.connectSlotsByName(self) #connect signals and methods self.connect(self.ui.actionAbout_Open_Coin, SIGNAL("triggered()"), self.about) self.connect(self.ui.actionAbout_QT, SIGNAL("triggered()"), self.aboutQt) self.connect(self.ui.actionQuit, SIGNAL("triggered()"), self.deleteWindow) #custom tests a = QListWidgetItem() a.setText('a') self.ui.opencoin_listWidget.addItem(a)
class Window(QMainWindow): def __init__(self, parent=None): QWidget.__init__(self, parent) self.ui = Ui_openCoin_MainWindow() self.ui.setupUi(self) # Set up signal-slot connections defined in the .ui files and # those providing higher-level functionality. QMetaObject.connectSlotsByName(self) #connect signals and methods self.connect(self.ui.actionAbout_Open_Coin, SIGNAL("triggered()"), self.about) self.connect(self.ui.actionAbout_QT, SIGNAL("triggered()"), self.aboutQt) self.connect(self.ui.actionQuit, SIGNAL("triggered()"), self.deleteWindow) #custom tests a = QListWidgetItem() a.setText('a') self.ui.opencoin_listWidget.addItem(a) def about(self): QMessageBox.about( self, self.tr("About Open Coin %1").arg(__version__), self.tr("<qt><h3>About Open Coin %1</h3>" "<p> Open Coin is blah blah blah " "</p></qt>").arg(__version__)) def aboutQt(self): QMessageBox.aboutQt(self) def deleteWindow(self): self.destroy()
class Window(QMainWindow): def __init__(self, parent=None): QWidget.__init__(self, parent) self.ui = Ui_openCoin_MainWindow() self.ui.setupUi(self) # Set up signal-slot connections defined in the .ui files and # those providing higher-level functionality. QMetaObject.connectSlotsByName(self) #connect signals and methods self.connect(self.ui.actionAbout_Open_Coin, SIGNAL("triggered()"), self.about) self.connect(self.ui.actionAbout_QT, SIGNAL("triggered()"), self.aboutQt) self.connect(self.ui.actionQuit, SIGNAL("triggered()"), self.deleteWindow) #custom tests a = QListWidgetItem() a.setText('a') self.ui.opencoin_listWidget.addItem(a) def about(self): QMessageBox.about(self, self.tr("About Open Coin %1").arg(__version__), self.tr("<qt><h3>About Open Coin %1</h3>" "<p> Open Coin is blah blah blah " "</p></qt>").arg(__version__) ) def aboutQt(self): QMessageBox.aboutQt(self) def deleteWindow(self): self.destroy()