[Qt-interest] Writing a table proxy model for QFileSystemModel

J-P Nurmi jpnurmi at gmail.com
Thu Jul 1 11:17:01 CEST 2010


On Thu, Jul 1, 2010 at 11:18 AM, Mandeep Sandhu
<mandeepsandhu.chd at gmail.com> wrote:
>> "Unlike the QDirModel, QFileSystemModel uses a separate thread to
>> populate itself so it will not cause the main thread to hang as the
>> file system is being queried. Calls to rowCount() will return 0 until
>> the model populates a directory."
>>
>
> I had read this too. But there's no info on how to find out when a
> filesystem model is populated.
>
> The only 2 signals emitted (fileRenamed/rootPathChanged ) do not tell
> a user _when_ a FS model is fully populated.
>
> -mandeep
>

Presumably there is no such signal as "fully populated". The model
will inform in standard way when rows are inserted (QAbstractItemModel
API). I guess you should just forget about checking the row count
immediately after setting a root path. Proxy models should
automatically react to changes in their source models.

--
J-P Nurmi



More information about the Qt-interest-old mailing list