Hi I have been working on this all day and it has me beat.
I want to pass the contents of a Qtextedit as a argument in a connect statement.
I tryed this.
self.connect(self.pb1a,SIGNAL("clicked()"),(lambda s=[str(self.cboxa.toPlainText())] : self._edit_(s)))
def _edit_(self,inptname):
print inptname
self.connect(self.pb1a,SIGNAL("clicked()"),(lambda s=[str(self.cboxa.toPlainText())] : self._edit_(s)))
def _edit_(self,inptname):
print inptname
To copy to clipboard, switch view to plain text mode
But all I seem to get with this is a empty string, but if i do this it works.
self.connect(self.pb1a,SIGNAL("clicked()"),self._edit_()))
def _edit_(self,inptname):
print str(self.cboxa.toPlainText())
self.connect(self.pb1a,SIGNAL("clicked()"),self._edit_()))
def _edit_(self,inptname):
print str(self.cboxa.toPlainText())
To copy to clipboard, switch view to plain text mode
Just to make it even more confusing this works
self.connect(self.pb1a,SIGNAL("clicked()"),(lambda s="this is a string"] : self._edit_(s)))
def _edit_(self,inptname):
print inptname
self.connect(self.pb1a,SIGNAL("clicked()"),(lambda s="this is a string"] : self._edit_(s)))
def _edit_(self,inptname):
print inptname
To copy to clipboard, switch view to plain text mode
So way can't i pass the text from the Qtextedit.
What am I missing..???
Bookmarks