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

QItemDelegate will continue receiving mouseover state after mouse has exited the widget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.9
    • 5.4.2
    • Widgets: Itemviews
    • None
    • Qt 5.4.2 gcc 64-bit, Linux Mint 17.1 Cinnamon
    • 4f324d4655a093b406134624ff753eb518429b83

    Description

      • Create a QTableWidget, fill it with any arbitrary data and enable mouse tracking
      • Set a custom item delegate
      • Override the delegate paint() method to switch on whether or not QStyleOptionViewItem::state contains QStyle::State_MouseOver or not

      Expected behaviour: when moving over the table cells, the cell under the mouse is painted differently and when exiting the table, all cells look the same.

      Actual result: If the mouse exits the table widget from the side of the currently hovered cell, that cell will remain active and its delegate's paint() method will continue having QStyle::State_MouseOver option flag (move mouse from bottom to top and upwards out of the widget).

      Attached is a working code sample that demonstrates the bug.

      Attachments

        1. main.cpp
          0.8 kB
        2. qtbug46785_qt487.tiff
          15 kB
        3. qtbug46785.zip
          1 kB
        4. untitled1.pro
          0.3 kB
        For Gerrit Dashboard: QTBUG-46785
        # Subject Branch Project Status CR V

        Activity

          People

            dcape Dan Cape
            rerelease Karl Puusepp
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes