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. Stylesheet :hover not working after frameless window drag&drop
Forum Updated to NodeBB v4.3 + New Features

Stylesheet :hover not working after frameless window drag&drop

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 341 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.
  • N Offline
    N Offline
    nkiy
    wrote on last edited by
    #1

    Hi guys, I have a frameless window (with flags: Qt::FramelessWindowHint and Qt::WindowCloseButtonHint), and there are two buttons which are used as minimize button and close button.
    I set those two QPushButton stylesheet:

    QPushButton {
        border: none; outline: none;
        image: url(:/images/close_normal.png);
    }
    QPushButton:hover {
        image: url(:/images/close_hover.png);
    }
    QPushButton:pressed {
        image: url(:/images/close_pressed.png);
    }
    

    When the window first pops up, everything worked fine, but after I move the window by dragging, the ':hover' style not working any more, and then I click the window, ':hover' worked fine again.
    So it's like the window's losing focus when I drag it, I don't know why this happening, any one could help?

    Platform: Archlinux KDE, Qt Version: 5.11.0

    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