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. Same Qgraphicseffect to different qgraphicsitems?
QtWS25 Last Chance

Same Qgraphicseffect to different qgraphicsitems?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 1.3k 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.
  • G Offline
    G Offline
    Gowtam
    wrote on last edited by
    #1

    Hello all, I am trying to apply qgraphicsdropshadoweffect to QGraphicsTextItems, but the effect is being applied to only the last item, may I know why?

    @
    effect5->setBlurRadius(_shadowData.blurRadius);
    effect5->setXOffset(_shadowData.hOffset);
    effect5->setYOffset(_shadowData.vOffset);
    effect5->setColor(_shadowData.shadowColor);

        text1->setGraphicsEffect(effect5);
        text2->setGraphicsEffect(effect5);
        text3->setGraphicsEffect(effect5);
        text5->setGraphicsEffect(effect5);
        text4->setGraphicsEffect(effect5);
    

    @

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      You have to create a new QGraphicsEffect object for each object that you are using.

      157

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mehrdadsilver
        wrote on last edited by
        #3

        If effect is the installed on a different item, setGraphicsEffect() will remove the effect from the item and install it on this item.

        Mehrdad Abdolghafari, Be silver

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          reading the "docs":http://qt-project.org/doc/qt-4.8/qgraphicsitem.html#setGraphicsEffect really may help!

          --- 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
          • G Offline
            G Offline
            Gowtam
            wrote on last edited by
            #5

            Thank you all for your inputs!! :)

            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