Skip to content

Commit

Permalink
Fix QML container not loading regression
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Nov 19, 2022
1 parent 66e5d9a commit f31e328
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/qml/FeatureForm.qml
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ Page {
wrapMode: Text.WordWrap
font.pointSize: Theme.tinyFont.pointSize
font.bold: true
topPadding: 10
bottomPadding: 5
color: 'grey'
}
Expand All @@ -383,8 +384,9 @@ Page {
}

onQmlCodeChanged: {
if ( visible )
if (isVisible) {
var obj = Qt.createQmlObject(qmlContainer.qmlCode,qmlItem,'qmlContent');
}
}
}

Expand All @@ -409,6 +411,7 @@ Page {
wrapMode: Text.WordWrap
font.pointSize: Theme.tinyFont.pointSize
font.bold: true
topPadding: 10
bottomPadding: 5
color: 'grey'
}
Expand All @@ -425,8 +428,7 @@ Page {
}

onHtmlCodeChanged: {
if ( visible )
{
if (isVisible) {
var htmlItem = Qt.createQmlObject('import QtWebView 1.14; WebView { id: htmlItem; anchors { left: parent.left; rightMargin: 12; right: parent.right; } onLoadingChanged: if ( !loading ) runJavaScript("document.body.offsetHeight", function(result) { htmlItem.height = ( result + 30 ) } ); }',
htmlLoader);
htmlItem.loadHtml(htmlContainer.htmlCode);
Expand Down

1 comment on commit f31e328

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.