[PyKDE] Using QFileDialog

piotr maliński riklaunim at gmail.com
Mon Jan 9 16:12:48 GMT 2006


I'm learning pyQT and I have a problem with QFileDialog - how can I
get the selected filename? I've made a simple form: a pushbutton that
onlick runs function "test" which opens the filedialog (in
qtdesigner):
------------------------------
void Form1::test()
{
a = QFileDialog(self)
QObject.connect(a, SIGNAL('fileSelected()') ,self , SLOT('test2()'))
a.show()
}
-------------------------------
But when the widgets shows i get:
QObject::connect: No such signal QFileDialog::fileSelected()
QObject::connect:  (sender name:   'unnamed')
QObject::connect:  (receiver name: 'Form1')

test2 function looks like this:
--------------------------------------
void Form1::test2()
{
self.pushButton1.setText("aaaaaa")
}
--------------------------------------
1. how can I make it work?
2. how can I get the selected filename and display its name as
pushButton1 text? Will something like: SLOT("test2(a.selectedFile())")
work?
I'm using QT 3.3.4 and pyQT 3.15.1




More information about the PyQt mailing list