<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Thanks for the update Sean!<br>
    <br>
    On 12/12/13 12:37, Sean Fisk wrote:<br>
    <blockquote
cite="mid:CAF-FwG8oPHo_q0Vc4JBGai9gn176y5y9vHPEZW_evsUtmVRuNw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="markdown-here-wrapper"
          id="markdown-here-wrapper-72348" style="">
          <p style="margin:1.2em 0px!important">I just tried it on
            CentOS with PySide 1.2.1. The progress bar does indeed work.
            However, I do see some visual glitches: the layout doesn’t
            readjust if the window is resized; the button sometimes
            disappears halfway or fully; the button can’t be clicked.
            Throwing in a call to <code
              style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px
              0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px
              solid
rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline">QtGui.QApplication.processEvents()</code>
            before <code
              style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px
              0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px
              solid
rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline">time.sleep()</code>
            helps the situation, but the response is laggy and sluggish
            because the GUI is still only able to update every
            half-second.</p>
          <p style="margin:1.2em 0px!important">While threads are “evil”
            in many ways, I do think that for delays of half a second or
            greater they are a good solution.</p>
        </div>
      </div>
      <div class="gmail_extra"><br clear="all">
        <div>
          <div><br>
          </div>
          <div>--</div>
          <div>Sean Fisk</div>
        </div>
        <br>
        <br>
        <div class="gmail_quote">On Wed, Dec 11, 2013 at 6:16 PM, Frank
          Rueter | OHUfx <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:frank@ohufx.com" target="_blank">frank@ohufx.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Ok, will report back
              if I stumble across anything interesting. For now I will
              just assume that my example simply shouldn't work :-D
              <div>
                <div class="h5"><br>
                  <br>
                  <br>
                  <div>On 12/12/13 12:07, Sean Fisk wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">Frank,
                      <div><br>
                      </div>
                      <div>Understood. I'm going to try your example on
                        CentOS 6.4 with PySide 1.2.1 and see what
                        happens. Let me know what happens with future
                        progress bars. I'm going to start doing a lot of
                        asynchronous stuff soon, so it would be helpful
                        to know.</div>
                      <div><br>
                      </div>
                      <div>Thanks,</div>
                    </div>
                    <div class="gmail_extra"><br clear="all">
                      <div>
                        <div><br>
                        </div>
                        <div>--</div>
                        <div>Sean Fisk</div>
                      </div>
                      <br>
                      <br>
                      <div class="gmail_quote">On Wed, Dec 11, 2013 at
                        4:45 PM, Frank Rueter | OHUfx <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:frank@ohufx.com"
                            target="_blank">frank@ohufx.com</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000"> Hi
                            Sean,<br>
                            <br>
                            I totally agree that it shouldn't work, and
                            I paid little attention to it as I just
                            wanted to provide an example for the signal.<br>
                            <br>
                            I am on Kubuntu 12.10 using PySide 1.2.1.<br>
                            I just ran the code on an OSX box with an
                            old PySide installation (1.0.9) and the
                            progressbar didn't move there.<br>
                            <br>
                            I have a few simple apps to write which will
                            involve proper use of progressbar to
                            indicate background image processing, so I'm
                            sure I will run into it again.<br>
                            <br>
                            <br>
                            Cheers,<br>
                            frank
                            <div>
                              <div><br>
                                <br>
                                <br>
                                <div>On 12/12/13 09:56, Sean Fisk wrote:<br>
                                </div>
                                <blockquote type="cite">
                                  <div dir="ltr">Janwillem,
                                    <div><br>
                                    </div>
                                    <div>I'm glad you were able to able
                                      to figure out the problem. Sorry
                                      for my red herrings!</div>
                                    <div><br>
                                    </div>
                                    <div>Frank,</div>
                                    <div><br>
                                    </div>
                                    <div>I thought about it, and I have
                                      no idea why the progress bar works
                                      fine for you and not for me. It
                                      hangs for me, which is exactly
                                      what I expected to happen. Maybe
                                      some platform difference? I'm on
                                      Mac OS 10.6 with PySide 1.2.1.</div>
                                  </div>
                                  <div class="gmail_extra"><br
                                      clear="all">
                                    <div>
                                      <div><br>
                                      </div>
                                      <div>--</div>
                                      <div>Sean Fisk</div>
                                    </div>
                                    <br>
                                    <br>
                                    <div class="gmail_quote">On Wed, Dec
                                      11, 2013 at 9:16 AM, Janwillem van
                                      Dijk <span dir="ltr"><<a
                                          moz-do-not-send="true"
                                          href="mailto:jwevandijk@xs4all.nl"
                                          target="_blank">jwevandijk@xs4all.nl</a>></span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote"
                                        style="margin:0 0 0
                                        .8ex;border-left:1px #ccc
                                        solid;padding-left:1ex">
                                        <div bgcolor="#FFFFFF"
                                          text="#000000">
                                          <div>The solution Frank
                                            proposed yesterday works
                                            (after I found out that you
                                            can get the output using
                                            selectedFiles()[0]).<br>
                                            No problems with the
                                            progressbar.<br>
                                            The actual processing can
                                            take a bit long because the
                                            exif's of digital camera
                                            shots are analysed (GExiv2
                                            for photos and exiftool for
                                            movies ) and than copied to
                                            folders as
                                            /camara_make/year/month/imagetype/yyyymmddhhmmss_fname.
                                            When copying more than say
                                            50 16MB raw photos the gui
                                            becomes blocked. In other
                                            apps I indeed solved that
                                            with threading but, although
                                            not elegant, I decided to
                                            live with that for this one.<br>
                                            Many thanks for teaching me
                                            this extra bit of Python.<br>
                                            Cheers, Janwillem
                                            <div>
                                              <div><br>
                                                <br>
                                                On 11/12/13 05:45, Sean
                                                Fisk wrote:<br>
                                              </div>
                                            </div>
                                          </div>
                                          <div>
                                            <div>
                                              <blockquote type="cite">
                                                <div dir="ltr">
                                                  <div>
                                                    <p
                                                      style="margin:1.2em
                                                      0px!important">Frank,</p>
                                                    <p
                                                      style="margin:1.2em
                                                      0px!important">Your
                                                      example is a good
                                                      demonstration of <code
                                                        style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px
                                                        0.15em;padding:0px
                                                        0.3em;white-space:pre-wrap;border:1px
                                                        solid
rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline">QFileDialog</code>‘s



                                                      signals. However,
                                                      since the
                                                      processing runs in
                                                      the GUI thread,
                                                      the progress bar
                                                      is virtually
                                                      useless as the GUI
                                                      has no time to
                                                      update it. It
                                                      starts empty, the
                                                      application hangs,
                                                      and then it is
                                                      filled when the
                                                      processing is
                                                      done.</p>
                                                    <p
                                                      style="margin:1.2em
                                                      0px!important">Janwillem,</p>
                                                    <p
                                                      style="margin:1.2em
                                                      0px!important">As
                                                      I see it, if you
                                                      would like a
                                                      progress bar, you
                                                      have three
                                                      options:</p>
                                                    <ol
                                                      style="margin:1.2em
0px;padding-left:2em">
                                                      <li
                                                        style="margin:0.5em
                                                        0px">Call <a
                                                          moz-do-not-send="true"
href="http://seanfisk.github.io/pyside-docs/pyside/PySide/QtCore/QCoreApplication.html#PySide.QtCore.PySide.QtCore.QCoreApplication.processEvents"
target="_blank"><code
                                                          style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px
                                                          0.15em;padding:0px
                                                          0.3em;white-space:pre-wrap;border:1px
                                                          solid
rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline">QCoreApplication.processEvents()</code></a>
                                                        during your
                                                        processing code.
                                                        This is not
                                                        always a great
                                                        idea, and more
                                                        of a hack than a
                                                        solution. But it
                                                        usually works.</li>
                                                      <li
                                                        style="margin:0.5em
                                                        0px">Split your
                                                        processing into
                                                        chunks as in <a
moz-do-not-send="true"
href="http://qt-project.org/wiki/Threads_Events_QObjects#72c9aabadf52900fbf3d4c1ff2b6008c"
target="_blank">this example</a>. However, the code is a bit convoluted
                                                        and it still
                                                        runs in the GUI
                                                        thread. The
                                                        whole page that
                                                        contains that
                                                        example is a
                                                        great read for
                                                        asynchronous
                                                        programming.</li>
                                                      <li
                                                        style="margin:0.5em
                                                        0px">Send your
                                                        processing to a
                                                        thread, and
                                                        dispatch events
                                                        from the thread
                                                        indicating the
                                                        progress.</li>
                                                    </ol>
                                                    <p
                                                      style="margin:1.2em
                                                      0px!important">The
                                                      first two
                                                      solutions involve
                                                      running processing
                                                      code within the
                                                      GUI thread. If any
                                                      step of the
                                                      processing takes
                                                      longer than a
                                                      second, then it’s
                                                      probably not a
                                                      good idea as the
                                                      user will see the
                                                      application hang.
                                                      Here is an example
                                                      implementation of
                                                      the third
                                                      solution:</p>
                                                    <pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block;padding:0.5em;color:rgb(51,51,51);background-color:rgb(248,248,255);background-repeat:initial initial"><span style="color:rgb(153,153,136);font-style:italic">#!/usr/bin/env python</span>

<span style="color:rgb(153,153,136);font-style:italic"># Example: Asynchronously process a directory of files with a progress bar.</span>

<span style="color:rgb(51,51,51);font-weight:bold">import</span> sys
<span style="color:rgb(51,51,51);font-weight:bold">import</span> os
<span style="color:rgb(51,51,51);font-weight:bold">import</span> time

<span style="color:rgb(51,51,51);font-weight:bold">from</span> PySide <span style="color:rgb(51,51,51);font-weight:bold">import</span> QtCore, QtGui

<span style="color:rgb(68,85,136);font-weight:bold"><span style="color:rgb(51,51,51);font-weight:bold">class</span> <span style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">ProcessingThread</span><span>(QtCore.QThread)</span>:</span>
    <span style="color:rgb(153,153,136);font-style:italic"># Fired when each file is processed.</span>
    file_processed = QtCore.Signal(int, str)

    <span><span style="color:rgb(51,51,51);font-weight:bold">def</span> <span style="color:rgb(153,0,0);font-weight:bold">__init__</span><span>(self, parent=None)</span>:</span>
        super(ProcessingThread, self).__init__(parent)
        self.files = []

    <span><span style="color:rgb(51,51,51);font-weight:bold">def</span> <span style="color:rgb(153,0,0);font-weight:bold">run</span><span>(self)</span>:</span>
        <span style="color:rgb(153,153,136);font-style:italic"># Code that's run in the thread.</span>
        <span style="color:rgb(51,51,51);font-weight:bold">for</span> i, filename <span style="color:rgb(51,51,51);font-weight:bold">in</span> enumerate(self.files):
            <span style="color:rgb(153,153,136);font-style:italic"># The actual code for one file goes here. Stubbed out with</span>
            <span style="color:rgb(153,153,136);font-style:italic"># time.sleep() for now.</span>
            time.sleep(<span style="color:rgb(0,153,153)">0.5</span>)
            <span style="color:rgb(51,51,51);font-weight:bold">print</span> <span style="color:rgb(221,17,68)">'Processed:'</span>, filename
            <span style="color:rgb(153,153,136);font-style:italic"># Send update to the GUI thread.</span>
            self.file_processed.emit(i + <span style="color:rgb(0,153,153)">1</span>, filename)

