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

QUiLoader resolves wrong buddy when UI is loaded twice

    XMLWordPrintable

Details

    • All
    • 1c121ea7a (dev), e3cc2b1f8 (6.10), 5895269bf (6.9), 6ca4f6704 (tqtc/lts-6.8), 018749e4b (tqtc/lts-6.5)

    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. main.cpp
          2 kB
          Arjan van Olphen
        2. CMakeLists-1.txt
          0.9 kB
          Arjan van Olphen
        3. buddy-bug.png
          10 kB
          Arjan van Olphen
        4. buddy-bug.svg
          65 kB
          Arjan van Olphen
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richard Richard Moe Gustavsen
            arjan Arjan van Olphen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews