diff options
Diffstat (limited to 'examples/declarative/webview/autosize.qml')
-rw-r--r-- | examples/declarative/webview/autosize.qml | 101 |
1 files changed, 59 insertions, 42 deletions
diff --git a/examples/declarative/webview/autosize.qml b/examples/declarative/webview/autosize.qml index fedd497..c32b752 100644 --- a/examples/declarative/webview/autosize.qml +++ b/examples/declarative/webview/autosize.qml @@ -1,42 +1,59 @@ -<!-- The WebView size is determined by the width, height, - idealWidth, and idealHeight properties. --> -<Rect id="Rect" color="white" width="200" height="{Layout.height}"> - <VerticalLayout id="Layout" spacing="2"> - <WebView> - <html><![CDATA[ - No width defined. - ]]></html> - <Rect color="#10000000" anchors.fill="{parent}"/> - </WebView> - <WebView width="{Rect.width}"> - <html><![CDATA[ - The width is full. - ]]></html> - <Rect color="#10000000" anchors.fill="{parent}"/> - </WebView> - <WebView width="{Rect.width/2}"> - <html><![CDATA[ - The width is half. - ]]></html> - <Rect color="#10000000" anchors.fill="{parent}"/> - </WebView> - <WebView idealWidth="{Rect.width/2}"> - <html><![CDATA[ - The idealWidth is half. - ]]></html> - <Rect color="#10000000" anchors.fill="{parent}"/> - </WebView> - <WebView idealWidth="{Rect.width/2}"> - <html><![CDATA[ - The_idealWidth_is_half. - ]]></html> - <Rect color="#10000000" anchors.fill="{parent}"/> - </WebView> - <WebView width="{Rect.width/2}"> - <html><![CDATA[ - The_width_is_half. - ]]></html> - <Rect color="#10000000" anchors.fill="{parent}"/> - </WebView> - </VerticalLayout> -</Rect> +// The WebView size is determined by the width, height, +// idealWidth, and idealHeight properties. +Rect { + id: Rect + color: "white" + width: 200 + height: Layout.height + VerticalLayout { + id: Layout + spacing: 2 + WebView { + html: "No width defined." + Rect { + color: "#10000000" + anchors.fill: parent + } + } + WebView { + width: Rect.width + html: "The width is full." + Rect { + color: "#10000000" + anchors.fill: parent + } + } + WebView { + width: Rect.width/2 + html: "The width is half." + Rect { + color: "#10000000" + anchors.fill: parent + } + } + WebView { + idealWidth: Rect.width/2 + html: "The idealWidth is half." + Rect { + color: "#10000000" + anchors.fill: parent + } + } + WebView { + idealWidth: Rect.width/2 + html: "The_idealWidth_is_half." + Rect { + color: "#10000000" + anchors.fill: parent + } + } + WebView { + width: Rect.width/2 + html: "The_width_is_half." + Rect { + color: "#10000000" + anchors.fill: parent + } + } + } +} |