diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-06-25 15:02:47 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-06-25 20:44:37 +0000 |
commit | 405cff37fc3479b2c9f895c60a4e98155cee5650 (patch) | |
tree | d614a10db63b14d3cb20dece0507259997a9b95e /src | |
parent | 3ed7ad24aaa2762b69bdd43a302a7fa1804aab48 (diff) |
Docs: TabBar & TabButton
Change-Id: Ib06c610b1637831ddce6214507b07f29bc67421d
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/controls/qquicktabbar.cpp | 47 | ||||
-rw-r--r-- | src/controls/qquicktabbutton.cpp | 14 |
2 files changed, 57 insertions, 4 deletions
diff --git a/src/controls/qquicktabbar.cpp b/src/controls/qquicktabbar.cpp index c868f41c..7714ddbe 100644 --- a/src/controls/qquicktabbar.cpp +++ b/src/controls/qquicktabbar.cpp @@ -48,7 +48,47 @@ QT_BEGIN_NAMESPACE \ingroup tabs \brief A tab bar control. - TODO + TabBar provides a tab-based navigation model. TabBar is populated with + TabButton controls, and can be used together with any layout or container + control that provides \c currentIndex -property, such as \l StackLayout + or \l SwipeView + + ### TODO: screenshot + + \code + ApplicationWindow { + visible:true + + header: TabBar { + id: bar + TabButton { + text: qsTr("Home") + } + TabButton { + text: qsTr("Discover") + } + TabButton { + text: qsTr("Activity") + } + } + + StackLayout { + anchors.fill: parent + currentIndex: bar.currentIndex + Item { + id: homeTab + } + Item { + id: discoverTab + } + Item { + id: activityTab + } + } + } + \endcode + + \sa TabButton, {Customizing TabBar} */ class QQuickTabBarPrivate : public QQuickContainerPrivate @@ -147,7 +187,7 @@ QQuickTabBar::QQuickTabBar(QQuickItem *parent) : /*! \qmlproperty int QtQuickControls2::TabBar::currentIndex - TODO + This property holds the current index. */ int QQuickTabBar::currentIndex() const { @@ -168,8 +208,9 @@ void QQuickTabBar::setCurrentIndex(int index) /*! \qmlproperty Item QtQuickControls2::TabBar::currentItem + \readonly - TODO + This property holds the current item. */ QQuickItem *QQuickTabBar::currentItem() const { diff --git a/src/controls/qquicktabbutton.cpp b/src/controls/qquicktabbutton.cpp index 62a556af..dacffc24 100644 --- a/src/controls/qquicktabbutton.cpp +++ b/src/controls/qquicktabbutton.cpp @@ -46,7 +46,19 @@ QT_BEGIN_NAMESPACE \ingroup tabs \brief A tab button control. - TODO + TabButton is used in conjunction with a \l TabBar. + + ### TODO: screenshot + + \code + TabBar { + TabButton { text: qsTr("Home") } + TabButton { text: qsTr("Discover") } + TabButton { text: qsTr("Activity") } + } + \endcode + + \sa TabBar, {Customizing TabButton} */ QQuickTabButton::QQuickTabButton(QQuickItem *parent) : |