diff --git a/examples/gallery/content/Styles.qml b/examples/gallery/content/Styles.qml index 4f40fe20e359371f49677d2168d274bac83f7bec..2950ef179d42afe4a93f59b19461839a9eb2ebf9 100644 --- a/examples/gallery/content/Styles.qml +++ b/examples/gallery/content/Styles.qml @@ -154,14 +154,14 @@ Item { } Row { - TabFrame { + TabView { width: 400 height: 30 Tab { title: "One" ; Item {}} Tab { title: "Two" ; Item {}} Tab { title: "Three" ; Item {}} Tab { title: "Four" ; Item {}} - style: tabFrameStyle + style: tabViewStyle } } } @@ -236,7 +236,7 @@ Item { } } - property Component tabFrameStyle: TabFrameStyle { + property Component tabViewStyle: TabViewStyle { tabOverlap: 16 leftMargin: 12 diff --git a/examples/gallery/main.qml b/examples/gallery/main.qml index ed26957c719ac358dd82a03c6a60812bb123f88e..450fe5a0ec85a313edcf62ede6425fd424ddfbd9 100644 --- a/examples/gallery/main.qml +++ b/examples/gallery/main.qml @@ -241,7 +241,7 @@ ApplicationWindow { ListElement { text: "Coconut" } } - TabFrame { + TabView { id:frame enabled: enabledCheck.checked position: controlPage.tabPosition diff --git a/examples/tableview/main.qml b/examples/tableview/main.qml index efee32af210d4e78b42a8d4b46674aedc6493d2e..5cc2e650cafcaf9a5400ed020e66b0e3af2a9c81 100644 --- a/examples/tableview/main.qml +++ b/examples/tableview/main.qml @@ -117,7 +117,7 @@ Rectangle { anchors.bottom: parent.bottom anchors.margins: 8 - TabFrame { + TabView { id:frame focus:true enabled: toolbar.enabled diff --git a/examples/touch/content/TabBarPage.qml b/examples/touch/content/TabBarPage.qml index 45ca3be082d4e58666c910373120719b7a8627f4..4edbaabde1f1c5c50f7ef302298c2d48759cb4a7 100644 --- a/examples/touch/content/TabBarPage.qml +++ b/examples/touch/content/TabBarPage.qml @@ -48,7 +48,7 @@ import QtQuick.Controls.Styles 1.0 Page { - TabFrame { + TabView { anchors.fill: parent style: touchStyle Tab { @@ -67,7 +67,7 @@ Page { Component { id: touchStyle - TabFrameStyle { + TabViewStyle { tabBarAlignment: "center" frame: Item { } tab: Item { diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml index 01ab6603067dfa4707b3ea86e7567c1f92cc15b6..ab2f75bdee6da2f789cd5696214c2ac2afc3e79c 100644 --- a/src/controls/ApplicationWindow.qml +++ b/src/controls/ApplicationWindow.qml @@ -69,7 +69,7 @@ import QtQuick.Controls.Private 1.0 } } - TabFrame { + TabView { id: myContent anchors.fill: parent ... diff --git a/src/controls/TabFrame.qml b/src/controls/TabView.qml similarity index 93% rename from src/controls/TabFrame.qml rename to src/controls/TabView.qml index 93198815243c1f70870f4ecf933f978066487273..f2064e7c15203a01011ceeeaff8c585a1e18bd87 100644 --- a/src/controls/TabFrame.qml +++ b/src/controls/TabView.qml @@ -44,7 +44,7 @@ import QtQuick.Controls.Private 1.0 import "Styles/Settings.js" as Settings /*! - \qmltype TabFrame + \qmltype TabView \inqmlmodule QtQuick.Controls 1.0 \ingroup navigation \brief Represents a control that contains multiple items that share the same space on the screen. @@ -52,7 +52,7 @@ import "Styles/Settings.js" as Settings */ Item { - id: tabWidget + id: root width: 100 height: 100 @@ -62,7 +62,7 @@ Item { property bool tabsVisible: true property string position: "North" default property alias tabs : stack.children - property Component style: Qt.createComponent(Settings.THEME_PATH + "/TabFrameStyle.qml", tabWidget) + property Component style: Qt.createComponent(Settings.THEME_PATH + "/TabViewStyle.qml", root) property var __styleItem: loader.item onCurrentChanged: __setOpacities() @@ -76,7 +76,7 @@ Item { if (stack.children[i].Accessible.role == Accessible.PageTab) ++tabCount; } - tabWidget.count = tabCount; + root.count = tabCount; } Component { @@ -103,7 +103,7 @@ Item { Loader { id: loader sourceComponent: style - property var control: tabWidget + property var control: root } Loader { @@ -113,7 +113,7 @@ Item { anchors.topMargin: tabbarItem && tabsVisible && position == "North" ? Math.max(0, tabbarItem.height - stack.baseOverlap) : 0 anchors.bottomMargin: tabbarItem && tabsVisible && position == "South" ? Math.max(0, tabbarItem.height - stack.baseOverlap) : 0 sourceComponent: frame && loader.item ? loader.item.frame : null - property var control: tabWidget + property var control: root Item { id: stack @@ -130,11 +130,11 @@ Item { TabBar { id: tabbarItem - tabFrame: tabWidget + tabView: root style: loader.item anchors.top: parent.top - anchors.left: tabWidget.left - anchors.right: tabWidget.right + anchors.left: root.left + anchors.right: root.right } states: [ @@ -148,7 +148,7 @@ Item { AnchorChanges { target: tabbarItem anchors.top: undefined - anchors.bottom: tabWidget.bottom + anchors.bottom: root.bottom } } ] diff --git a/src/controls/controls.pro b/src/controls/controls.pro index 507dda4fec72f39081d0140348890e0506eee4b8..66410f7c41a7b740254c7e8ea422b7adb91bb10f 100644 --- a/src/controls/controls.pro +++ b/src/controls/controls.pro @@ -28,7 +28,7 @@ QML_FILES = \ Splitter.qml \ StatusBar.qml \ Tab.qml \ - TabFrame.qml \ + TabView.qml \ TableView.qml \ TableViewColumn.qml \ TextArea.qml \ diff --git a/src/controls/doc/qtquickcontrols.qdocconf b/src/controls/doc/qtquickcontrols.qdocconf index bd683f1b59598f8b55c1b9d89a143c629abcef3e..29fcbd1a6c9ff45c666f1657ec1d561cf999f0d3 100644 --- a/src/controls/doc/qtquickcontrols.qdocconf +++ b/src/controls/doc/qtquickcontrols.qdocconf @@ -40,11 +40,11 @@ sources += ../../private/qstyleitem.cpp \ ../../styles/MenuItemStyle.qml \ ../../styles/ProgressBarStyle.qml \ ../../styles/RadioButtonStyle.qml \ - ../../styles/ScrollAreaStyle.qml \ + ../../styles/ScrollViewStyle.qml \ ../../styles/ScrollBarStyle.qml \ ../../styles/SliderStyle.qml \ ../../styles/SpinBoxStyle.qml \ - ../../styles/TabFrameStyle.qml \ + ../../styles/TabViewStyle.qml \ ../../styles/TextFieldStyle.qml \ ../../styles/ToolBarStyle.qml \ ../../styles/ToolButtonStyle.qml diff --git a/src/controls/qmldir b/src/controls/qmldir index 6543c8ae933bf95f3449a08e3e491d3adebdd8a4..bb2b24e841d78f23c2fa9635c3672030be2b81a3 100644 --- a/src/controls/qmldir +++ b/src/controls/qmldir @@ -21,7 +21,7 @@ SpinBox 1.0 SpinBox.qml Splitter 1.0 Splitter.qml StatusBar 1.0 StatusBar.qml Tab 1.0 Tab.qml -TabFrame 1.0 TabFrame.qml +TabView 1.0 TabView.qml TableView 1.0 TableView.qml TableViewColumn 1.0 TableViewColumn.qml TextArea 1.0 TextArea.qml diff --git a/src/private/TabBar.qml b/src/private/TabBar.qml index d5e2902b0b1651a3177c8322389a2d7d8d0b8cae..03d6d3ef10103cc0043ff12b3fa3b56526697b27 100644 --- a/src/private/TabBar.qml +++ b/src/private/TabBar.qml @@ -53,24 +53,23 @@ Item { Keys.onRightPressed: { - if (tabFrame && tabFrame.current < tabFrame.count - 1) - tabFrame.current = tabFrame.current + 1 + if (tabView && tabView.current < tabView.count - 1) + tabView.current = tabView.current + 1 } Keys.onLeftPressed: { - if (tabFrame && tabFrame.current > 0) - tabFrame.current = tabFrame.current - 1 + if (tabView && tabView.current > 0) + tabView.current = tabView.current - 1 } - onTabFrameChanged: parent = tabFrame - visible: tabFrame ? tabFrame.tabsVisible : true + onTabViewChanged: parent = tabView + visible: tabView ? tabView.tabsVisible : true - - property Item tabFrame + property var tabView property var style - property var styleItem: tabFrame.__styleItem ? tabFrame.__styleItem : null + property var styleItem: tabView.__styleItem ? tabView.__styleItem : null property string tabBarAlignment: styleItem ? styleItem.tabBarAlignment : "left" - property string position: tabFrame ? tabFrame.position : "North" + property string position: tabView ? tabView.position : "North" property int tabOverlap: styleItem ? styleItem.tabOverlap : 0 property int tabBaseOverlap: styleItem ? styleItem.tabBaseOverlap : 0 @@ -113,17 +112,17 @@ Item { Repeater { id: repeater focus: true - model: tabFrame ? tabFrame.count : null + model: tabView ? tabView.count : null delegate: Item { id: tabitem focus: true property int tabindex: index property bool selectedHelper: selected - property bool selected : tabFrame.current == index + property bool selected : tabView.current == index property bool hover: mousearea.containsMouse property bool first: index === 0 - property string title: tabFrame.tabs[index].title + property string title: tabView.tabs[index].title z: selected ? 1 : -index implicitWidth: Math.min(tabloader.implicitWidth, tabbar.width/repeater.count) + 1 @@ -135,11 +134,11 @@ Item { sourceComponent: loader.item ? loader.item.tab : null anchors.fill: parent - property Item control: tabFrame + property Item control: tabView property Item tab: tabitem property int index: tabindex - property bool nextSelected: tabFrame.current === index + 1 - property bool previousSelected: tabFrame.current === index - 1 + property bool nextSelected: tabView.current === index + 1 + property bool previousSelected: tabView.current === index - 1 property string title: tab.title } @@ -147,11 +146,11 @@ Item { id: mousearea anchors.fill: parent hoverEnabled: true - onPressed: tabFrame.current = index + onPressed: tabView.current = index onPressAndHold: tabitem.parent = null } Accessible.role: Accessible.PageTab - Accessible.name: tabFrame.tabs[index].title + Accessible.name: tabView.tabs[index].title } } } diff --git a/src/styles/Desktop/TabFrameStyle.qml b/src/styles/Desktop/TabViewStyle.qml similarity index 100% rename from src/styles/Desktop/TabFrameStyle.qml rename to src/styles/Desktop/TabViewStyle.qml diff --git a/src/styles/TabFrameStyle.qml b/src/styles/TabViewStyle.qml similarity index 98% rename from src/styles/TabFrameStyle.qml rename to src/styles/TabViewStyle.qml index 56cac100baeffc088a1a3ea6002646c52c4c19be..bcc8d4faa6f09761839c65922200f36421a0b33d 100644 --- a/src/styles/TabFrameStyle.qml +++ b/src/styles/TabViewStyle.qml @@ -41,10 +41,10 @@ import QtQuick 2.0 import QtQuick.Controls.Styles 1.0 /*! - \qmltype TabFrameStyle + \qmltype TabViewStyle \internal \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for TabFrame + \brief provides custom styling for TabView */ Style { diff --git a/src/styles/qmldir b/src/styles/qmldir index 223c2178b8b171029156e8ffc9c526231e58daa5..eee1abd175457b033dd4e095ab0aa861c828b0e3 100644 --- a/src/styles/qmldir +++ b/src/styles/qmldir @@ -9,7 +9,7 @@ ScrollBarStyle 1.0 ScrollBarStyle.qml SliderStyle 1.0 SliderStyle.qml SpinBoxStyle 1.0 SpinBoxStyle.qml TabStyle 1.0 TabStyle.qml -TabFrameStyle 1.0 TabFrameStyle.qml +TabViewStyle 1.0 TabViewStyle.qml TextAreaStyle 1.0 TextAreaStyle.qml TextFieldStyle 1.0 TextFieldStyle.qml ToolBarStyle 1.0 ToolBarStyle.qml diff --git a/src/styles/styles.pro b/src/styles/styles.pro index 70c6ba1eb2fff45d9625a0f219dcb6c38eedf743..f0d44f6a95b4df11c9ee60dfb3d51df2e2975afc 100644 --- a/src/styles/styles.pro +++ b/src/styles/styles.pro @@ -14,7 +14,7 @@ QML_FILES = \ SliderStyle.qml \ SpinBoxStyle.qml \ Style.qml \ - TabFrameStyle.qml \ + TabViewStyle.qml \ TextFieldStyle.qml \ ToolBarStyle.qml \ ToolButtonStyle.qml @@ -32,7 +32,7 @@ QML_FILES += \ Desktop/ScrollBarStyle.qml \ Desktop/SliderStyle.qml \ Desktop/SpinBoxStyle.qml \ - Desktop/TabFrameStyle.qml \ + Desktop/TabViewStyle.qml \ Desktop/TextFieldStyle.qml \ Desktop/ToolBarStyle.qml \ Desktop/ToolButtonStyle.qml diff --git a/tests/auto/controls/controls.pro b/tests/auto/controls/controls.pro index cbd7150f23e4e2fb70b22e9d565e3a831c2a2195..fb2feeca5e494eccbd5078e4b3f0ebb4f148e8a1 100644 --- a/tests/auto/controls/controls.pro +++ b/tests/auto/controls/controls.pro @@ -32,7 +32,7 @@ OTHER_FILES += \ $$PWD/data/tst_slider.qml \ $$PWD/data/tst_statusbar.qml \ $$PWD/data/tst_tab.qml \ - $$PWD/data/tst_tabframe.qml \ + $$PWD/data/tst_tabview.qml \ $$PWD/data/tst_tableviewcolumn.qml \ $$PWD/data/tst_toolbar.qml \ $$PWD/data/tst_toolbutton.qml \ diff --git a/tests/auto/controls/data/tst_tabframe.qml b/tests/auto/controls/data/tst_tabview.qml similarity index 86% rename from tests/auto/controls/data/tst_tabframe.qml rename to tests/auto/controls/data/tst_tabview.qml index d6e69ba8f72ed61cf45ac2d6408c53f7daff31ab..19661a3f9bc412d0ccd04ccd2f6a325f472e18bf 100644 --- a/tests/auto/controls/data/tst_tabframe.qml +++ b/tests/auto/controls/data/tst_tabview.qml @@ -43,18 +43,18 @@ import QtTest 1.0 TestCase { id: testCase - name: "Tests_TabFrame" + name: "Tests_TabView" when:windowShown width:400 height:400 - function test_createTabFrame() { - var tabFrame = Qt.createQmlObject('import QtQuick.Controls 1.0; TabFrame {}', testCase, ''); + function test_createTabView() { + var tabView = Qt.createQmlObject('import QtQuick.Controls 1.0; TabView {}', testCase, ''); } function test_repeater() { - var tabFrame = Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Controls 1.0; TabFrame { Repeater { model: 3; Tab { } } }', testCase, ''); - compare(tabFrame.count, 3) + var tabView = Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Controls 1.0; TabView { Repeater { model: 3; Tab { } } }', testCase, ''); + compare(tabView.count, 3) } } diff --git a/tests/manual/Layout.qml b/tests/manual/Layout.qml index 4b26865a112885128a956403269b8a776826380f..9646d885b2967b50aa21817e541a31191a20a7b5 100644 --- a/tests/manual/Layout.qml +++ b/tests/manual/Layout.qml @@ -56,7 +56,7 @@ Item { checked: false width: parent.width } - TabFrame { + TabView { id:frame width: parent.width diff --git a/tests/manual/scrollbars.qml b/tests/manual/scrollbars.qml index 4ce169da0e8b12ba55e6e77d5238b6e02ec01e2b..231ead7fc47f1148d389ce88392c0f722161d278 100644 --- a/tests/manual/scrollbars.qml +++ b/tests/manual/scrollbars.qml @@ -81,7 +81,7 @@ ApplicationWindow { } } - TabFrame { + TabView { id:frame anchors.fill: parent anchors.margins: 4 diff --git a/tests/manual/stretching.qml b/tests/manual/stretching.qml index fc69d46360e772253476bb818410f522b164ba71..9af4ca1d6b88e43361fbf749c8e44ca96b114352 100644 --- a/tests/manual/stretching.qml +++ b/tests/manual/stretching.qml @@ -46,7 +46,7 @@ Rectangle { width: 600 height: 400 - TabFrame { + TabView { anchors.fill: parent Tab { title: "Height" diff --git a/tests/manual/stretchingcustom.qml b/tests/manual/stretchingcustom.qml index ca5b4f76233f360e49740fc3f3067d13a5ddf50c..8df1f794fd28798b42979ee79625b1638d04dec5 100644 --- a/tests/manual/stretchingcustom.qml +++ b/tests/manual/stretchingcustom.qml @@ -46,7 +46,7 @@ Rectangle { width: 600 height: 400 - TabFrame { + TabView { anchors.fill: parent Tab { title: "Height"