That's becuase it too (in all probability) doesn't render 1 million offscreen elements to show the handful (100? 1000?) on screen elements.
So it does it just like an immediate mode GUI does it, and only renders what it must.
Not sure about QT specifically, but all other non-immediate mode GUIs I know use the same trick, and immediate mode GUIs like React also use it.