[Qt-interest] Issues with QModelTest
Stephen Kelly
steveire at gmail.com
Tue Mar 15 13:08:16 CET 2011
Scott Aron Bloom wrote:
> Im using the latest qmodeltest, from the KDE area.. (Don't have the URL
> handy)
>
https://projects.kde.org/projects/kde/kdelibs/repository/revisions/master/show/kdeui/tests/proxymodeltestsuite
> The issue is, the children of a node, are only loaded when the node is
> expanded.. However, a dummy child count is used so the "+" is always
> show. If there no actual children, the plus goes away on expansion
You need to implement hasChildren, not use a dummy child.
>
> Here is the problem.. the "fetchMore" function, does something like this
>
> beginRemoveRows( parent, 0, 0 );
> removeDummyChild();
> endRemoveRows();
> int realChildCount = getRealChildCOunt();
> if ( !realChildCount )
> return;
> beginInsertRows( parent, 0, realChildCount - 1 );
> loadRealchildren();
> endInsertRows();
Then you don't need this code.
Steve.
More information about the Qt-interest-old
mailing list