diff options
Diffstat (limited to 'src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/webxml/test-componentset-tabwidget-qml.webxml')
-rw-r--r-- | src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/webxml/test-componentset-tabwidget-qml.webxml | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/webxml/test-componentset-tabwidget-qml.webxml b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/webxml/test-componentset-tabwidget-qml.webxml new file mode 100644 index 000000000..6ee3ce5dc --- /dev/null +++ b/src/qdoc/qdoc/tests/validateqdocoutputfiles/testdata/comprehensiveproject/expected/webxml/test-componentset-tabwidget-qml.webxml @@ -0,0 +1,154 @@ +<?xml version="1.0" encoding="UTF-8"?> +<WebXML> + <document> + <page name="componentset/TabWidget.qml" href="test-componentset-tabwidget-qml.html" title="TabWidget.qml Example File" fulltitle="TabWidget.qml Example File" subtitle="componentset/TabWidget.qml"> + <description> + <code><@comment>// Copyright (C) 2016 The Qt Company Ltd.</@comment> +<@comment>// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause</@comment> + +import QtQuick 1.0 + +<@comment>/*! + \qmltype TabWidget + \inqmlmodule UIComponents + \brief A widget that places its children as tabs. + + A TabWidget places its children as tabs in a view. Selecting + a tab involves selecting the tab at the top. + + The TabWidget component is part of the \l {UI Components} module. + + This documentation is part of the \l{componentset}{UIComponents} example. + + \section1 Adding Tabs + + To add a tab, declare the tab as a child of the TabWidget. + + \code + TabWidget { + id: tabwidget + + Rectangle { + id: tab1 + color: &quot;red&quot; + //... omitted + } + Rectangle { + id: tab2 + color: &quot;blue&quot; + //... omitted + } + + } + \endcode + +*/</@comment> +<@type>Item</@type> { + <@name>id</@name>: <@name>tabWidget</@name> + + <@comment>/*! + \internal + + Setting the default property to stack.children means any child items + of the TabWidget are actually added to the 'stack' item's children. + + See the \l{&quot;Property Binding in QML&quot;} + documentation for details on default properties. + + This is an implementation detail, not meant for public knowledge. Putting + the \internal command at the beginning will cause QDoc to not publish this + documentation in the public API page. + + Normally, a property alias needs to have a + &quot;\qmlproperty &lt;type&gt; &lt;propertyname&gt;&quot; to assign the alias a type. + + */</@comment> + default property <@type>alias</@type> <@name>content</@name>: <@name>stack</@name>.<@name>children</@name> + + <@comment>/*! + The currently active tab in the TabWidget. + */</@comment> + property <@type>int</@type> <@name>current</@name>: <@number>0</@number> + + <@comment>/*! + A sample \c{read-only} property. + A contrived property to demonstrate QDoc's ability to detect + read-only properties. + + The signature is: + \code + readonly property int sampleReadOnlyProperty: 0 + \endcode + + Note that the property must be initialized to a value. + + */</@comment> + readonly property <@type>int</@type> <@name>sampleReadOnlyProperty</@name>: <@number>0</@number> + + <@comment>/*! + \internal + + This handler is an implementation + detail. The \c{\internal} command will prevent QDoc from publishing this + documentation on the public API. + */</@comment> + <@name>onCurrentChanged</@name>: <@name>setOpacities</@name>() + <@name>Component</@name>.onCompleted: <@name>setOpacities</@name>() + + <@comment>/*! + \internal + + An internal function to set the opacity. + The \internal command will prevent QDoc from publishing this + documentation on the public API. + */</@comment> + <@keyword>function </@keyword><@name>setOpacities</@name>() { + <@keyword>for</@keyword> (var i = 0; <@name>i</@name> <@op>&lt;</@op> <@name>stack</@name>.<@name>children</@name>.<@name>length</@name>; ++<@name>i</@name>) { + <@name>stack</@name>.<@name>children</@name>[<@name>i</@name>].<@name>opacity</@name> <@op>=</@op> (<@name>i</@name> <@op>==</@op> <@name>current</@name> ? <@number>1</@number> : <@number>0</@number>) + } + } + + <@type>Row</@type> { + <@name>id</@name>: <@name>header</@name> + + <@type>Repeater</@type> { + <@name>model</@name>: <@name>stack</@name>.<@name>children</@name>.<@name>length</@name> + <@name>delegate</@name>: <@name>Rectangle</@name> { + <@name>width</@name>: <@name>tabWidget</@name>.<@name>width</@name> <@op>/</@op> <@name>stack</@name>.<@name>children</@name>.<@name>length</@name>; <@name>height</@name>: <@number>36</@number> + + <@type>Rectangle</@type> { + <@name>width</@name>: <@name>parent</@name>.<@name>width</@name>; <@name>height</@name>: <@number>1</@number> + <@type>anchors</@type> { <@name>bottom</@name>: <@name>parent</@name>.<@name>bottom</@name>; <@name>bottomMargin</@name>: <@number>1</@number> } + <@name>color</@name>: <@string>&quot;#acb2c2&quot;</@string> + } + <@type>BorderImage</@type> { + <@type>anchors</@type> { <@name>fill</@name>: <@name>parent</@name>; <@name>leftMargin</@name>: <@number>2</@number>; <@name>topMargin</@name>: <@number>5</@number>; <@name>rightMargin</@name>: <@number>1</@number> } + <@type>border</@type> { <@name>left</@name>: <@number>7</@number>; <@name>right</@name>: <@number>7</@number> } + <@name>source</@name>: <@string>&quot;tab.png&quot;</@string> + <@name>visible</@name>: <@name>tabWidget</@name>.<@name>current</@name> <@op>==</@op> <@name>index</@name> + } + <@type>Text</@type> { + <@name>horizontalAlignment</@name>: <@name>Qt</@name>.<@name>AlignHCenter</@name>; <@name>verticalAlignment</@name>: <@name>Qt</@name>.<@name>AlignVCenter</@name> + <@name>anchors</@name>.fill: <@name>parent</@name> + <@name>text</@name>: <@name>stack</@name>.<@name>children</@name>[<@name>index</@name>].<@name>title</@name> + <@name>elide</@name>: <@name>Text</@name>.<@name>ElideRight</@name> + <@name>font</@name>.bold: <@name>tabWidget</@name>.<@name>current</@name> <@op>==</@op> <@name>index</@name> + } + <@type>MouseArea</@type> { + <@name>anchors</@name>.fill: <@name>parent</@name> + <@name>onClicked</@name>: <@name>tabWidget</@name>.<@name>current</@name> <@op>=</@op> <@name>index</@name> + } + } + } + } + + <@type>Item</@type> { + <@name>id</@name>: <@name>stack</@name> + <@name>width</@name>: <@name>tabWidget</@name>.<@name>width</@name> + <@name>anchors</@name>.top: <@name>header</@name>.<@name>bottom</@name>; <@name>anchors</@name>.bottom: <@name>tabWidget</@name>.<@name>bottom</@name> + } +}</code> + </description> + </page> + </document> +</WebXML> |