Hello.
I want to show only limited count of items from in ListView.
I create QSortFilterProxyModel subclass and reimplement rowCount method. But 
this doesn't work. 
If I return some number from rowCount - view doesn't show anything. If I 
return QSortFilterProxyModel::rowCount(parent) - ListView show all elements 
from model.

// Show all(7) elements from source model
int LimitProxyModel::rowCount(const QModelIndex& parent) const
{
    return QSortFilterProxyModel(parent);
}

// Show all(7) elements from source model
int LimitProxyModel::rowCount(const QModelIndex& parent) const
{
    int count = sourceModel()->rowCount(parent);
    return count;
}

// Show nothing
int LimitProxyModel::rowCount(const QModelIndex& parent) const
{
    int count = sourceModel()->rowCount(parent);
    return 7;
}

// Show nothing
int LimitProxyModel::rowCount(const QModelIndex& parent) const
{
    return 7;
}

Have you any ideas?
Thank you


_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to