Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-124549

QLineEdit:hover { background: blue; } only changes color when it has focus

    XMLWordPrintable

Details

    • Windows

    Description

      When creating a 

      QLineEdit *inputLine = new QLineEdit(this);
      inputLine->setStyleSheet("QLineEdit:hover {background-color: blue;} QLineEdit {background-color: green;}");

      and setting the style sheet to change color when hovering it does not change color on Windows except when first clicking on that line.
      This is what currently happens:

      However when I click on a box it does work for that box:

      But on Linux I get the expected result. When I hover over the boxes without click, it changes color:


       
      I am not sure why this happens. I also tried the same with QSpinBox and on Windows the issue is not there and it behaves the same as the QLineEdit on Linux.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mighty_pig Daan Smienk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes