Qt-interest Archive, December 2007
Asynchronous QDirModel
Message 1 in thread
Hello,
I would like to have a QDirModel which is working asynchronous for queries against the filesystem.
The problem is, when a system has connections to a lot of network shares the user gui seems to be blocked during scanning these filesystems (under windows...)
The Property "lazyChildCount" helps a little bit, but sometimes it would not be sufficient.
It would be better when the reading process could be placed in an seperate thread.
I checked the sourcecode of QDirModel, but the access to the filesystem seems to be spreaded over the complete class.
Has somebody hints for me to come further?
best regards
karl-heinz
--
[ signature omitted ]
Message 2 in thread
I'm not using QDirModel because I need a lot of extra stuff. I've ended
up creating a fairly
elaborate system where the QAbstractModel requesting info from my
FileSys (Fs) object
which then queues a "job" to a worker thread. After the job finishes, it
sends an event which
contains the data to the Fs object which stores it and then signals the
QAbstractModel's dataChanged
signal.
Karl-Heinz Reichel wrote:
> Hello,
> I would like to have a QDirModel which is working asynchronous for queries against the filesystem.
> The problem is, when a system has connections to a lot of network shares the user gui seems to be blocked during scanning these filesystems (under windows...)
> The Property "lazyChildCount" helps a little bit, but sometimes it would not be sufficient.
> It would be better when the reading process could be placed in an seperate thread.
> I checked the sourcecode of QDirModel, but the access to the filesystem seems to be spreaded over the complete class.
> Has somebody hints for me to come further?
>
> best regards
> karl-heinz
>
>
>
--
[ signature omitted ]
Message 3 in thread
Yes I came to the same conclusion.
For a simple app with low requirements this model can be sufficient.
But in a "real-world" app it cannot be tolerated that the model blocks the
complete
Userinterface-Thread during scanning the directory.
So I will try to implement such a kind of model for my own :-(
Regards
Karl-Heinz
> -----Ursprüngliche Nachricht-----
> Von: Peter Hackett [mailto:peter@xxxxxxxxxxxx]
> Gesendet: Dienstag, 11. Dezember 2007 19:24
> An: Karl-Heinz Reichel
> Cc: qt-interest@xxxxxxxxxxxxx
> Betreff: Re: Asynchronous QDirModel
>
> I'm not using QDirModel because I need a lot of extra stuff. I've ended
> up creating a fairly
> elaborate system where the QAbstractModel requesting info from my
> FileSys (Fs) object
> which then queues a "job" to a worker thread. After the job finishes,
> it
> sends an event which
> contains the data to the Fs object which stores it and then signals the
> QAbstractModel's dataChanged
> signal.
>
> Karl-Heinz Reichel wrote:
> > Hello,
> > I would like to have a QDirModel which is working asynchronous for
> queries against the filesystem.
> > The problem is, when a system has connections to a lot of network
> shares the user gui seems to be blocked during scanning these
> filesystems (under windows...)
> > The Property "lazyChildCount" helps a little bit, but sometimes it
> would not be sufficient.
> > It would be better when the reading process could be placed in an
> seperate thread.
> > I checked the sourcecode of QDirModel, but the access to the
> filesystem seems to be spreaded over the complete class.
> > Has somebody hints for me to come further?
> >
> > best regards
> > karl-heinz
> >
> >
> >
--
[ signature omitted ]
Message 4 in thread
On Tuesday 11 December 2007 09:54:49 Karl-Heinz Reichel wrote:
> Hello,
> I would like to have a QDirModel which is working asynchronous for queries
> against the filesystem. The problem is, when a system has connections to a
> lot of network shares the user gui seems to be blocked during scanning
> these filesystems (under windows...) The Property "lazyChildCount" helps a
> little bit, but sometimes it would not be sufficient. It would be better
> when the reading process could be placed in an seperate thread. I checked
> the sourcecode of QDirModel, but the access to the filesystem seems to be
> spreaded over the complete class. Has somebody hints for me to come
> further?
>
> best regards
> karl-heinz
In 4.4 you can check out the QFileSystemModel which is now public. (or in 4.3
just grab the sources out of Qt)
-Benjamin Meyer
--
[ signature omitted ]
Message 5 in thread
This new Model seem's to fit exactly our needs..
Thanks
Karl-Heinz
> -----Ursprüngliche Nachricht-----
> Von: Benjamin Meyer [mailto:bmeyer@xxxxxxxxxxxxx]
> Gesendet: Freitag, 14. Dezember 2007 21:55
> An: qt-interest@xxxxxxxxxxxxx
> Betreff: Re: Asynchronous QDirModel
>
> On Tuesday 11 December 2007 09:54:49 Karl-Heinz Reichel wrote:
> > Hello,
> > I would like to have a QDirModel which is working asynchronous for
> queries
> > against the filesystem. The problem is, when a system has connections
> to a
> > lot of network shares the user gui seems to be blocked during
> scanning
> > these filesystems (under windows...) The Property "lazyChildCount"
> helps a
> > little bit, but sometimes it would not be sufficient. It would be
> better
> > when the reading process could be placed in an seperate thread. I
> checked
> > the sourcecode of QDirModel, but the access to the filesystem seems
> to be
> > spreaded over the complete class. Has somebody hints for me to come
> > further?
> >
> > best regards
> > karl-heinz
>
> In 4.4 you can check out the QFileSystemModel which is now public. (or
> in 4.3
> just grab the sources out of Qt)
>
> -Benjamin Meyer
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
--
[ signature omitted ]
Message 6 in thread
Hello,
I tried to use the new QFileSystemModel from Qt4.4...
But there are some very strange point's I have found out...
First of all, the QFileSytemModel is able to use filters
(in this case namefilters). But files which don't fit the filter
criteria will be visible in the connected ListView (disabled but visible).
And as far as I understood the code this is defined by design.
Furthermore drives seems to be visible all the time (this is usefull in
Treeviews but not in ListViews for filedetails).
So the new QFileSytemModel is not really a replacement for the old
QDirModel.
On further suggestion: It would be very helpful for developers when there
would
Be a signal which is showing that the scan process for the directory has
finished.
Best regards
Karl-Heinz
> -----Ursprüngliche Nachricht-----
> Von: Benjamin Meyer [mailto:bmeyer@xxxxxxxxxxxxx]
> Gesendet: Freitag, 14. Dezember 2007 21:55
> An: qt-interest@xxxxxxxxxxxxx
> Betreff: Re: Asynchronous QDirModel
>
> On Tuesday 11 December 2007 09:54:49 Karl-Heinz Reichel wrote:
> > Hello,
> > I would like to have a QDirModel which is working asynchronous for
> queries
> > against the filesystem. The problem is, when a system has connections
> to a
> > lot of network shares the user gui seems to be blocked during
> scanning
> > these filesystems (under windows...) The Property "lazyChildCount"
> helps a
> > little bit, but sometimes it would not be sufficient. It would be
> better
> > when the reading process could be placed in an seperate thread. I
> checked
> > the sourcecode of QDirModel, but the access to the filesystem seems
> to be
> > spreaded over the complete class. Has somebody hints for me to come
> > further?
> >
> > best regards
> > karl-heinz
>
> In 4.4 you can check out the QFileSystemModel which is now public. (or
> in 4.3
> just grab the sources out of Qt)
>
> -Benjamin Meyer
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
--
[ signature omitted ]
Message 7 in thread
On Tuesday 18 December 2007 11:57:25 you wrote:
> Hello,
> I tried to use the new QFileSystemModel from Qt4.4...
> But there are some very strange point's I have found out...
>
> First of all, the QFileSytemModel is able to use filters
> (in this case namefilters). But files which don't fit the filter
> criteria will be visible in the connected ListView (disabled but visible).
You probably want to use setNameFilterDisables(false) to get the behavior you
are looking for.
> And as far as I understood the code this is defined by design.
> Furthermore drives seems to be visible all the time (this is usefull in
> Treeviews but not in ListViews for filedetails).
If you set the root directory to be "C:\foo\bar" only the C drive should be
there until the user browses to My Computer at which point it will load up
the rest of the drives. Unlike the dirmodel which will stat all your drives
and directories up to the root path no matter what your root path is.
> So the new QFileSytemModel is not really a replacement for the old
> QDirModel.
>
> On further suggestion: It would be very helpful for developers when there
> would
> Be a signal which is showing that the scan process for the directory has
> finished.
A good idea, thanks.
> Best regards
> Karl-Heinz
--
[ signature omitted ]