Note that there are some explanatory texts on larger screens.

plurals
  1. POQListView displays different sized items depending on sort order of model
    text
    copied!<p>Im trying to sort a QFileSystemModel by name, date of creation and date of last access (all ascending and descending). Im using QSortFilterProxyModel for sorting. Somehow there is a strange effect when changing sort order: The number of characters displayed until the name gets elided varies very strong. Depending on the sort order, some items have only three letters (Pro...) while others have up to ten (Programms). I already set the views grid size big enough (100x100), changing the icon size doesnt affect the view. </p> <p>If I sort the QFileSystemModel directly everything works fine, but I cant sort by other aspects than filename then.</p> <p>Where can I change the behavior how QSortFilterProxyModel elides text? Why does my proxy affect the view at all? Where can I find any further information about the QFileSystemModel at all? I still dont know what data is stored in the other columns (#1 is filename).</p> <p><strong>Screenshot:</strong></p> <p><img src="https://i.stack.imgur.com/NzeqD.png" alt="alt text"></p> <p>As you can see, depending on the sortorder, filenames get elided or they don't. If im sorting descending, its "twai...", if im sorting ascending its "twain.dll". </p> <p><strong>Thats the code which gets executed when I click the sort arrow:</strong></p> <pre><code>// initialization fileNameSortModel = new QSortFilterProxyModel(parent); fileNameSortModel.sourceModel(originalModel); // originalModel is type of QFileSystemModel // ... void PFileListWithHeader::onNameSort(Qt::SortOrder order) { currentModel = fileNameSortModel; view-&gt;setModel(currentModel); view-&gt;setRootIndex(translateOriginalIndexToProxy(originalModel-&gt;index(path))); currentModel-&gt;sort(0, order); } </code></pre> <p>Thanks in advance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload