summaryrefslogtreecommitdiffstats
path: root/examples/declarative/webview/autosize.qml
blob: fedd497a0fec8428d4c87ce6dd7c328cb400045e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!-- 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>