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. QAction hover background
Forum Updated to NodeBB v4.3 + New Features

QAction hover background

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 1.0k Views
  • 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.
  • Maaz MominM Offline
    Maaz MominM Offline
    Maaz Momin
    wrote on last edited by
    #1

    I have a QWidgetAction to which i have my custom widget added. I need to set background color to this widget when hovered. The background color should be similar to a QMenu/ QAction when hovered (Dependent on platform).

    This is what i have tried :
    QBrush brush = mycustomWidget->palette().brush(QPalette::Active, QPalette::Highlight);
    brush.color().name(QColor::HexArgb);
    this->setStyleSheet(QString("MyCustomWidget:hover{background-color: %1;}").arg(highlightColor));

    But this highlight color is similar in both Windows 7 and Win 10. While the hover color of QMenu/QAction changes in Win7 and Win10.

    Thanks in advance

    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