[PyKDE] Two applications
Behnam Kamrani
bkamrani at gmail.com
Mon May 8 13:58:58 BST 2006
Hi!
I'm quite a Pyqt newbie and have problem how to construct my code. My
code has a main dialog box and its main looks like below. The user
enters some data into the fields of this dialog box and then after
pressing OK button, the code do some calculations and shows the
results in a table. I have defined the table itself as a class in a
separate file.
Here I have at leasta 2 problems:
1) How should I display the table? The only way that I succeeded was
to define another QApplication inside the table class and then:
self.table.show()
self.app.setMainWidget(self.table)
self.app.exec_loop()
This way I get the table shown, but this warning annoys me:
"QApplication: There should be max one application object"
2) The table has some QComboTableItem. The user should select and
press the OK button so that some new activities (like writing into
files) starts. My second problem is how to creat an "OK button" in a
table?
Your help in any of this issues is much appreciated!!
/Ben
############ Main ###############
import sys
from qt import *
from BaseForm_1impl import BaseFormImpl
app = QApplication(sys.argv)
baseForm = BaseFormImpl()
app.setMainWidget(baseForm)
baseForm.show()
app.connect(app, SIGNAL('lastWindowClosed()'), app, SLOT('quit()'))
app.exec_loop()
################################
More information about the PyQt
mailing list