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

Edit of tree and list does not follow the QLineEdit style

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.0
    • None
    • Windows

    Description

      The edit action to rename on tree and list does not follow the QLineEdit style.
      I had to add a padding to have the exact same result as QLineEdit:

      void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index) const override
      {
          QStyleOptionViewItem itemOption = option;
          initStyleOption(&itemOption, index);
          
          QRect geom = QApplication::style()->subElementRect(QStyle::SE_ItemViewItemText, &itemOption, editor);
          geom.setTop(geom.top() - 4);
          geom.setBottom(geom.bottom() + 5);
          
          editor->setGeometry(geom);
      } 

      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
            alundra Michael Ségura
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes