[PyKDE] PYQt 3.1 Problem
Willem van Veldhuisen
lanwvv at expl.ak.ppco.com
Thu Mar 28 19:11:48 GMT 2002
I recently upgraded my versions of PySip and PyQt from 3.0 to 3.1 and
free Qt/X11 from 3.0.1 to 3.0.3 under Solaris 8. I am running Python
2.2 in both cases. The following code runs fine under the old versions,
but core dumps where indicated under the newer version. The single file
selection version "QFileDialog.getOpenFileName" still works fine, just
the multiple file version fails when attempting to access a substring in
the returned list of files.
Has anyone else seen this problem?
Thanks,
Willem
Phillips Alaska Inc.
#!/usr/bin/env python
import sys, string
from qt import *
class ApplicationWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self,None,'main window',Qt.WDestructiveClose)
fns = QFileDialog.getOpenFileNames("Data Files (*.dat);;All files
(*.*)")
if not fns.isEmpty():
print "Files selected: ",fns.count()
for i in range(fns.count()):
print i, str(fns[i]) --- core dumps
here
a = QApplication(sys.argv)
mw = ApplicationWindow()
mw.show()
a.connect(a, SIGNAL('lastWindowClosed()'), a, SLOT('quit()'))
a.exec_loop()
More information about the PyQt
mailing list