Advanced Qt - A Deep Dive 2/6 Graphics View Part 2
summary
Custom QGraphicsItem must implement paint() and boundingRect(); shape() is optional but needed for precise hit tests. boundingRect() must be extremely cheap and minimal or performance and hover queries suffer; painting outside the reported rect produces graphical artifacts because QGraphicsView won’t repaint uncovered areas. Use flags like ItemIsMovable, ItemIsSelectable, and ItemSendsGeometryChanges and override itemChange to constrain movement. Collision helpers include collidesWithItem, collidingItems, and scene queries; scene.render can rasterize the whole scene but not conveniently a subtree.
AI-written summary · about
chapters (7)
- 0:00Introduction to custom items
- 1:51Implementing paint and bounding rect
- 7:15Shape and event handling
- 17:53Event handling levels
- 26:41Collision detection methods
- 28:45Graph visualization demo
- 36:26Summary and Q&A
related talks
01h 38mQt GraphicsView in Depth
01h 00mThe Evolution of Accelerated 2D and 3D Graphics in Qt
10mLightning Talk, Qt 3D CAD demo
51mAccelerated 2D and 3D Graphics in Qt 6
01h 35mIntroduction to Qt 3D - Giuseppe D’Angelo - [ACCU 2017]
28mQML, a Booming Graphic Framework
01h 12mQt/3D QML Scripting for UI Designers and Hackers
01h 01mEffective Qt (2017 edition)
