beginResetModel(); // ... total data change endResetModel();
emit layoutAboutToBeChanged(); // изменение данных emit layoutChanged();
C++ (Qt)bool CFileBrowserSortModel::lessThan(const QModelIndex &left, const QModelIndex &right) const { QVariant leftData = sourceModel()->data(left); QVariant rightData = sourceModel()->data(right); // Always put upper directory to the top for both orders types- QString leftFileName = sourceModel()->data(index(left.row(), 0)).toString();- QString rightFileName = sourceModel()->data(index(right.row(), 0)).toString();+ QString leftFileName = sourceModel()->data(sourceModel()->index(left.row(), 0)).toString();+ QString rightFileName = sourceModel()->data(sourceModel()->index(right.row(), 0)).toString();