Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. My QStyledItemDelegate does not behave consistently on Windows and Mac.

My QStyledItemDelegate does not behave consistently on Windows and Mac.

Scheduled Pinned Locked Moved General and Desktop
qstyleditemdeleqlistview
1 Posts 1 Posters 773 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ealioneE Offline
    ealioneE Offline
    ealione
    wrote on last edited by ealione
    #1

    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?

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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved