We've gotten reports about how Graphics View's performance drops in one special (yet quite common) case. It's the case when the item is fairly thin, flat, non-square, or simply sparse, where QGraphicsItem's bounding rect generates something close to worst-case updates that cause repaints of areas that really haven't changed. A very helpful customer showed me a simple testcase that illustrates this problem, which is quite hard to work around, which again effectively makes it a bug. Start the portedcanvas example, and clear the canvas (CTRL-E). Add a few meshes (ALT-M). Now click a node in the top left corner and drag it down towards the bottom right corner.
Performance degrades steadily as you get closer and closer to the bottom-right corner, until the example almost grinds to a halt. The example is very busy doing something close to nothing, at least it seems so. It's redrawing the bounding rectangle of the edges to the node you're dragging.
The yellow thing you get in debug mode by setting/exporting QT_FLUSH_PAINT=1 reveals what's going on.
To finally hammer this bug down, we've added an opt-in feature, QGraphicsItem::boundingRegion(), and a configurable granularity. You can tune the granularity of the bounding region of your line / edge / connector items, and with the wave of a wand, QGraphicsView will magically generate an optimal update region for that item.
So with 4.4, you'll instead get something like this:
What you're seeing is that each of the two connector lines updates itself using a region consisting of 20-30 rectangles, a tunable granularity.
Should be in tonight's 4.4 snapshots.
Stay up to date with the latest marketing, sales and service tips and news.
Download the latest release here: www.qt.io/download.
Qt 5.12 was developed with a strong focus on quality and is a long-term-supported (LTS) release that will be supported for 3 years.
Näytä tämä julkaisu Instagramissa.
Want to build something for tomorrow, join #QtPeople today! We have loads of cool jobs you don’t want to miss! http://qt.io/careers #builtwithQt #software #developers #coding #framework #tool #tooling #C++ #QML #engineers #sales #tech #technology #UI #UX #CX #Qt #Qtdev #global #openpositions #careers #job
Henkilön Qt (@theqtcompany) jakama julkaisu