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

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

    XMLWordPrintable

Details

    • All
    • 8
    • 4f66c10ba (dev), ceaf5b9a2 (6.8)
    • Foundation Sprint 111, Foundation Sprint 112, Foundation Sprint 113

    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

            javyas Jaishree Vyas
            ratijas ivan tkachenko
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes