I have a bunch of WebEngineViews in a ListView. For example:
ListView
{
model: myModel
delegate: Component
{
Item
{
WebEngineView
{
id: myWebView
Component.onCompleted: loadHtml(model.modelData.htmlText, baseURL)
}
}
}
}
How can I adjust the height of the Item once the html is loaded? The HTML in question may include images, so I want to resize the WebEngineView once everything is loaded. I suspect I can do something like:
ListView
{
model: myModel
delegate: Component
{
Item
{
WebEngineView
{
id: myWebView
Component.onCompleted: loadHtml(model.modelData.htmlText, baseURL)
onLoadingChanged:
{
if (!loading && loadRequest.status == WebEngineView.LoadSucceededStatus)
{
height = ????
}
}
}
}
}
}
But I'm not sure to what I should set height.
achors.fill: parenttomyWebView. Btw,Itemis excessive here. - folibisWebEngineViewinside aComponentis completely unnecessary in your case. I can't se any reason to wrap it in anItemeither (unlessWebEngineViewis noItemitself, and therefore might not be used as delegate?) - derMItem. It's probably excessive in this example but in my actual code I have other objects inside the delegate. I will update the question to better reflect what I'm trying to do. - AddycontentSize- derM