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

connectSlotsByName() misconnects slots when multiple children have the same name

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.5.1
    • Core: Object Model
    • None
    • Windows 10
      MinGW
      Qt 5.5.1

    Description

      I have a QWidget tree with two of them sharing the same object name (where widget_a is the top parent)

      widget_a --- widget_b --- button1
            \--- button1
      

      widget_a is an instance of a class which have a private slot named on_button1_clicked() connected by a call to onConnectSlotsByName().

      At runtime on_button1_clicked() is not called when the user clicks on the button in widget_a but is called when the user clicks on the button in widget_b.

      I think this behavior should at least be changed to give priority to the top most object. In the current situation, that means I could break an entire application by adding a widget in a window just because of a name collision (which I may not control if I happen to use a third party widget).

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            bterrier Benjamin Terrier
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes