[Interest] building a light weight tree model

Ch'Gans chgans at gna.org
Tue May 2 08:25:51 CEST 2017


On 2 May 2017 at 17:55, Frank Rueter | OHUfx <frank at ohufx.com> wrote:

> Hi all,
>
> Here is a snippet of test code to mimic a light weight tree model.
> All it is trying to do is mimic the parenting according to the directory
> structure on disk using QStandardItems in a QStandardModel.
> 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.
> https://pastebin.com/vRkzDPtt
>

What's your definition of "more efficient", what are the problems, what
make you think it's not efficient?

If you want efficiency, then don't use python and don't use QStandardModel,
if you want expediency then use QFileSystemModel.

My 2 cents.
Chris



>
>
> 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.
> Also, for the Python programmers: in my actual code I am using
> scandir.walk() instead of os.walk() for speed.
>
> Any input would be greatly appreciated as I will need to run this over
> disks that have massive amounts of files.
>
> Cheers,
> frank
>
>
> --
>
> [image: ohufxLogo 50x50] <http://www.ohufx.com>
> *vfx compositing <http://ohufx.com/compositing.html> | workflow
> customisation and consulting <http://ohufx.com/customising.html> *
>     * <http://ohufx.com/compositing.html>*
> <http://www.nukepedia.com/nubridge>
>
> Your gateway to over 1,000 free tools... right inside of Nuke
> <http://www.nukepedia.com/nubridge>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170502/288d1011/attachment.html>


More information about the Interest mailing list