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. Glow effect on a widget without QML / Qt Quick

Glow effect on a widget without QML / Qt Quick

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.8k 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.
  • Z Offline
    Z Offline
    Zerby
    wrote on last edited by
    #1

    I'm working on enchancing my applications UI elements with Qt's graphical effects. I've read documentation about glow effects, and they all refer to using QML/Qt Quick, which I don't currently use and don't really want to use either. I managed to find QWidget::setGraphicsEffect(QGraphicsEffect * effect), and with that I create a basic drop shadow for example (using QGraphicsDropShadowEffect), but I could not find one for creating a basic glow around the whole widget?

    So, my question is, is there a ready made effect for glow, or is it possible to "integrate" QML to my application afterwards, doing the necessary definitions there and continue generating the application UI without QML/Qt Quick?

    Also, I know you can sub class QGraphicsEffect to create your own effect, if someone has a good article/example of this, I would gladly read it, if it comes to that :)

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Brochadinho
      wrote on last edited by
      #2

      Well, usefull post. Just discorvered the QWidget::setGraphicsEffect. I will check the documentation.
      At first view, there is no glow effect already made. But i think that you can make it by using the base class or you may try QGraphicsColorizeEffect or ShadowEffect. Never tried nothing of this.

      The documentation has so exemples of the parametrization that u can make on the effects.

      Sorry i can't help more.

      1 Reply Last reply
      0
      • Chris KawaC Online
        Chris KawaC Online
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        A glow is basically the same effect as a shadow. It's just a question of setting right params.

        An example:
        @
        auto effect = new QGraphicsDropShadowEffect();
        effect->setOffset(.0);
        effect->setBlurRadius(20.0);
        effect->setColor(Qt::red);
        ui->pushButton->setGraphicsEffect(effect);
        @
        !http://i296.photobucket.com/albums/mm188/crossblades666/glow.jpg(glow)!

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          Zerby
          wrote on last edited by
          #4

          [quote author="Chris Kawa" date="1406646609"]A glow is basically the same effect as a shadow. It's just a question of setting right params.

          An example:
          @
          auto effect = new QGraphicsDropShadowEffect();
          effect->setOffset(.0);
          effect->setBlurRadius(20.0);
          effect->setColor(Qt::red);
          ui->pushButton->setGraphicsEffect(effect);
          @
          !http://i296.photobucket.com/albums/mm188/crossblades666/glow.jpg(glow)![/quote]

          Thank you very much! This is exactly what was needed, I though about playing with the offset -setting, but didn't.. Thank you for the answer!

          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