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

Wrong widget class being created a runtime, causing crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 5.12.0
    • Extras: Android
    • None
    • Android

    Description

      I have a very simple project (attached):

      • A library (libA) declaring and exporting a widget class itself using a ui file
      • B library (libB) declaring and exporting a widget class itself using a ui file
      • A main program loading both library and instantiating libA widget

      When I deploy the program on Android, even if I specifically created libA widget from my main program, it's libB widget that is shown.

      Apparently, the fact that the two ui files are declaring their classes with the same name "Widget" messes things up. If I modify the ui files to declare "WidgetA" and "WidgetB", there is no more problem. If widegtA.ui and widegtB.ui both declare a "Widget" class, then the wrong one is being created at runtime.

      Once the wrong object is instantiated, if it contains different sub-widgets, the code is very likely to crash soon when you'll try to use them...

      When one deploys big projects, one can't guarantee that there is never two ui files declaring the same object name (specially accross all shared libraries). So I thing this class misusage is really critical.

       

      I'm using QtCreator 4.8.0 with NDK r18b (clang)

       

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            jpo38 Jean Porcherot
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes