<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 2 May 2017 at 17:55, Frank Rueter | OHUfx <span dir="ltr"><<a href="mailto:frank@ohufx.com" target="_blank">frank@ohufx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  

    
  
  <div bgcolor="#FFFFFF">
    Hi all,<br>
    <br>
    Here is a snippet of test code to mimic a light weight tree model.<br>
    All it is trying to do is mimic the parenting according to the
    directory structure on disk using QStandardItems in a
    QStandardModel.<br>
    It works, but it took me way longer to figure out than I expected,
    and I have a feeling some of you may have good advise on how to make
    it more efficient.<br>
    <a class="gmail-m_8855862132058968830moz-txt-link-freetext" href="https://pastebin.com/vRkzDPtt" target="_blank">https://pastebin.com/vRkzDPtt</a></div></blockquote><div><br></div><div>What's your definition of "more efficient", what are the problems, what make you think it's not efficient?<br><br></div><div>If you want efficiency, then don't use python and don't use     QStandardModel, if you want expediency then use QFileSystemModel.<br><br></div><div>My 2 cents.<br></div><div>Chris<br></div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><br>
    <br>
    I am not using QFileSystemModel as I wanted to keep things as
    efficient as possible and also need to add some custom items to the
    model.<br>
    Also, for the Python programmers: in my actual code I am using
    scandir.walk() instead of os.walk() for speed.<br>
    <br>
    Any input would be greatly appreciated as I will need to run this
    over disks that have massive amounts of files.<br>
    <br>
    Cheers,<br>
    frank<span class="gmail-HOEnZb"><font color="#888888"><br>
    <br>
    <br>
    <div class="gmail-m_8855862132058968830moz-signature">-- <br>
      <p> </p>
      
      <table style="width:524px;height:58px" border="0">
        <tbody>
          <tr>
            <td style="text-align:right"><a href="http://www.ohufx.com" target="_blank"><img src="http://ohufx.com/images/ohufxLogo_50x50.png" alt="ohufxLogo 50x50"></a> </td>
            <td style="text-align:center"> <br>
            </td>
            <td style="text-align:left"><b><span style="font-size:8pt"><a href="http://ohufx.com/compositing.html" target="_blank">vfx
                    compositing</a></span> | <span style="font-size:8pt"><b><a href="http://ohufx.com/customising.html" target="_blank">workflow
                      customisation and consulting</a></b> </span>
              </b> </td>
          </tr>
          <tr>
            <td style="text-align:right"> </td>
            <td style="text-align:center"> </td>
            <td style="text-align:left"><b><span style="font-size:8pt"><a href="http://ohufx.com/compositing.html" target="_blank"> </a></span></b>
              <br>
            </td>
          </tr>
          <tr>
            <td style="text-align:right"><a href="http://www.nukepedia.com/nubridge" target="_blank"><img src="http://nukepedia.com/images/nuBridge/logo/nuBridge_logo.png" alt=""> </a> </td>
            <td style="text-align:center"> <br>
            </td>
            <td style="text-align:center">
              <p style="text-align:left"><a style="color:rgb(153,153,153);font-size:10px;font-family:arial,helvetica,sans-serif" href="http://www.nukepedia.com/nubridge" target="_blank">Your
                  gateway to over 1,000 free tools... right inside of
                  Nuke</a>
                 </p>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </font></span></div>

<br>______________________________<wbr>_________________<br>
Interest mailing list<br>
<a href="mailto:Interest@qt-project.org">Interest@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/interest" rel="noreferrer" target="_blank">http://lists.qt-project.org/<wbr>mailman/listinfo/interest</a><br>
<br></blockquote></div><br></div></div>