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. Glow QML type duplicating object
Forum Update on Monday, May 27th 2025

Glow QML type duplicating object

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 3 Posters 738 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.
  • A Offline
    A Offline
    abanksdev
    wrote on 22 Oct 2018, 18:36 last edited by
    #1

    Hi there, I'm trying to make a MapQuickItem that appears as a circle on a map glow, but when I apply glow to the MapQuickItem, it seems to duplicate the object separate from the original object like so:
    0_1540233165303_Screenshot from 2018-10-22 14-31-58.png

    Here is the code:

     MapQuickItem {
                id: vehicleIconGlow
                anchorPoint.x: image.width
                anchorPoint.y: image.height
                coordinate: QtPositioning.coordinate(movingAirplane.latitude, movingAirplane.longitude)
                z:400
                transform: Rotation {
    
                    origin {
                          x: vehicleIconGlow.width / 2 + 26
    
                          y: vehicleIconGlow.height / 2 + 11
                        }
    
                        axis {x: 0; y: 0; z: 1}
                        angle: 265//movingAirplane.heading + 180
                }
                sourceItem:
                        Circle{
                            id: circle
                            color: "white"
                            width: image.width * .8
                            height: image.height * .8
                            border.color: "darkblue"
                            //color: "transparent"
                }
    
            }
    
    
           Glow {
                    anchors.fill:vehicleIconGlow
                    radius: 8
                    samples: 17
                    color: Style.color_highlight
                    source: vehicleIconGlow
                }
    
    
    

    I've tried several other iterations--making the source and fill of the Glow object the circle rather than the vehicleIconGlow, putting the Glow object in the MapQuickItem, and all either render the same results, or simply do not display the glow at all. How can I get the vehicleIconGlow object to glow without duplicating it? Thank you!

    R 1 Reply Last reply 22 Oct 2018, 19:03
    0
    • A abanksdev
      22 Oct 2018, 18:36

      Hi there, I'm trying to make a MapQuickItem that appears as a circle on a map glow, but when I apply glow to the MapQuickItem, it seems to duplicate the object separate from the original object like so:
      0_1540233165303_Screenshot from 2018-10-22 14-31-58.png

      Here is the code:

       MapQuickItem {
                  id: vehicleIconGlow
                  anchorPoint.x: image.width
                  anchorPoint.y: image.height
                  coordinate: QtPositioning.coordinate(movingAirplane.latitude, movingAirplane.longitude)
                  z:400
                  transform: Rotation {
      
                      origin {
                            x: vehicleIconGlow.width / 2 + 26
      
                            y: vehicleIconGlow.height / 2 + 11
                          }
      
                          axis {x: 0; y: 0; z: 1}
                          angle: 265//movingAirplane.heading + 180
                  }
                  sourceItem:
                          Circle{
                              id: circle
                              color: "white"
                              width: image.width * .8
                              height: image.height * .8
                              border.color: "darkblue"
                              //color: "transparent"
                  }
      
              }
      
      
             Glow {
                      anchors.fill:vehicleIconGlow
                      radius: 8
                      samples: 17
                      color: Style.color_highlight
                      source: vehicleIconGlow
                  }
      
      
      

      I've tried several other iterations--making the source and fill of the Glow object the circle rather than the vehicleIconGlow, putting the Glow object in the MapQuickItem, and all either render the same results, or simply do not display the glow at all. How can I get the vehicleIconGlow object to glow without duplicating it? Thank you!

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 22 Oct 2018, 19:03 last edited by
      #2

      @abanksdev
      you should set the source object visible to false.
      Like in the examples

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • A Offline
        A Offline
        abanksdev
        wrote on 22 Oct 2018, 21:22 last edited by
        #3

        @raven-worx which examples?

        R 1 Reply Last reply 23 Oct 2018, 07:12
        0
        • G Offline
          G Offline
          GrecKo
          Qt Champions 2018
          wrote on 22 Oct 2018, 21:31 last edited by
          #4

          You could apply the Glow via the layer property instead of adding it as a sibling :

          MapQuickItem {
              //...
              sourceItem: Circle {
                  // ...
                  layer {
                      enabled: true
                      effect: Glow {
                          radius: 8
                          samples: 17
                          color: Style.color_highlight
                      }
                  }
              }
          }
          
          1 Reply Last reply
          0
          • A abanksdev
            22 Oct 2018, 21:22

            @raven-worx which examples?

            R Offline
            R Offline
            raven-worx
            Moderators
            wrote on 23 Oct 2018, 07:12 last edited by
            #5

            @abanksdev said in Glow QML type duplicating object:

            which examples?

            like for any graphical effect QML type.
            In your case, for Glow

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply
            0
            • A Offline
              A Offline
              abanksdev
              wrote on 23 Oct 2018, 18:25 last edited by
              #6

              Ah, must have missed that. Thanks!

              1 Reply Last reply
              0

              1/6

              22 Oct 2018, 18:36

              • Login

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