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

Assigning custom properties across shared libraries fails

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.1.0 RC1
    • None
    • Kubuntu 13.04 (GCC 4.7.3)

    Description

      On the latest git version of Qt, when trying to assign C++ properties from different libraries in QML,
      I got a message like "Unable to assign "Foo" to "Foo"" which made me
      really scratch my head. I digged into this, and it turns out that the
      problem is due to the QML property assignment code only checking the
      memory address of the meta-object's class name string, but not their
      contents. This fails if the program uses shared library plugins which
      causes (at least on my Kubuntu 13.04 system) the generation of two
      identical meta-objects with the content of the strings being placed in
      different data segments. This patch fixes this problem by first
      comparing the memory addresses, then the size of the class name and if
      the former differ but the latter are identical, compares the contents
      of the class name string.

      I've attached a patch, which I place under the public domain to ease inclusion into the repository. If you need a regression test, I suppose that I can cook down my code sufficiently, but that will take some time. If I did something wrong, I'm sorry that I have disturbed you, but I would be very grateful if you would suggest a way to fix my issue.

      Attachments

        For Gerrit Dashboard: QTBUG-31506
        # Subject Branch Project Status CR V

        Activity

          People

            shausman Simon Hausmann
            andlaus Andreas Lauser
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes