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. Allow border of a rectangle to paint on top of any children
Qt 6.11 is out! See what's new in the release blog

Allow border of a rectangle to paint on top of any children

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 1.5k 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.
  • Q Offline
    Q Offline
    qttester5
    wrote on last edited by
    #1

    Children in my rectangle are covering its border. Is there a way to have a rectangle's border always be on top?

    1 Reply Last reply
    0
    • O Offline
      O Offline
      onek24
      wrote on last edited by
      #2

      You could try to create a second transparent rectangle with the border which position and sizes are equal to the first rectangle. You can position it on top of everything and it would act like the border of your first rectangle.

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qttester5
        wrote on last edited by
        #3

        I considered that option as well but if you have many rectangles that need this, having invisible and transparent items on all of them can have performance concerns.

        1 Reply Last reply
        0
        • O Offline
          O Offline
          onek24
          wrote on last edited by
          #4

          Well you could try something like that:
          "Custom QML Object":http://stackoverflow.com/questions/16534489/qml-control-border-width-and-color-on-any-one-side-of-rectangle-element
          Try to create a custom QML Object which looks like the border you want and is always on top.

          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