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. CSS: dynamic properties and (pseudo) states
QtWS25 Last Chance

CSS: dynamic properties and (pseudo) states

Scheduled Pinned Locked Moved Unsolved General and Desktop
csspropertiesstates
1 Posts 1 Posters 696 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.
  • T Offline
    T Offline
    tgru
    wrote on 4 Sept 2017, 11:09 last edited by
    #1

    Hello,
    I am looking for a line edit with hover effect and different border sizes for enabeld/ not enabeld.
    And the border should change with respect to some dynamic property ( if widget is enabled).
    I tried:

    QLineEdit!enabled {border: 0px}
    QLineEdit:hover   {border: 1px solid blue}
    QLineEdit[contrast=\"0\"]:enabled {border: 1px solid white}
    QLineEdit[contrast=\"1\"]:enabled {border: 1px solid gray}
    QLineEdit[contrast=\"2\"]:enabled {border: 1px solid black}
    

    and

    QLineEdit[contrast=\"0\"]!enabled {border: 0px}
    QLineEdit[contrast=\"1\"]!enabled {border: 0px}
    QLineEdit[contrast=\"2\"]!enabled {border: 0px}
    QLineEdit[contrast=\"0\"]:hover   {border: 1px solid blue}
    QLineEdit[contrast=\"1\"]:hover   {border: 1px solid blue}
    QLineEdit[contrast=\"2\"]:hover   {border: 1px solid blue}
    QLineEdit[contrast=\"0\"]:enabled {border: 1px solid white}
    QLineEdit[contrast=\"1\"]:enabled {border: 1px solid gray}
    QLineEdit[contrast=\"2\"]:enabled {border: 1px solid black}
    

    I use unpolish/ polish on changing property.
    So at least I get dynamic color with second solution but no hover.
    First solution does not work too.

    How to combine dynamic properties und states?

    Thank you!
    Thomas

    1 Reply Last reply
    0

    1/1

    4 Sept 2017, 11:09

    • Login

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