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

Qt 5 to-do's in QItemDelegate and QStyledItemDelegate

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 5.0.0 Beta 1
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Technical Risk:
      Normal

      Description

      QItemDelegate::setEditorData() contains a couple of Qt 5 to-do comments (and the same code also appears in QStyledItemDelegate::setEditorData()):

      qtbase/src/widgets/itemviews/qitemdelegate.cpp
      void QItemDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
      {
      #ifdef QT_NO_PROPERTIES
          Q_UNUSED(editor);
          Q_UNUSED(index);
      #else
          Q_D(const QItemDelegate);
          QVariant v = index.data(Qt::EditRole);
          QByteArray n = editor->metaObject()->userProperty().name();
      
          // ### Qt 5: remove
          // A work-around for missing "USER true" in qdatetimeedit.h for
          // QTimeEdit's time property and QDateEdit's date property.
          // It only triggers if the default user property "dateTime" is
          // reported for QTimeEdit and QDateEdit.
          if (n == "dateTime") {
              if (editor->inherits("QTimeEdit"))
                  n = "time";
              else if (editor->inherits("QDateEdit"))
                  n = "date";
          }
      
          // ### Qt 5: give QComboBox a USER property
          if (n.isEmpty() && editor->inherits("QComboBox"))
              n = d->editorFactory()->valuePropertyName(v.userType());
          if (!n.isEmpty()) {
              if (!v.isValid())
                  v = QVariant(editor->property(n).userType(), (const void *)0);
              editor->setProperty(n, v);
          }
      #endif
      

      These comments should be actioned for Qt 5.0.0 (if that can be done without breaking source-compatibility), removed, or changed to Qt 6 to-do's.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              stephen.kelly Stephen Kelly (Unused account) (Inactive)
              Reporter:
              jasmcdon Jason McDonald (Closed Nokia Identity. Please assign to "macadder" instead) (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 minute
                  1m

                    Gerrit Reviews

                    There are no open Gerrit changes