[PyQt] QFileDialog , filterSelected() problem

sa6113 s.payandeh at gmail.com
Tue Jun 10 10:29:33 BST 2008


self.connect(fd, SIGNAL(filterSelected(const QString &)), self.filter)
It dosen't work also.

self.connect(fd, SIGNAL(filterSelected(const QString &)), self.setFilter)
it is incorrect because setFilrer is its SLOT.



Phil Thompson-5 wrote:
> 
> On Tuesday 10 June 2008 9:13:47 am sa6113 wrote:
>> I'm using code like the following,
>>
>>      s = "Raw data file (*.raw)";
>>      fd = QFileDialog (self)
>>      fileName = fd.getOpenFileName("","Text files (*.txt);;All files (*)"
>> ,
>> self, "Open file")
>>
>>      self.connect(fd, SIGNAL(filterSelected(const QString &)),
>> fd,self.filter )
>>
>>      def filter(self,f)
>>         QMessageBox.information(self, "Selected Filter", f )
> 
>     self.connect(fd, SIGNAL(filterSelected(const QString &)), self.filter)
> 
>> I want to show a MessageBox to the user that inform s/he about which
>> filter
>> that selected,
>> but it doesn't work, it seems that SIGNAL won't be emitted , What is the
>> problem?
>>
>> also I can't use :
>> self.connect(fd, SIGNAL(filterSelected(const QString &)), self,
>> SLOT(setFilter(s)))
>>
>> the error is :
>> No such slot QFileDialog::setFilter(s)
> 
>     self.connect(fd, SIGNAL(filterSelected(const QString &)),
> self.setFilter)
> 
>> Would you please help me ?
>> Looking forward,
> 
> Phil
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 
> 

-- 
View this message in context: http://www.nabble.com/QFileDialog-%2C-filterSelected%28%29-problem-tp17750064p17751272.html
Sent from the PyQt mailing list archive at Nabble.com.



More information about the PyQt mailing list