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

QUiLoader resolves wrong buddy when UI is loaded twice

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.1.2, 6.1.3, 6.2.0
    • None
    • Not applicable.
    • All

    Description

      QUiLoader resolves wrong QLabel buddy

      When loading the ui-file in 2 different widgets having the same parent resolving a
      buddy-widget for a label goes wrong.

      When the file is loaded for the second widget the buddy resolved is
      pointing to the line-edit created in when the ui-file was loaded first.

      Current Work-around

      Use the QUiLoader::load() method without a parent (nullptr) a
      nd setting the parent to the widget afterwards.

      Personal Remarks

      This is not the expected behavior or I must be mistaken.
      The buddy resolving mechanism should limit itself to the widgets created
      in the current loaded ui-file only like in Qt Designer application.

      I added a single file with single function which illustrates the "bug".
      It can easily be added to a unit testing environment.

       

      Attachments

        1. buddy-bug.png
          buddy-bug.png
          10 kB
        2. buddy-bug.svg
          65 kB
        3. CMakeLists-1.txt
          0.9 kB
        4. main.cpp
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            arjan Arjan van Olphen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes