[PyQt] Segmentation fault with QFileSystemModel

Phil Thompson phil at riverbankcomputing.com
Thu Nov 11 20:30:35 GMT 2010


On Thu, 11 Nov 2010 21:22:37 +0100, Gaëtan Podevijn <gpodevij at gmail.com>
wrote:
> Hello,
> 
> I am very very confused with my problem.
> When I launch a Python environment in a terminal, and I try to
instanciate
> a
> QFileSystemModel, I have a segmentation fault:
> 
>  $ python
> 
> Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
> 
> [GCC 4.4.5] on linux2
> 
> Type "help", "copyright", "credits" or "license" for more information.
> 
>>>> import sys
> 
>>>> from PyQt4.QtCore import *
> 
>>>> from PyQt4.QtGui  import *
> 
>>>> model = QFileSystemModel()
> 
>>>> model.setRootPath(QDir.homePath())
> 
> Segmentation fault
> 
> 
> However, and I really don't understand, the attached file works well !
> 
> Am I doing it completely wrong ?
> Here is my pyqt informations :
> 
> Package: python-qt4
> State: installed
> Automatically installed: no
> Version: 4.7.4-0ubuntu1

Create a QApplication instance first.

Phil


More information about the PyQt mailing list