[Development] Rendering only items that are visible in Qt Quick
Albert Astals Cid
albert.astals.cid at kdab.com
Fri Mar 23 16:08:12 CET 2018
El divendres, 23 de març de 2018, a les 14:44:03 CET, Mitch Curtis va
escriure:
> I'd like to get some discussion going around this:
>
> https://bugreports.qt.io/browse/QTBUG-67274
>
> As I understand it, clipping (the "clip" property) doesn't prevent items
> that aren't visible (in the sense of being out of the viewport, not the
> "visible" property) from actually being rendered.
>
> It would be useful if we had a way to do this with minimal effort from the
> user. I'm thinking of a e.g. a property or flag in QQuickItem that, when
> set, would cause the scenegraph to use the shape (could start off as just
> being a bounding rect) of child items to determine whether or not that item
> is visible with regards to its parents bounding rect. That way, any regular
> old item can benefit from it easily.
>
> Does anyone else have ideas about this?
The culled property of QQuickItemPrivate makes things be skipped for
rendering, so you could add something like
QQuickItemPrivate::setChildrenCulled that used the geometries of children to
set it's culled property.
The problem is that this can get relatively inefficient if those geometries
change (animations, etc) since you have to recalculate the culled property for
every single change so given how supposedly fast graphics are at clipping you
may be better of just using clipping?
Cheers,
Albert
>
> Comments about how it will never work and I should feel bad for suggesting
> it?
>
> Far superior alternatives?
>
> Please, share your thoughts! :D
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
--
Albert Astals Cid | albert.astals.cid at kdab.com | Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - The Qt, C++ and OpenGL Experts
More information about the Development
mailing list