April 24, 2012

R.Ezoe@Japan R.Ezoe@Japan
Lab Rat
1 posts

[PySide]How to emit a multi-arguments signal.

 

Dear community,

I got a TypeError: findPrevious(QString) only accepts 1 arguments, 3 given!

but, I want to emit a multi-arguments signal.
How can I do it?

  1. class FindDialog(QtGui.QDialog):
  2.  findPrevious = QtCore.Signal(str, QtCore.Qt.CaseSensitive)
  3.  findNext = QtCore.Signal(str, QtCore.Qt.CaseSensitive)
  4.  
  5.  def findClicked(self):
  6.   text = self.lineEdit.text()
  7.   if self.caseCheckBox.isChecked:
  8.    cs = QtCore.Qt.CaseSensitive
  9.   else:
  10.    cs = QtCore.Qt.CaseInsensitive
  11.   if self.backwardCheckBox.isChecked:
  12.    self.findPrevious.emit(text, cs)
  13.   else:
  14.    self.findNext.emit(text, cs)

2 replies

April 27, 2012

Renatosantos Renatosantos
Lab Rat
41 posts

what function?

 Signature 

Qt Developer.

“Imagination is more important than knowledge.”
http://twitter.com/Renatos20

April 28, 2012

R.Ezoe@Japan R.Ezoe@Japan
Lab Rat
1 posts

This one.

  1. self.findPrevious.emit(text, cs)

But, I think signal can not emit multi-arguments in PySide.

However, C++ can it.

  1. emit findPrevious(text, cs);

 
  ‹‹ Compiling Qt Jambi for QT 4.8 fails      PySide: ’QtGui.framework Library not Loaded’ ››

You must log in to post a reply. Not a member yet? Register here!