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. Opacity Mask on QT 4.8
Forum Updated to NodeBB v4.3 + New Features

Opacity Mask on QT 4.8

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 3 Posters 578 Views 2 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.
  • Matheus da Silva RibeiroM Offline
    Matheus da Silva RibeiroM Offline
    Matheus da Silva Ribeiro
    wrote on last edited by
    #1

    Hello Friends!

    Is there any way to create a mask like the link below only in Qt 4.8 in QML?
    https://doc.qt.io/qt-5/qml-qtgraphicaleffects-opacitymask.html

    Thank you all!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Do you mean use QGraphicalEffects in Qt 4 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Matheus da Silva RibeiroM Offline
        Matheus da Silva RibeiroM Offline
        Matheus da Silva Ribeiro
        wrote on last edited by Matheus da Silva Ribeiro
        #3

        Hello @SGaist!
        Not exactly, I want to replicate the opacity mask effect on Qt4.
        I tried a few ideas, but none of them worked as the effect shown on the link.

        @SGaist said in Opacity Mask on QT 4.8:

        Do you mean use QGraphicalEffects in Qt 4 ?

        1 Reply Last reply
        0
        • GrecKoG Offline
          GrecKoG Offline
          GrecKo
          Qt Champions 2018
          wrote on last edited by
          #4

          What did you try ?

          You can use https://doc.qt.io/archives/qt-4.8/qml-shadereffectitem.html in 4.8 and adapt the code from https://github.com/qt/qtgraphicaleffects/blob/24f12a9466ecaa4173fb46196199f0eed9374750/src/effects/shaders/opacitymask.frag

          Matheus da Silva RibeiroM 1 Reply Last reply
          0
          • GrecKoG GrecKo

            What did you try ?

            You can use https://doc.qt.io/archives/qt-4.8/qml-shadereffectitem.html in 4.8 and adapt the code from https://github.com/qt/qtgraphicaleffects/blob/24f12a9466ecaa4173fb46196199f0eed9374750/src/effects/shaders/opacitymask.frag

            Matheus da Silva RibeiroM Offline
            Matheus da Silva RibeiroM Offline
            Matheus da Silva Ribeiro
            wrote on last edited by
            #5

            Hi @GrecKo !

            Sorry for the delay in answering, I was not seeing this issue until yesterday. Anyway, I couldn't reproduce the effect as you suggested, but I appreciate the suggestion.

            To remedy the situation without delay, at least until the migration to Qt5, I used background image clippings to create the necessary effect. It was hard work with the part of the image positioning (they were 6 backgrounds and for each background were 6 cutouts), but it worked.

            Thank you!

            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