Important: Please read the Qt Code of Conduct -

SizeHint's "option" seems to be out of date when handed down to function

  • I have a QListView with an AbstractItemDelegate doing the "sizeHint" and "Paint" for my rows.

    My goal:

    Every "mouse-over" row should double in height so that I can draw more on it.


    In my paint method: the "option.state & QStyle::State_MouseOver" is always correct and i use it to slightly highlight the row the mouse cursor is on...

    in my SizeHint method however, the "option.state & QStyle::State_MouseOver" is always "off", even if the row is currently under my mouse. This makes it impossible for me to suggest a different height for the row base don that case.

    Is that a Qt bug?

  • There certainly are issues in that area of Qt. I've ran into similar problems before.

    See for instance this "report":

Log in to reply