title: PyPlot show() really slow after calling PyQt4.QFileDialog.getOpenFileNames()
body: <p>For an analysis application I'm trying to:</p>
  
  <ol>
  <li>Get a list of filenames from the user using PyQt4 QFileDialog</li>
  <li>Extract some data from each file</li>
  <li>Plot the aggregated data using pyplot</li>
  </ol>
  
  <p>However, getting the filenames this way causes pyplot.show() to take a really, really long time. I've distilled the problem down to the following test case:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  from PyQt4 import QtCore, QtGui
  
  app = QtGui.QApplication(None)
  
  fd = QtGui.QFileDialog(None)
  filenames = fd.getOpenFileNames(caption='Select Data Files')
  
  plt.plot([1,2,3,4,5])
  plt.show()
  </code></pre>
  
  <p>Note that I'm not even doing anything with the filenames here--just getting them. </p>
  
  <p>Selecting a single file from the dialog results in a plot time of 10 seconds. Interestingly, the time required for show() to complete goes up roughly linearly with the number of files selected. For 10 files it takes about 67 seconds for the plot to show.</p>
  
  <p>This isn't a big deal for plotting data from a handful of files, but when aggregating data from Monte Carlo simulations where there are thousands of files it can take literally hours for the plot to show. Telling matplotlib to use the Qt4Agg backend results in the same behavior.</p>
  
  <p>If I comment out the call to getOpenFileNames the script will complete in under a second. </p>
  
  <p>I'm running the following versions of the relevant packages (should be latest):</p>
  
  <ul>
  <li>Python 2.7</li>
  <li>matplotlib 1.3.1</li>
  <li>python-sip 4.13.2-1</li>
  <li>python-qt4 4.9.1-2ubuntu1</li>
  <li>python-sip-dev 4.13.2-1 </li>
  <li>python-qt4-dev 4.9.1-2ubuntu1</li>
  </ul>
  
  <p>I uninstalled sip, qt4 and reinstalled them--same issue. I've seen the issue accross two separate machines--both running 32-bit Ubuntu 12.04.</p>
  
  <p>Any help would be much appreciated--I've wasted an embarrassing amount of time waiting for plots to show.</p>
  
  <hr>
  
  <p>Updates:</p>
  
  <ul>
  <li>The type and name of the files selected doesn't seem to matter. </li>
  <li>Cancelling or exiting the file dialog box results in no delay and an immediate plot.</li>
  <li>Running the script as sudo eliminates the issue; however, the file dialog looks different when I run as sudo and may be using a different gui backend that doesn't conflict with pyplot's use of PyQt, so may be a red herring.</li>
  <li>The program doesn't hang in getOpenFileNames, it hangs on the next call that uses PyQt. Whether that's a plot or another file dialog doesn't seem to matter--the first file dialog blocks both.</li>
  <li>Calling app.processEvents() after running the dialog doesn't help.</li>
  <li>Using PySide in place of PyQt4 results in the same behavior.</li>
  <li>Using getOpenFileName instead of getOpenFileNames results in the same behavior.</li>
  <li>Running getOpenFileNames with the DontUseNativeDialog option works (no delay)</li>
  <li>None of the other QFileDialog options have any effect (ShowDirsOnly, DontResolveSymlinks, DontConfirmOverwrite, ReadOnly, HideNameFilterDetails, DontUseSheet)</li>
  </ul>