Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    How we can avoid erasing of previous image while repainting?

    General and Desktop
    3
    5
    2139
    Loading More Posts
    • 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.
    • P
      pratik041 last edited by

      If we called a repaint two times the previous image in paintevent is erased. How can we avoid erasing of this image.

      Pratik Agrawal

      1 Reply Last reply Reply Quote 0
      • G
        giesbert last edited by

        Could you please rephrase your question. What do you want to achieve?

        That a redraw of a widget paints onto the previous state of the widget?

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply Reply Quote 0
        • P
          pratik041 last edited by

          Actually i have two images one is semi-transparent and other is opaque and smaller image than previous one. Suppose In first case i have painted an image on a widget on the second time while painting on the same widget i want that the first painted image should not be erased. So that non_overlapped portion of both the image i can see after the second paint event. Is it possible?

          Pratik Agrawal

          1 Reply Last reply Reply Quote 0
          • K
            Kxyu last edited by

            Well, in most of cases the code in paintEvent defines what is widet will show right after is is called (and after repaint(), of course). So if you want some images to be combined you should draw it in one paintEvent

            1 Reply Last reply Reply Quote 0
            • G
              giesbert last edited by

              Then you have to disable background erasing (see QWidget attributes)
              and handle all that on your own.

              Nokia Certified Qt Specialist.
              Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post