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

QWidget::childAt always returning null

    XMLWordPrintable

Details

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

    Description

      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).

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes