<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 11/11/2010 3:22 PM, Gaëtan Podevijn wrote:
<blockquote
cite="mid:AANLkTinb5ikyRCb5QCiJU49s1iG9BN=45Un_dUKS_Qm0@mail.gmail.com"
type="cite">When I launch a Python environment in a terminal, and
I try to instanciate a QFileSystemModel, I have a segmentation
fault:
<div><br>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<font class="Apple-style-span" face="'courier new', monospace">>>>
model = QFileSystemModel()</font></blockquote>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<font class="Apple-style-span" face="'courier new', monospace">>>>
model.setRootPath(QDir.homePath())</font></blockquote>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<font class="Apple-style-span" face="'courier new', monospace">Segmentation
fault</font></blockquote>
<div><br>
</div>
<div>However, and I really don't understand, the attached file
works well !</div>
<br>
</div>
</blockquote>
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.<br>
<br>
Dan<br>
</body>
</html>