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. QGraphicsColorizeEffect resizes widgets
Forum Updated to NodeBB v4.3 + New Features

QGraphicsColorizeEffect resizes widgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 902 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #3

    Hi,

    Do you mean you have that effect once you start changing the effect strength ?

    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
    1
    • J Offline
      J Offline
      Jakob Clausen
      wrote on last edited by Jakob Clausen
      #4

      Not at first.
      This is the sequence of events:

      • call constructor
      • set stength to zero
      • setEffect on widget
      • change strength to larger than zero
        at the last point problems happen
      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jakob Clausen
        wrote on last edited by
        #5

        What does the error messages

        QPainter::begin: A paint device can only be painted by one painter at a time.
        QPainter::translate: Painter not active
        

        mean?

        jsulmJ 1 Reply Last reply
        0
        • J Jakob Clausen

          What does the error messages

          QPainter::begin: A paint device can only be painted by one painter at a time.
          QPainter::translate: Painter not active
          

          mean?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #6

          @Jakob-Clausen Do you have more than one painter on same device?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply
          0
          • jsulmJ jsulm

            @Jakob-Clausen Do you have more than one painter on same device?

            J Offline
            J Offline
            Jakob Clausen
            wrote on last edited by
            #7

            @jsulm Good question. I was wondering the same thing. It looks like a painter is added, when I set the graphics effect. Is this true?
            The widget upon which the effect is set, is also added to a qstackedwidget. Could that cause the ... no more than one painter ... thing? If I add the effect to the qstackedwidget aka the parent, then this error also is no more.
            But it still does not look right.
            Do I need to repaint the widget?

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Jakob Clausen
              wrote on last edited by Jakob Clausen
              #8

              Something else is strange. Maybe a clue?
              The navigation looks like it only has three buttons left. But all six of them are there. I can push them all, and the QWidgetStack changes accordingly. So the buttons are where they should be. But it looks like they are not.
              And if I remove the effect, then I can make it all look well by calling repaint().

              1 Reply Last reply
              0
              • J Offline
                J Offline
                Jakob Clausen
                wrote on last edited by
                #9

                Are there any limitations on the QGraphicsColorizeEffect?
                Should it not be possible to just set it on any old widget?

                jsulmJ 1 Reply Last reply
                0
                • J Jakob Clausen

                  Are there any limitations on the QGraphicsColorizeEffect?
                  Should it not be possible to just set it on any old widget?

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by jsulm
                  #10

                  @Jakob-Clausen Do you paint manually on that widget (in paintEvent)?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    Jakob Clausen
                    wrote on last edited by
                    #11

                    No. I add subwidgets to a layout and thats it.

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      Jakob Clausen
                      wrote on last edited by
                      #12

                      I think I have found a way through it all. I can create a new widget of the same size and shape, and instead of a QGraphicsColorizeEffect I can use a QOpacityEffect and the move it to cover the navigationbar. But then the navigation wont accept touch events. Any around that?

                      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