Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-94993

Documentation for QVector, QList classes should mention how to sort them

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 5.15.2, 6.1.2
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None
    • Platform/s:
      All

      Description

      Documentation for QVector, QList and probably other containers do not even mention how to sort them. Open in a browser > Find on a page > type in "sort" > Phase not found, 0 matches.

      Few minutes later, I found through web search engine (and also folks pointed out in chat) that I should use std::stable_sort and other STL/std::methods. For people coming from non C++ background (hello, rust) it may not be obvious. In such situation they ain't gonna be looking "STL" nor "iterators", they expect to find some }}{{sort() method, or at least a reference to it. Unfortunately, STL-iterator is not formally an interface, it can not be "implemented" by a class, so no members could be shown through inheritance list.

      A brief enumeration of such common operations on a container, including filtering and mapping would certainly help newcomers find the info they need.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            docteam Qt Documentation Team
            Reporter:
            ratijas ivan tkachenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes