Reply
Thread Tools
Posts: 246 | Thanked: 2,574 times | Joined on Jan 2010 @ Egypt, Cairo
#1
I'm trying to browse and select file using a QFileDialog. The file dialog opens successfully, but the moment I scroll or open a folder that has a file that can be selected, the app crashes printing a segmentation fault.

After some digging in the code I found that this has to do with importing evolution. Here is a simple example:

Code:
from PyQt4.QtCore import * 
from PyQt4.QtGui import * 
import sys
import evolution

app = QApplication(sys.argv)

win = QMainWindow()

win.show()

path = QFileDialog.getOpenFileName(None,"Open Image", "/home/user/", "Image Files (*.png *.jpg *.bmp)");

sys.exit(app.exec_())
This program crashes on maemo 5, but if you remove "import evolution", or run just run it on computer, the File Dialog selects a file successfully. Why is that?!
 

The Following User Says Thank You to tgalal For This Useful Post:
Posts: 246 | Thanked: 2,574 times | Joined on Jan 2010 @ Egypt, Cairo
#2
I really need some help here. This is a project that I'm about to submit a first release in and I'm stuck at this so I would appreciate any help why is the conflict between evolution and QFileDialog?! I also tried to un-import evolution after using it by calling "del evolution" but the segmentation fault remains :S
 
Jaffa's Avatar
Posts: 2,535 | Thanked: 6,681 times | Joined on Mar 2008 @ UK
#3
Is this in Scratchbox or just on the device? I've packaged python-evolution, but I'm not an expert on its code - and even less of an expert on PyQt.

Does it happen if you switch to Pyside? That might indicate whether it's a Python, a Qt or a PyQt problem.
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
 
Posts: 246 | Thanked: 2,574 times | Joined on Jan 2010 @ Egypt, Cairo
#4
I tried switching to PySide, same result.. Only more it prints a couple of warnings on initializing QApplication but I don't think that's related..

On scratchbox:

Code:
/usr/bin/run-standalone.sh: line 11:  7006 Segmentation fault      (core dumped) "$@"
 
Jaffa's Avatar
Posts: 2,535 | Thanked: 6,681 times | Joined on Mar 2008 @ UK
#5
Scratchbox x86 or armel target or both?
__________________
Andrew Flegg -- mailto:andrew@bleb.org | http://www.bleb.org
 
Posts: 246 | Thanked: 2,574 times | Joined on Jan 2010 @ Egypt, Cairo
#6
Both. But on armel, when I run it without using run-standalone.sh, it shows a native file chooser, and does not crash!
 
Posts: 376 | Thanked: 511 times | Joined on Aug 2009 @ Greece
#7
I have the same problem with pyqt under n900 P1.1 directly.

EDIT: Without importing evolution.

EDIT: Using QFileDialog directly it worked very well.

EDIT: Partially solved: Was fixed when I removed "import gst, pygst" (which in my case were not needed).

Last edited by v13; 2010-03-06 at 14:03.
 

The Following User Says Thank You to v13 For This Useful Post:
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#8
The issue you talk about is AFAICT Qt specific (in fact, I have the very same problem with quickbrownfox, which is a C++ app)
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 

The Following User Says Thank You to attila77 For This Useful Post:
Posts: 246 | Thanked: 2,574 times | Joined on Jan 2010 @ Egypt, Cairo
#9
I had to fall back to this ugly file dialog
Attached Images
 
 
Posts: 6 | Thanked: 0 times | Joined on May 2010 @ State College, PA
#10
Same problem with the last version of PyQt4 under Maemo 5 (PR1.2): QFileDialog.getOpenFileName() -> segfault once a file is selected.

Is this bug submitted somewhere?
Is there a known walkaround now?
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 13:35.