<div dir="ltr">I try to make save as button but i got this error message when try to save file in my directory<br><br> File "C:\Users\Mr.Pakde/.qgis2/python/plugins\condition\conditiondialog.py", line 80, in saveAs<br>
self._save( _filename )<br> File "C:\Users\Mr.Pakde/.qgis2/python/plugins\condition\conditiondialog.py", line 68, in _save<br> f.write( 'Rekomendasi :' + str(self.ui.textRec1.setPlainText() ) )<br>
TypeError: QTextEdit.setPlainText(QString): not enough arguments<br><br>this is my code<br><br> Smpan = self.ui.btnSave<br> QtCore.QObject.connect(Smpan, QtCore.SIGNAL('clicked()'),self.saveAs) <br>
<br> def Compare1(self):<br> input1 = self.ui.lineInput1.text()<br> input2 = self.ui.lineInput2.text()<br> compare = ''<br> if input1 == input2:<br> compare = 'Data dapat digunakam'<br>
else:<br> compare = 'Data tidak cocok'<br> self.ui.textRec1.setPlainText(compare)<br> <br> def _save(self, simpan): <br> f = open( simpan, 'w' )<br>
f.write( 'Input 1 :' + str(self.ui.lineInput1.text()) ) <br> f.write( 'Input 2 :' + str(self.ui.lineInput2.text()) )<br> f.write( 'Rekomendasi :' + str(self.ui.textRec1.setPlainText()) ) <br>
f.close()<br> def savefile(self):<br> if self.simpan:<br> self._save( "%s" % self.simpan )<br> else:<br> self.saveAs()<br> <br> def saveAs(self):<br>
tulis = QtGui.QFileDialog(self).getSaveFileName()<br> if tulis !="":<br> _filename = "%s" % tulis<br> self._save( _filename )<br><br>
<br></div>