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

Make QTableWidgetItem accept QVariant instead of QString

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • Not Evaluated
    • 6.0
    • 6.0
    • Widgets: Itemviews
    • None

    Description

      I see a lot of users that are approaching QTableWidgetItem using it in the wrong way due to the fact that the constructor forces to have a QString.
      See for example: https://forum.qt.io/topic/68256/void-qtablewidget-sortitems
      https://forum.qt.io/topic/82825/show-integer-value-in-qtable-widget

      I see no point in forcing a QString as it immediately gets passed to setData that uses QVariant

      I realise this is a break in the interface so should wait for Qt6 but it should not break source compatibility so I see no downside in changing it to QVariant

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            VRonin Luca
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes