Important: Please read the Qt Code of Conduct -

QQuickItem::childAt possible bug ??

  • I'm trying to find out which QML Item is visible at certain cordinate. so I have this...

    QQuickItem *child=(QQuickView*)window->contentItem()->childAt(x,y);

    but return "child" is an item that isn't even visible at the moment (its covered up completely).

    So what's this doing if not giving the "first visible" child?

    Qt 5.5.1

  • well its definitely a bug in 5.5.1. Looks like somehow the children list isn't being sorted correctly.. which is interesting because its being painted in the right order.... looks like a QQuickItem maintains two lists of children: childItems and sortedChildItems.

    childAt just returns the first item in the childItems list that contains the referenced point. the routine is expecting that childItems is sorted correctly... when its never sorted... sortedChildItems is.

    Dunno if this has been fixed in later releases....

  • Just to follow up and close this topic...

    A bug report was filed to address the issue

  • Lifetime Qt Champion


    You should provide a minimal compilable example with the bug report. That will allow the developer to more quickly analyse what's going on.

Log in to reply