Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. RoundButton with GlowEffect
Qt 6.11 is out! See what's new in the release blog

RoundButton with GlowEffect

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 327 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.
  • Y Offline
    Y Offline
    ynatynat
    wrote on last edited by
    #1

    Does anybody know how to glow RoundButton according with contour?
    I try to add glow effect to RoundButton like this:

        RoundButton {
            id:io
            text:qsTr("OUT1")
            checkable: true
    
            icon.height: Constants.fontL
            icon.width: Constants.fontL
            font.pixelSize: Constants.fontL
    
    
            width:200
            height:200
    
            layer.enabled: io.checked
            layer.effect: Glow {
                samples:10
                radius:8
                spread:0.5
                color: Material.accent
                transparentBorder: true
    
            }
    
        }
    

    0da545bd-ba48-47cf-8bd0-507e74561084-image.png

    The glow effect spreads rectangle.
    But I need the button glows according with button contour. Like this:

    abab8f2b-86c4-4b74-adcb-f0c85039ca94-image.png

    1 Reply Last reply
    0
    • johngodJ Offline
      johngodJ Offline
      johngod
      wrote on last edited by
      #2

      Dont know if it will work, but try to put that RoundButton inside a Rectangle with a radius equal to half is width and clip enabled

      1 Reply Last reply
      0
      • Y ynatynat has marked this topic as solved on
      • Y ynatynat has marked this topic as unsolved on

      • Login

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