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. QGraphicsScene Composition modes
QtWS25 Last Chance

QGraphicsScene Composition modes

Scheduled Pinned Locked Moved Solved General and Desktop
qt c++compositionmodeqpainter
3 Posts 2 Posters 178 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.
  • S Offline
    S Offline
    StudentScripter
    wrote on 14 Jan 2025, 20:16 last edited by
    #1

    I want to paint a black rect all over the graphicsscene, add some white holes and set the composition mode in that way that the more white a array is the more transparent it gets, showing the contents below. Whats the best way to do this?

    I tried qpainter in draw foreground with multiply on my graphicsscene, but this won't show the items below. Adding a new qgraphicsitem and doing this in its paint statement hasn't worked neither. Am i missing some flags or something?

    Appreciate any hints. :)

    P 1 Reply Last reply 15 Jan 2025, 11:04
    0
    • S StudentScripter
      14 Jan 2025, 20:16

      I want to paint a black rect all over the graphicsscene, add some white holes and set the composition mode in that way that the more white a array is the more transparent it gets, showing the contents below. Whats the best way to do this?

      I tried qpainter in draw foreground with multiply on my graphicsscene, but this won't show the items below. Adding a new qgraphicsitem and doing this in its paint statement hasn't worked neither. Am i missing some flags or something?

      Appreciate any hints. :)

      P Offline
      P Offline
      Pl45m4
      wrote on 15 Jan 2025, 11:04 last edited by Pl45m4
      #2

      @StudentScripter

      Have you already tried the Composition Mode Example or the Image Composition Example?

      Am i missing some flags or something

      QPainter::CompositionMode?!

      • https://doc.qt.io/qt-6/qpainter.html#CompositionMode-enum

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      S 1 Reply Last reply 15 Jan 2025, 15:42
      1
      • P Pl45m4
        15 Jan 2025, 11:04

        @StudentScripter

        Have you already tried the Composition Mode Example or the Image Composition Example?

        Am i missing some flags or something

        QPainter::CompositionMode?!

        • https://doc.qt.io/qt-6/qpainter.html#CompositionMode-enum
        S Offline
        S Offline
        StudentScripter
        wrote on 15 Jan 2025, 15:42 last edited by
        #3

        @Pl45m4 Yeah forgot to set opacity to something else than 1, that solved it...

        1 Reply Last reply
        0
        • S StudentScripter has marked this topic as solved on 15 Jan 2025, 15:42

        1/3

        14 Jan 2025, 20:16

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved