Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57996

QWidget::childAt always returning null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.7.0
    • None
    • 64bit Kubuntu Linux
      Qt Creator 4.1.0

      After creating a matrix of widgets with QGridLayout, using QWidget::childAt inside mouseMoveEvent returns null most of the times.

      The weird thing is that it returns valid pointers only after calling event->screenPos().

      What's even weirder is that enabling mouse tracking on the widgets in the grid fixes the problem.

      I have attached an example project reproducing the bug.
      You can get the expected result un-commenting line 22 in MainWidget.cpp (enabling mouse tracking for the buttons).

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            mmutz Marc Mutz
            vivaladav Davide Coppola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes