Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt 5.2 QML WebView height: contentHeight
Forum Updated to NodeBB v4.3 + New Features

Qt 5.2 QML WebView height: contentHeight

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    ZhangBoren
    wrote on last edited by
    #1

    I want to have a weview inside a flickable

    The problem is that we I set height: contentHeight, it triggers a binding loop and result in a height that is much larger.

    Do you know how to do this? Thank you

    This is the test code

    import QtQuick 2.0
    import QtWebKit 3.0

    Item{
    width: 400
    height: 300
    Flickable {
    anchors.fill: parent
    contentWidth: parent.width
    contentHeight: webView.height + label.height
    Text {
    id: label
    text: "Hehe"
    }
    WebView {
    id: webView
    anchors.top: label.bottom
    url: "http://www.google.com"
    width: parent.width
    height: contentHeight
    }
    }
    }

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZhangBoren
      wrote on last edited by
      #2

      @import QtQuick 2.0
      import QtWebKit 3.0

      Item{
      width: 400
      height: 300
      Flickable {
      anchors.fill: parent
      contentWidth: parent.width
      contentHeight: webView.height + label.height
      Text {
      id: label
      text: "Hehe"
      }
      WebView {
      id: webView
      anchors.top: label.bottom
      url: "http://www.google.com"
      width: parent.width
      height: contentHeight
      }
      }
      }@

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved