Hi all.
I am using python and pyqt4 to make a simple application. In the history table I want to be able to double click a cell and launch a new dialog.
How ever for some reason when ever I try to do this it gives me the error: "AttributeError: 'HistoryInformation' object has no attribute 'exec_'"
I am trying to run the dialog via:
histinfodlg = histInfo.HistoryInformation(nzb, form)
histinfodlg.exec_()
histinfodlg = histInfo.HistoryInformation(nzb, form)
histinfodlg.exec_()
To copy to clipboard, switch view to plain text mode
Here is the code for the histInfo:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import PyQt4.uic as uic
import sys
form_class, base_class = uic.loadUiType("Ui/histInfoDLG.ui")
class HistoryInformation(base_class, form_class):
def __init__(self, info, parent = None):
super(base_class, self).__init__(parent)
self.setupUi(self)
self.nameLabel.setText(info["name"])
self.pathLabel.setText(info["storage"])
self.urlLabel.setText(info["url"])
if __name__ == "__main__":
import sys
form = HistoryInformation({"name":"test", "storage":"test2", "url":"www.google.com"})
form.show()
app.exec_()
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import PyQt4.uic as uic
import sys
form_class, base_class = uic.loadUiType("Ui/histInfoDLG.ui")
class HistoryInformation(base_class, form_class):
def __init__(self, info, parent = None):
super(base_class, self).__init__(parent)
self.setupUi(self)
self.nameLabel.setText(info["name"])
self.pathLabel.setText(info["storage"])
self.urlLabel.setText(info["url"])
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
form = HistoryInformation({"name":"test", "storage":"test2", "url":"www.google.com"})
form.show()
app.exec_()
To copy to clipboard, switch view to plain text mode
I have tested this with a different dialog and it worked fine, so the issue is with this dialog but I just cant see where it is, as if I run it on its own it works fine.
Any ideas?
Cheers.
Bookmarks