[PyQt] Segmentation fault with QFileSystemModel
Dan Halbert
halbert at halwitz.org
Thu Nov 11 20:29:09 GMT 2010
On 11/11/2010 3:22 PM, Gaëtan Podevijn wrote:
> When I launch a Python environment in a terminal, and I try to
> instanciate a QFileSystemModel, I have a segmentation fault:
>
> >>> model = QFileSystemModel()
>
> >>> model.setRootPath(QDir.homePath())
>
> Segmentation fault
>
>
> However, and I really don't understand, the attached file works well !
>
You need to create a QApplication to set up Qt before creating nearly
all Qt objects except the absolute simplest such as QPoint, etc. The
example you attached creates a QApplication before creating the
QFileSystemModel.
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101111/f2fbbe0f/attachment.html>
More information about the PyQt
mailing list