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

QAbstractItemView with AStyledItemDelegate and Windows11Style

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.9.1, 6.9.2
    • Widgets: Styles
    • OS: Windows 11
    • Windows

      I found some bugs. All of these bugs only appear when using Windows 11 Style and QStyledItemDelegate as delegate in the QAbstractItemView (QTreeView, QTableView).

      In attachment you will find code for building of test program and screenshots with bug numbers. Look at the comments in the code.

       

      BUG 1:
      If we use QStyledItemDelegate or QItemDelegate as ItemDelegate in treeView (QTreeView) or in tableView (QTableView), and try to edit the text in any cell (for example with double click to cell or with press F2 key), so the painted text in the delegate for current modelindex is also visible in the LineEdit. It seems the LineEdit field has tranparency background.

       

      BUG 2: (only in Windows11 - Light Mode)
      If we set the property alternatingRowColors to true and Windows has Light Mode, then for text color (foreground color) in selected cells will be used palette().text().color(), NOT palette().highlightedText().color() like in other styles.
      By using of Windows Dark Mode is all right.

       

      BUG 3:
      If we treeView (QAbstractItemView) has many columns and we want to display only one column, but not column 0, and other columns are invisible, then the rectangle for the selected cell is drawn with rounded corners only on the left, while the rectangle on the right is displayed without rounding.
      In other cases, when multiple columns are displayed or the other column is displayed, the rectangle is drawn with rounded corners on both sides.

       

      BUG 4:
      The cell(s) with the mouse over this has the same color(s) as the selected cell(s).
      It's difficult to distinguish which cells have been selected.

       

      BUG 5:
      When we use our own popup view in a combobox and this popup itemview has many columns,
      and header property SectionResizeMode is QHeaderView::ResizeToContents,
      then the texts will be displayed as elided text.
      It's important for us to see all full texts in the combo popup, especially for main column (pcb->modelColumn()).
      If we use QItemDelegate in combo popup view or windowvista style, it will be displayed correctly.

       

        For Gerrit Dashboard: QTBUG-140494
        # Subject Branch Project Status CR V

            tpochep Timur Pocheptsov
            igor_makarov Igor Makarov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: