Important: Please read the Qt Code of Conduct -

My QStyledItemDelegate does not behave consistently on Windows and Mac.

  • I have created a QListView that uses a QStyledItemDelegate to display some data.

    In my custom delegate I have a paint event that is responsible for painting the text the way I want it

    void UserListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
    if (option.state & (QStyle::State_MouseOver))
             // Change color.

    The thing is that this works fine on windows and the paint event is called each time I hover above an item. In MacOS though it does not. My widget does not care if I hover above an item or not.

    This is one of the many ways that paint works differently on Mac and Windows.

    Has anyone any idea on why is that?

    If the info I provided is not enough, please do say so.