<span style="color:rgb(68,85,136);font-weight:bold"><span style="color:rgb(51,51,51);font-weight:bold">class</span> <span style="color:rgb(153,0,0);font-weight:bold;color:rgb(68,85,136);font-weight:bold">MyWidget</span><span>(QtGui.QWidget)</span>:</span>
    <span><span style="color:rgb(51,51,51);font-weight:bold">def</span> <span style="color:rgb(153,0,0);font-weight:bold">__init__</span><span>(self, parent=None)</span>:</span>
        super(MyWidget, self).__init__(parent)

        <span style="color:rgb(153,153,136);font-style:italic"># Setup UI.</span>
        self._layout = QtGui.QVBoxLayout(self)
        self._button = QtGui.QPushButton(<span style="color:rgb(221,17,68)">'Open files...'</span>)
        self._progress = QtGui.QProgressBar()
        self._filelist = QtGui.QPlainTextEdit()
        self._layout.addWidget(self._button)
        self._layout.addWidget(self._filelist)
        self._layout.addWidget(self._progress)

        <span style="color:rgb(153,153,136);font-style:italic"># Setup events.</span>
        self._button.clicked.connect(self._button_clicked)

        <span style="color:rgb(153,153,136);font-style:italic"># Create the thread. Note that this doesn't actually _start_ it.</span>
        self._thread = ProcessingThread()
        self._thread.file_processed.connect(self._file_processed)

        <span style="color:rgb(153,153,136);font-style:italic"># We need to wait for the thread before exiting. Either use this or</span>
        <span style="color:rgb(153,153,136);font-style:italic"># don't let the user close the window if processing is happening. See</span>
        <span style="color:rgb(153,153,136);font-style:italic"># the next method in this class.</span>
        QtCore.QCoreApplication.instance().aboutToQuit.connect(
            self._thread.wait)

    <span style="color:rgb(153,153,136);font-style:italic"># def closeEvent(self, event):</span>
    <span style="color:rgb(153,153,136);font-style:italic">#     # This is an alternative to waiting for the threads. Just don't let</span>
    <span style="color:rgb(153,153,136);font-style:italic">#     # the user close the window.</span>
    <span style="color:rgb(153,153,136);font-style:italic">#     if self._thread.isRunning():</span>
    <span style="color:rgb(153,153,136);font-style:italic">#         QtGui.QMessageBox.critical(</span>
    <span style="color:rgb(153,153,136);font-style:italic">#             self, 'Processing',</span>
    <span style="color:rgb(153,153,136);font-style:italic">#             'Cannot exit while processing is happening.')</span>
    <span style="color:rgb(153,153,136);font-style:italic">#         event.ignore()</span>
    <span style="color:rgb(153,153,136);font-style:italic">#     else:</span>
    <span style="color:rgb(153,153,136);font-style:italic">#         event.accept()</span>

    <span><span style="color:rgb(51,51,51);font-weight:bold">def</span> <span style="color:rgb(153,0,0);font-weight:bold">_button_clicked</span><span>(self)</span>:</span>
        <span style="color:rgb(153,153,136);font-style:italic"># If we are already running the processing, produce an error.</span>
        <span style="color:rgb(51,51,51);font-weight:bold">if</span> self._thread.isRunning():
            QtGui.QMessageBox.critical(
                self, <span style="color:rgb(221,17,68)">'Processing'</span>,
                <span style="color:rgb(221,17,68)">'Can only process one directory at a time.'</span>)
            <span style="color:rgb(51,51,51);font-weight:bold">return</span>

        <span style="color:rgb(153,153,136);font-style:italic"># Get the directory name from the user.</span>
        dir_name = QtGui.QFileDialog.getExistingDirectory(
            parent=self,
            caption=<span style="color:rgb(221,17,68)">'Choose files...'</span>,
            dir=os.getcwd())

        <span style="color:rgb(153,153,136);font-style:italic"># Activate the main dialog as it will be deactivated for some reason</span>
        <span style="color:rgb(153,153,136);font-style:italic"># after the file dialog closes (at least on my machine).</span>
        self.activateWindow()

        <span style="color:rgb(153,153,136);font-style:italic"># Get the list of files in the directory and prime the progress bar.</span>
        files = os.listdir(dir_name)

        <span style="color:rgb(153,153,136);font-style:italic"># Set values for progress bar.</span>
        self._progress.setRange(<span style="color:rgb(0,153,153)">0</span>, len(files))
        self._progress.setValue(<span style="color:rgb(0,153,153)">0</span>)

        <span style="color:rgb(153,153,136);font-style:italic"># Create and start the thread.</span>
        self._thread.files = files
        self._thread.start()

    <span><span style="color:rgb(51,51,51);font-weight:bold">def</span> <span style="color:rgb(153,0,0);font-weight:bold">_file_processed</span><span>(self, num_files_processed, filename)</span>:</span>
        <span style="color:rgb(153,153,136);font-style:italic"># Called for each file that is processed.</span>
        self._filelist.appendPlainText(filename)
        self._progress.setValue(num_files_processed)

<span style="color:rgb(51,51,51);font-weight:bold">if</span> __name__ == <span style="color:rgb(221,17,68)">'__main__'</span>:
    app = QtGui.QApplication(sys.argv)
    w = MyWidget()
    w.show()
    w.raise_()
    <span style="color:rgb(51,51,51);font-weight:bold">raise</span> SystemExit(app.exec_())</code></pre>
                                                    <p
                                                      style="margin:1.2em
                                                      0px!important">This
                                                      is all fine, but
                                                      it might not solve
                                                      your original
                                                      problem of the
                                                      file dialog not
                                                      closing. On my
                                                      Mac, the file
                                                      dialog is gone as
                                                      soon as the call
                                                      to <code
                                                        style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px
                                                        0.15em;padding:0px
                                                        0.3em;white-space:pre-wrap;border:1px
                                                        solid
rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline">getExistingDirectory()</code>
                                                      finishes. However,
                                                      since I don’t have
                                                      a runnable portion
                                                      of your code, I
                                                      can’t really test
                                                      it. I would
                                                      recommend
                                                      attempting to run
                                                      my example to see
                                                      if it exhibits the
                                                      same problem as
                                                      your program. Hope
                                                      this helps!</p>
                                                    <p
                                                      style="margin:1.2em
                                                      0px!important">Cheers,</p>
                                                  </div>
                                                  <div>
                                                    <div><br>
                                                    </div>
                                                  </div>
                                                </div>
                                                <div class="gmail_extra"><br
                                                    clear="all">
                                                  <div>
                                                    <div><br>
                                                    </div>
                                                    <div>--</div>
                                                    <div>Sean Fisk</div>
                                                  </div>
                                                  <br>
                                                  <br>
                                                  <div
                                                    class="gmail_quote">On
                                                    Tue, Dec 10, 2013 at
                                                    4:43 PM, Frank
                                                    Rueter | OHUfx <span
                                                      dir="ltr"><<a
                                                        moz-do-not-send="true"
href="mailto:frank@ohufx.com" target="_blank">frank@ohufx.com</a>></span>
                                                    wrote:<br>
                                                    <blockquote
                                                      class="gmail_quote"
                                                      style="margin:0 0
                                                      0
                                                      .8ex;border-left:1px
                                                      #ccc
                                                      solid;padding-left:1ex">
                                                      <div
                                                        bgcolor="#FFFFFF"
                                                        text="#000000">
                                                        Here is an
                                                        example using
                                                        signals/slots
                                                        <div>
                                                          <div><br>
                                                          <br>
                                                          <div>On
                                                          11/12/13
                                                          09:56,
                                                          Janwillem van
                                                          Dijk wrote:<br>
                                                          </div>
                                                          <blockquote
                                                          type="cite">
                                                          <div>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Here



                                                          is the
                                                          snippet: It
                                                          reads the
                                                          filenames in a
                                                          folder and
                                                          determines new
                                                          names for
                                                          photo's based
                                                          on the exif
                                                          info.</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">I
                                                          apreciate that
                                                          threading
                                                          might be a
                                                          solution but
                                                          the problem
                                                          seems too
                                                          simple for
                                                          that. Can you
                                                          give an
                                                          example on how
                                                          to use the
                                                          signal
                                                          concept?<br>
                                                          </p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><br>
                                                          self.outFolder
                                                          =
                                                          QFileDialog.getExistingDirectory(</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          caption='Destination

                                                          folder',
                                                          dir=self.defOutFolder)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          self.outFiles
                                                          = []</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          if
                                                          self.outFolder:</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          self.outFolder
                                                          =
                                                          self.outFolder.replace('\\',
                                                          '/')</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">self.lineEdit_dest.setText(self.outFolder)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          self.progressBar.setRange(0,


                                                          self.numFiles)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          for i, fname
                                                          in
                                                          enumerate(self.inFiles):</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          self.progressBar.setValue(i

                                                          + 1)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          newpath,
                                                          newfname =
                                                          rename_photo(self.inFolder,
                                                          fname)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          newpath =
                                                          path.join(self.outFolder,
                                                          newpath)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          self.outFiles.append([fname,


                                                          newpath,
                                                          newfname])</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          s = fname + '
                                                          --> ' +
                                                          self.outFolder
                                                          + '\n'</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          s +=
                                                          path.join(newpath,
                                                          newfname).replace(self.outFolder,

                                                          '')</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">self.plainTextEdit_dest.appendPlainText(s)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><br>
                                                          </p>
                                                          <br>
                                                          On 10/12/13
                                                          21:35, Sean
                                                          Fisk wrote:<br>
                                                          </div>
                                                          <blockquote
                                                          type="cite">
                                                          <div dir="ltr">
                                                          <div>
                                                          <p
                                                          style="margin:1.2em
                                                          0px!important">Hi

                                                          Janwillem,</p>
                                                          <p
                                                          style="margin:1.2em
                                                          0px!important">Are

                                                          you running
                                                          the “lengthy
                                                          part that
                                                          processes a
                                                          files list”
                                                          within the GUI
                                                          thread? If so,
                                                          you will
                                                          probably see
                                                          your GUI hang
                                                          while this is
                                                          happening (you
                                                          won’t be able
                                                          to click or do
                                                          anything). In
                                                          this case, you
                                                          should
                                                          consider
                                                          running the
                                                          processing in
                                                          a different
                                                          thread using <a
moz-do-not-send="true"
href="http://seanfisk.github.io/pyside-docs/pyside/PySide/QtCore/QThread.html"
target="_blank">QThread</a> or <a moz-do-not-send="true"
href="http://seanfisk.github.io/pyside-docs/pyside/PySide/QtCore/QThreadPool.html"
target="_blank">QThreadPool</a>.</p>
                                                          <p
                                                          style="margin:1.2em
                                                          0px!important">Can

                                                          you post the
                                                          relevant part
                                                          of the code?</p>
                                                          <p
                                                          style="margin:1.2em
                                                          0px!important">Thanks,</p>
                                                          </div>
                                                          </div>
                                                          <div
                                                          class="gmail_extra"><br
                                                          clear="all">
                                                          <div>
                                                          <div><br>
                                                          </div>
                                                          <div>--</div>
                                                          <div>Sean Fisk</div>
                                                          </div>
                                                          <br>
                                                          <br>
                                                          <div
                                                          class="gmail_quote">On

                                                          Tue, Dec 10,
                                                          2013 at 3:17
                                                          PM, Janwillem
                                                          van Dijk <span
                                                          dir="ltr"><<a
moz-do-not-send="true" href="mailto:jwevandijk@xs4all.nl"
                                                          target="_blank">jwevandijk@xs4all.nl</a>></span>
                                                          wrote:<br>
                                                          <blockquote
                                                          class="gmail_quote"
                                                          style="margin:0
                                                          0 0
                                                          .8ex;border-left:1px
                                                          #ccc
                                                          solid;padding-left:1ex">
                                                          <div
                                                          bgcolor="#FFFFFF"
                                                          text="#000000">
                                                          Hi, I have a
                                                          PySide script
                                                          that uses
                                                          QFileDialog.getExistingDirectory().
                                                          After clicking
                                                          the Open
                                                          button the
                                                          script
                                                          proceeds with
                                                          a lengthy part
                                                          that processes
                                                          a files list
                                                          and writes to
                                                          a
                                                          QPlainTextEdit.
                                                          Unfortunately
                                                          the
                                                          QFileDialog
                                                          widget does
                                                          only disappear
                                                          after this
                                                          processing is
                                                          finished,
                                                          hiding the
                                                          QPlainTextEdit.<br>
                                                          <br>
                                                          How can I make
                                                          that the
                                                          QFileDialog
                                                          widget is gone
                                                          before the
                                                          processing
                                                          starts?<br>
                                                          <br>
                                                          Cheers,
                                                          Janwillem<br>
                                                          <br>
                                                          <br>
                                                          <br>
                                                          </div>
                                                          <br>
_______________________________________________<br>
                                                          PySide mailing
                                                          list<br>
                                                          <a
                                                          moz-do-not-send="true"
href="mailto:PySide@qt-project.org" target="_blank">PySide@qt-project.org</a><br>
                                                          <a
                                                          moz-do-not-send="true"
href="http://lists.qt-project.org/mailman/listinfo/pyside"
                                                          target="_blank">http://lists.qt-project.org/mailman/listinfo/pyside</a><br>
                                                          <br>
                                                          </blockquote>
                                                          </div>
                                                          <br>
                                                          </div>
                                                          </blockquote>
                                                          <br>
                                                          </blockquote>
                                                          <br>
                                                          </div>
                                                        </div>
                                                      </div>
                                                    </blockquote>
                                                  </div>
                                                  <br>
                                                </div>
                                              </blockquote>
                                              <br>
                                            </div>
                                          </div>
                                        </div>
                                      </blockquote>
                                    </div>
                                    <br>
                                  </div>
                                </blockquote>
                                <br>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>