[Interest] How to get bounding box of a rotated QML Item ?

Dmitry Volosnykh dmitry.volosnykh at gmail.com
Thu Jan 7 16:44:09 CET 2016


I've also faced this issue a while ago. But it I don't find it strange that
it has drawn little attention since the case is quite rare. ListView, for
instance, as far as I can guess, assumes items to be rectangular, and one
usually fully encloses all child items inside the main rectangle. So, even
if some item is rotated and, thus, reports wrong childRect, it doesn't
affect final result much. Anyway, such behaviour is buggy, of course.

On Thu, Jan 7, 2016 at 6:33 PM Gian Maxera <gmaxera at gmail.com> wrote:

> It really strange that few people found this problem.
> Even layouts and ListView (& co) does not take into account the proper
> bounding-box.
> So, it means you cannot put into a ListView rotated items :-(
> Is it possible that no Qt developer notice that for years ?
>
> Ciao,
> Gianluca.
>
>
> > On 7 Jan 2016, at 13:32, Elvis Stansvik <elvstone at gmail.com> wrote:
> >
> > 2016-01-07 12:37 GMT+01:00 Gian Maxera <gmaxera at gmail.com>:
> >> Hello,
> >> I have an item that contain a rotated Rectangle. I need to calculate
> the height and the width of the bounding box of the Rectangle respect to
> the parent Item. How can I do that ?
> >>
> >> Item {
> >>        width: widthOfBoundingBox
> >>        height: heightOfBoundingBox
> >>        Rectangle {
> >>                width: 100
> >>                height: 100
> >>                rotation: 25
> >>        }
> >> }
> >
> > I would say childrenRect ... if it wasn't for this bug:
> >
> >  https://bugreports.qt.io/browse/QTBUG-38953
> >
> > So I'm not sure actually :( Strange that there's been no reaction to
> > that bug in over a year.
> >
> > Elvis
> >
> >>
> >> Thanks,
> >> Gianluca.
> >>
> >> _______________________________________________
> >> Interest mailing list
> >> Interest at qt-project.org
> >> http://lists.qt-project.org/mailman/listinfo/interest
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160107/025a71f5/attachment.html>


More information about the Interest mailing list