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. Re using graphics effects
Qt 6.11 is out! See what's new in the release blog

Re using graphics effects

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k 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.
  • G Offline
    G Offline
    GrahamL
    wrote on last edited by
    #1

    Hi
    I have applied a graphics effect to a widget –
    @
    QGraphicsOpacityEffect* opacityEffect = new QGraphicsOpacityEffect(this); // make sure to create using new, since effect has to be alive as long as the target widget is using it.
    opacityEffect->setOpacity(0.0); // initially widget should be invisible
    ui.buttonLabel_4->setGraphicsEffect(opacityEffect);
    @
    Now I want the same effect on another widget so I did this –
    @
    ui.buttonLabel_5->setGraphicsEffect(opacityEffect);
    @
    This has the effect of making the second widget transparent but makes the first visible.
    Why am I unable to share the graphics effect object?

    Thanks

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

      You can't you need to create a new QGraphicsOpacityEffect object.

      157

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

        Refer docs for more "setGraphicsEffect":http://qt-project.org/doc/qt-4.8/qgraphicsitem.html#setGraphicsEffect

        157

        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