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. [SOLVED] Apply a QGraphicsEffect on a scrollbar

[SOLVED] Apply a QGraphicsEffect on a scrollbar

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 1.5k 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
    amonR
    wrote on last edited by
    #1

    Hi everyone,
    I would like to apply a blur-effect on a QScrollBar, is that possible?

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

      Did you fail using it? Or was this just a question instead of trying it within 30 secs?

      --- 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
        amonR
        wrote on last edited by
        #3

        Hi raven, thanks for replying.
        I'm asking because I really don't know if it is possible. I tried a code but only managed to get the all QScrollErea blured and not just the QscrollBar. The single way I know to custumize a scrollbar is by using the stylesheet. However I do not know how to apply the effect through it. An idea?

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

          what did you try?
          @
          scrollAreaAbstract->verticalScrollBar()->setGraphicsEffect( new QGraphicsBlurEffect(...) );
          @

          --- 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
            amonR
            wrote on last edited by
            #5

            I tried this:
            @
            QScrollArea *scrolls = new QScrollArea;
            QGraphicsBlurEffect *blureffect = new QGraphicsBlurEffect;
            scrolls->setGraphicsEffect(blureffect);
            @
            As I said, this code gives me the whole widget blured, not just the scrollbar.

            Concerning your code I tried it and got an error on "scrollAreaAbstract".

            1 Reply Last reply
            0
            • A Offline
              A Offline
              amonR
              wrote on last edited by
              #6

              Thanks a lot Raven, finally it works.
              I used your code this way:
              @
              QScrollArea *scrolls = new QScrollArea;
              QGraphicsBlurEffect *blureffect = new QGraphicsBlurEffect;
              scrolls->horizontalScrollBar()->setGraphicsEffect(blureffect);
              @

              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