diff options
| author | David Boddie <david.boddie@nokia.com> | 2011-02-09 18:03:01 +0100 |
|---|---|---|
| committer | David Boddie <david.boddie@nokia.com> | 2011-02-09 18:03:01 +0100 |
| commit | 1a7d04376d2b7ecbae69d14fb0d124e47507961d (patch) | |
| tree | 1c96aeb1a26b96d068d249422806567226565dd3 /doc/src/examples/activeqt/hierarchy-demo-snippet.qdoc | |
| parent | fb6e03e41aa79a4a459eeb21076ffd08541914ab (diff) | |
| download | qt4-tools-1a7d04376d2b7ecbae69d14fb0d124e47507961d.tar.gz | |
Doc: Snippet quoting and other documentation fixes.
Diffstat (limited to 'doc/src/examples/activeqt/hierarchy-demo-snippet.qdoc')
| -rw-r--r-- | doc/src/examples/activeqt/hierarchy-demo-snippet.qdoc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/src/examples/activeqt/hierarchy-demo-snippet.qdoc b/doc/src/examples/activeqt/hierarchy-demo-snippet.qdoc new file mode 100644 index 0000000000..5df32243ef --- /dev/null +++ b/doc/src/examples/activeqt/hierarchy-demo-snippet.qdoc @@ -0,0 +1,39 @@ +<script language="javascript"> +function createSubWidget( form ) +{ + ParentWidget.createSubWidget( form.nameEdit.value ); +} + +function renameSubWidget( form ) +{ + var SubWidget = ParentWidget.subWidget( form.nameEdit.value ); + if ( !SubWidget ) { + alert( "No such widget " + form.nameEdit.value + "!" ); + return; + } + SubWidget.label = form.labelEdit.value; + form.nameEdit.value = SubWidget.label; +} + +function setFont( form ) +{ + ParentWidget.font = form.fontEdit.value; +} +</script> + +<p> +This widget can have many children! +</p> +<object ID="ParentWidget" CLASSID="CLSID:d574a747-8016-46db-a07c-b2b4854ee75c" +CODEBASE="http://qt.nokia.com/demos/hierarchy.cab"> +[Object not available! Did you forget to build and register the server?] +</object><br /> +<form> +<input type="edit" ID="nameEdit" value="<enter object name>" /> +<input type="button" value="Create" onClick="createSubWidget(this.form)" /> +<input type="edit" ID="labelEdit" /> +<input type="button" value="Rename" onClick="renameSubWidget(this.form)" /> +<br /> +<input type="edit" ID="fontEdit" value="MS Sans Serif" /> +<input type="button" value = "Set Font" onClick="setFont(this.form)" /> +</form> |
