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. Is it possible to add QPen property and stylize it using qss?
Qt 6.11 is out! See what's new in the release blog

Is it possible to add QPen property and stylize it using qss?

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

    I'm trying to set color and width to QPen using qss.
    I've added a QPen property like below

    Q_PROPERTY( QPen hoveredContentBorder READ hoveredContentBorder WRITE setHoveredContentBorder NOTIFY hoveredContentBorderChanged )
    

    It doesn't work.
    I also added QBrush property like below and it's working fine.

    Q_PROPERTY( QBrush hoveredContentFill READ hoveredContentFill WRITE setHoveredContentFill NOTIFY hoveredContentFillChanged )
    

    I'm using Qt 5.10.1.
    Thanks in advance :)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      From a quick look at the current style that renders style sheeted widgets, it seems that there's indeed no support for QPen.

      Can you share a minimal compilable example of what you are trying to achieve ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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