[PyKDE] [pyqt3] QiconView and "memory security violation" or something like this

piotr maliński riklaunim at gmail.com
Tue Jan 17 17:59:09 GMT 2006


I have a problem with my little script. I've described it on gentoo
forums: http://forums.gentoo.org/viewtopic-p-3033085.html#3033085

I've also rewrote those two functions into one:
###############################
def list_dir(self):
	import glob
	import os.path
	# get patch from lineEdit and list it
	patch = self.lineEdit1.text()
	# check if we have a signal from the iconview - something clicked
	itm = self.iconv.currentItem()
	if itm != None:
		klik = QIconViewItem(itm).text()
		patch = str(patch) + '/' + str(klik) + '/*'
                #update lineEdit1
	else:
        	patch = str(patch) + "/*"
	#list dir
	lista = glob.glob(patch)
	if len(lista) >= 1:
		print "before"
		self.iconv.clear()
		print "after" # this won't show
		self.dir = QPixmap('/home/plusiaczek/nowe/nuvola-1.0/22x22/places/folder.png')
		self.file = QPixmap('/home/plusiaczek/nowe/nuvola-1.0/22x22/mimetypes/text-x-generic.png')
		# naughty way to sort dirs/files, will do it for now :)
		for folder in lista:
			if os.path.isdir(folder):
	  			nazwa = folder.split('/')
				QIconViewItem( self.iconv, nazwa.pop(), self.dir )
		for file in lista:
			if os.path.isfile(file):
				nazwa = file.split('/')
				QIconViewItem( self.iconv, nazwa.pop(), self.file )
########################################################
it works when the patch it from Qlineedit  but from clicking on items
it crash with the "memory" something error (I have Polish system) as I
tested - self.iconv.clear() - this instruction causes app to crash.




More information about the PyQt mailing list