[Qgis-user] 'QLineEdit' object has no attribute 'delete' error in QGIS Dufour plugin
Hans-Peter Jansen
hpj at urpla.net
Mon Dec 2 01:34:19 PST 2013
On Montag, 2. Dezember 2013 03:47:28 Suryo Miles wrote:
> When i try to open text in textBrowser with command read i got this error
> message
>
> def cari(self, event=None):
>
> #open dialog
> filename = QtGui.QFileDialog.getOpenFileName(self, 'Open File',
> '*.xml')
>
> if filename:
> self.ui.lineFile.delete(0, END)
> self.ui.lineFile.insert(END, filename)
why so complicated, try this:
self.ui.lineFile.setText(filename)
> #panggil isi data
> self.isiDataFile(filename)
>
> def isiDataFile(self, nmfile):
> #buka dengan open mode baca
> teksFile = open(nmfile, 'r').read()
>
> self.ui.textFile.delete('1.0', END)
> self.ui.textFile.insert('1.0', teksFile)
>
> Traceback (most recent call last):
> File "C:\Users\Mr.Pakde/.qgis2/python/plugins\latih\latihdialog.py", line
> 44, in cari
> self.ui.lineFile.delete(0, END)
>
> 'QLineEdit' object has no attribute 'delete'
>
> Can someone help me?
> I m new in python and QGIS so i dont know what i must do
Cheers,
Pete
More information about the Qgis-user
mailing list