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

QtQuickView does not handle user input in a LinearLayout

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.8
    • 6.8
    • Quick: Other
    • Android 13 emulator, x86_64 
    • Android
    • 15674f4ce (dev), a4f4058d6 (6.8), 0dfb25655 (6.7)

    Description

      How to reproduce:
      1. Create a LinearLayout and set it as content view of an Activity
      2. Add an android.widget.Button to the Layout.
      3. Instantiate a QtQuickView, set layout params and loadComponent(). The component may have any kind of component that handles touch inputs. (MouseArea, Button, ...)
      4. Add the QtQuickView to the same layout

      Expected behavior: 

      The user touches an area that is intended to handle user inputs, and see UI changes or log outputs.

      Actual behavior:

      The component does not react to user inputs.

      Environment:

      Android 13 emulator, x86_64 

      More info:

      If the QtQuickView gets added to the layout before the Button, the QtQuickView gets touch inputs as expected. The Button also reacts to touch inputs.

       

       

       // Create a LinearLayout
              layout = new LinearLayout(this);
              layout.setOrientation(LinearLayout.VERTICAL);        
              TextView textView = new TextView(this);
              textView.setText("Hello World");        
              Button button = new Button(this);
              
              quickView = new QtQuickView(this);
              mainQml = new Main();
              quickView.loadComponent(mainQml);        
              LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(400, 400);
              
              //in the following order it can handle touches
              //layout.addView(quickView, params);
              //layout.addView(textView);
              //layout.addView(button);
              //layout.addView(new Button(this)); 
      
       //but not the following order it can handle touches         
      layout.addView(textView);
      layout.addView(button);
      layout.addView(new Button(this)); 
      layout.addView(quickView, params);         

       

       

      Attachments

        Issue Links

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

          Activity

            People

              tinjapaavoseppa Tinja Paavoseppä
              soarmin Soheil Armin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes