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 Updated to NodeBB v4.3 + New Features

Glow QML type duplicating object

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 3 Posters 746 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.
  • A Offline
    A Offline
    abanksdev
    wrote on 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!

    raven-worxR 1 Reply Last reply
    0
    • A abanksdev

      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!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on 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 last edited by
        #3

        @raven-worx which examples?

        raven-worxR 1 Reply Last reply
        0
        • GrecKoG Offline
          GrecKoG Offline
          GrecKo
          Qt Champions 2018
          wrote on 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

            @raven-worx which examples?

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on 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 last edited by
              #6

              Ah, must have missed that. Thanks!

              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