Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What exactly does "Clipping" mean when we talk about painting in Qt?
Qt 6.12 LTS is out! See what's new in the release blog

What exactly does "Clipping" mean when we talk about painting in Qt?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 8.8k 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.
  • M Offline
    M Offline
    Morris
    wrote on last edited by
    #1

    I have been using Qt for a while. The word "clipping" kinda confuse me when I read the source code / documents. I think it might be a stupid question, but it's a bit hard to understand for non-english-speaking people like me.

    Thanks.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      Clipping means, that if you have overlapping windows for example, you only dar what is really visible, and hidden parts are not drawn (as they are overlapped, they might draw ouside the window etc).
      In Qt, if you are using the widgets (e.g. under windows) with non native windows, so from the OS part, there is onkly one window and all widgets are painting on it, the widgets have to clip on their borders, so you can't paint outside your widget (what would otherwise work :-) ).

      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
      0
      • M Offline
        M Offline
        Morris
        wrote on last edited by
        #3

        So, if there's a clip region defined, only the part of the widget which is inside the region, is drawn. Right?
        Thank you~ :)

        1 Reply Last reply
        0
        • G Offline
          G Offline
          giesbert
          wrote on last edited by
          #4

          Right
          And the clip reagion can be as simple rectangle or a complex structure.
          On the widget boundaries, the clipping is there automatically.

          Clipping ios alos used for redrawing formerly hidden parts of a widget, so you neend't repaint the whole thing if only a bit more is shown.

          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
          0
          • B Offline
            B Offline
            baysmith
            wrote on last edited by
            #5

            Note that in the QGraphicsView framework, the items are not clipped by default like the widgets are, but you can optionally request that they are clipped.

            Nokia Certified Qt Specialist.

            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
            • Unsolved