0

I have desktop app in which I have a ScrollView that contains a ListView, in which the delegates each contain multiple widgets, including a WebEngineView:

ScrollView
{
    id: myScrollView
    anchors.fill: parent;

    ListView
    {
        id: myListView
        delegate: Item
        {
            Rectangle
            {
                Text ...
                Text ...
                // other stuff

                WebEngineView
                {
                    id: myWebEngineView
                    Component.onCompleted:
                    {
                        loadHtml(model.modelData.someHTMLData);
                    }                
                }
            }
        }
    }
}

The problem I am having is with scrolling. On Mac, if I use the touchpad to scroll, the ListView only scrolls if the mouse is hovered over one of the non-WebEngineView widgets.

I suspect the WebEngineView widgets are trapping the mouse messages but I cannot find a way stop this from happening. How can I do this?

Addy
  • 2,414
  • 1
  • 23
  • 43
  • I had a similar problem a while back and eventually gave up on trying to have multiple `WebEngineViews` in a list, rewriting the `ListView` entirely in HTML/Javascript. – MrEricSir Mar 24 '17 at 03:33
  • @MrEricSir I have thought several times about going down this same path, even though I'm trying really hard to avoid it. Ugh. – Addy Mar 24 '17 at 12:35

1 Answers1

0

One thing that I know about Qt Quick is that it has input focus.

According to this, you can play with FocusScopes and focus property.

For example set ListView's focus to true, lay delegate into FocusScope with focus: false. Or set WebEngineView's focus to false.

Hope this helps =)

sgt pepper
  • 504
  • 7
  • 15