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

There is no Qt:SortRole

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.6.3, 4.7.0, 4.7.1, 4.7.2, 4.8.0, 4.8.x, 5.0.0, Some future release
    • Widgets: Itemviews
    • None

    Description

      For exmple:

      bool QTableWidgetItem::operator<(const QTableWidgetItem &other) const
      {
          const QVariant v1 = data(Qt::DisplayRole), v2 = other.data(Qt::DisplayRole);
          return QAbstractItemModelPrivate::variantLessThan(v1, v2);
      }
      

      Suppose, We have column "event time" which is storing time_t as Qt::SortRole and "Today","last week" and so on in Qt::DisaplayRole
      ( Now, I use hidden column with time_t just for correct sorting )

      It will be nice, if Qt::SortRole role data may be specified. When no such role set, standard implementation should user Qt::DisplayRole.

      Also, please update Documentation in QTableWidget and maybe other places where you are talking about sorting, that sorting is based on Qt::DisplayRole.

      Attachments

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

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            socketpair@gmail.com Коренберг Марк
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes