title: Segmentation fault with a element of QList
body: <p>In my application I have a list of pointer to QFile objects:</p>
  
  <pre><code>QList&lt;QFile*&gt; files
  </code></pre>
  
  <p>This function adds the elements on the list:</p>
  
  <pre><code>void MumuServer::openFiles(){
      QDir fileDir(QDir::toNativeSeparators(homeApp.path() + "/file"));
      std::cout &lt;&lt; fileDir.path().toStdString() &lt;&lt; std::endl;
      if(fileDir.exists()){ // there is files directory in the application home dir
      std::cout &lt;&lt; "fileDir exists" &lt;&lt; std::endl;
      QStringList filesList = fileDir.entryList();
      for(int index = 0; index &lt; filesList.size(); index++){
          QString fileName = filesList.at(index);
          if(this-&gt;blackListFile.contains(fileName)){
              continue;
          }
          QString path = fileDir.path() + "/" + fileName;
          std::cout &lt;&lt; path.toStdString() &lt;&lt; std::endl;
          QFile file(QDir::toNativeSeparators(path));
          if(file.exists()){
              files.append(&amp;file);
          }
      }
      std::cout &lt;&lt; this-&gt;files.size() &lt;&lt; " files found" &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>After this function the QFile pointers are added on the QList. But, when I try to manipulate something on a element of the list getting it with the function at(int) a segmentation fault occurs.</p>
  
  <p>Example:</p>
  
  <pre><code>QFile * file = files.at(index);
  std::cout &lt;&lt; "File size = " &lt;&lt; file-&gt;fileName() &lt;&lt; std::endl;
  </code></pre>
  
  <p>Somebody are seeing what am I doing wrong?</p>