diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/controls/Styles/Base/BasicTableViewStyle.qml | 45 | ||||
-rw-r--r-- | src/controls/Styles/Base/TableViewStyle.qml | 11 | ||||
-rw-r--r-- | src/controls/Styles/Base/TreeViewStyle.qml | 30 | ||||
-rw-r--r-- | src/controls/doc/qtquickcontrols.qdocconf | 15 | ||||
-rw-r--r-- | src/controls/doc/src/qtquickcontrolsstyles-tableviewstyle.qdoc | 59 | ||||
-rw-r--r-- | src/controls/doc/src/qtquickcontrolsstyles-treeviewstyle.qdoc | 82 |
6 files changed, 180 insertions, 62 deletions
diff --git a/src/controls/Styles/Base/BasicTableViewStyle.qml b/src/controls/Styles/Base/BasicTableViewStyle.qml index 3c5e4512..973d09c0 100644 --- a/src/controls/Styles/Base/BasicTableViewStyle.qml +++ b/src/controls/Styles/Base/BasicTableViewStyle.qml @@ -40,41 +40,48 @@ import QtQuick.Controls.Private 1.0 /*! \qmltype BasicTableViewStyle - \inqmlmodule QtQuick.Controls.Styles - \since 5.1 \internal + \inherits ScrollViewStyle \qmlabstract - \ingroup viewsstyling - \brief Provides custom styling for TableView - - \note This class derives from \l {ScrollViewStyle} - and supports all of the properties defined there. */ + ScrollViewStyle { id: root - /*! \internal */ + /*! \qmlproperty BasicTableView BasicTableViewStyle::control + \internal */ readonly property BasicTableView control: __control - /*! The text color. */ + /*! \qmlproperty color BasicTableViewStyle::textColor + The text color. */ property color textColor: SystemPaletteSingleton.text(control.enabled) - /*! The background color. */ + /*! \qmlproperty color BasicTableViewStyle::backgroundColor + The background color. */ property color backgroundColor: control.backgroundVisible ? SystemPaletteSingleton.base(control.enabled) : "transparent" - /*! The alternate background color. */ + /*! \qmlproperty color BasicTableViewStyle::alternateBackgroundColor + The alternate background color. */ property color alternateBackgroundColor: "#f5f5f5" - /*! The text highlight color, used within selections. */ + /*! \qmlproperty color BasicTableViewStyle::highlightedTextColor + The text highlight color, used within selections. */ property color highlightedTextColor: "white" - /*! Activates items on single click. */ + /*! \qmlproperty bool BasicTableViewStyle::activateItemOnSingleClick + Activates items on single click. + + Its default value is \c false. + */ property bool activateItemOnSingleClick: false padding.top: control.headerVisible ? 0 : 1 /*! \qmlproperty Component BasicTableViewStyle::headerDelegate - Delegate for header. This delegate is described in \l {TreeView}{TreeView.headerDelegate} and \l {TableView}{TableView.headerDelegate} + \internal + + Different documentation for TableViewStyle and TreeViewStyle. + See qtquickcontrolsstyles-tableviewstyle.qdoc and qtquickcontrolsstyles-treeviewstyle.qdoc */ property Component headerDelegate: BorderImage { height: textItem.implicitHeight * 1.2 @@ -105,7 +112,10 @@ ScrollViewStyle { } /*! \qmlproperty Component BasicTableViewStyle::rowDelegate - Delegate for row. This delegate is described in \l {TreeView}{TreeView.rowDelegate} and \l {TableView}{TableView.rowDelegate} + \internal + + Different documentation for TableViewStyle and TreeViewStyle. + See qtquickcontrolsstyles-tableviewstyle.qdoc and qtquickcontrolsstyles-treeviewstyle.qdoc */ property Component rowDelegate: Rectangle { height: Math.round(TextSingleton.implicitHeight * 1.2) @@ -115,7 +125,10 @@ ScrollViewStyle { } /*! \qmlproperty Component BasicTableViewStyle::itemDelegate - Delegate for item. This delegate is described in \l {TreeView}{TreeView.itemDelegate} and \l {TableView}{TableView.itemDelegate} + \internal + + Different documentation for TableViewStyle and TreeViewStyle. + See qtquickcontrolsstyles-tableviewstyle.qdoc and qtquickcontrolsstyles-treeviewstyle.qdoc */ property Component itemDelegate: Item { height: Math.max(16, label.implicitHeight) diff --git a/src/controls/Styles/Base/TableViewStyle.qml b/src/controls/Styles/Base/TableViewStyle.qml index ddf15cef..b866f490 100644 --- a/src/controls/Styles/Base/TableViewStyle.qml +++ b/src/controls/Styles/Base/TableViewStyle.qml @@ -37,19 +37,8 @@ import QtQuick 2.5 import QtQuick.Controls 1.4 -/*! - \qmltype TableViewStyle - \inqmlmodule QtQuick.Controls.Styles - \since 5.1 - \ingroup viewsstyling - \brief Provides custom styling for TableView - - \note This class derives from \l {ScrollViewStyle} - and supports all of the properties defined there. -*/ BasicTableViewStyle { id: root - /*! The \l TableView this style is attached to. */ readonly property TableView control: __control } diff --git a/src/controls/Styles/Base/TreeViewStyle.qml b/src/controls/Styles/Base/TreeViewStyle.qml index 16b7b862..b8f03f65 100644 --- a/src/controls/Styles/Base/TreeViewStyle.qml +++ b/src/controls/Styles/Base/TreeViewStyle.qml @@ -38,43 +38,13 @@ import QtQuick 2.5 import QtQuick.Controls 1.4 import QtQuick.Controls.Private 1.0 -/*! - \qmltype TreeViewStyle - \inqmlmodule QtQuick.Controls.Styles - \since 5.5 - \ingroup viewsstyling - \brief Provides custom styling for TreeView -*/ BasicTableViewStyle { id: root - /*! The \l TreeView this style is attached to. */ readonly property TreeView control: __control - /*! - The amount each level is indented relatively to its parent level. - */ property int indentation: 12 - // TODO - to update - /*! \qmlproperty Component TreeViewStyle::branchDelegate - - This property defines a delegate to draw the branch indicator. - - In the branch delegate you have access to the following special properties: - \list - \li styleData.row - the index of the view row - \li styleData.column - the index of the view column. Will always be 0 - \li styleData.selected - if the item is currently selected - \li styleData.textColor - the default text color for an item - \li styleData.index - the QModelIndex of the current item in the model - \li styleData.depth - the depth of the current item in the tree model - \li styleData.isExpanded - true when the item is expanded - \li styleData.hasChildren - true if the model index of the current item has children - \li styleData.hasSibling - true if the model index of the current item has sibling - \endlist - */ - property Component branchDelegate: Item { width: 16 height: 16 diff --git a/src/controls/doc/qtquickcontrols.qdocconf b/src/controls/doc/qtquickcontrols.qdocconf index e9e5cacf..e8aa0422 100644 --- a/src/controls/doc/qtquickcontrols.qdocconf +++ b/src/controls/doc/qtquickcontrols.qdocconf @@ -37,11 +37,9 @@ exampledirs += ../../../examples/quick/controls \ snippets examplesinstallpath = quick/controls -headerdirs += ../ \ - Styles/Base +headerdirs += .. -sourcedirs += ../ \ - Styles/Base +sourcedirs += .. sources += ../Private/AbstractCheckable.qml \ ../Private/BasicButton.qml \ @@ -55,7 +53,14 @@ sources += ../Private/AbstractCheckable.qml \ ../Private/qquickabstractstyle.h \ ../Private/qquickabstractstyle.cpp -excludefiles += ../TableView.qml ../TreeView.qml +excludefiles += ../TableView.qml \ + ../TreeView.qml \ + ../Styles/Base/TableViewStyle.qml \ + ../Styles/Base/TreeViewStyle.qml + +excludedirs += ../Styles/Desktop \ + ../Styles/Android \ + ../Styles/iOS imagedirs += images \ ../../extras/doc/images diff --git a/src/controls/doc/src/qtquickcontrolsstyles-tableviewstyle.qdoc b/src/controls/doc/src/qtquickcontrolsstyles-tableviewstyle.qdoc new file mode 100644 index 00000000..0b5012f1 --- /dev/null +++ b/src/controls/doc/src/qtquickcontrolsstyles-tableviewstyle.qdoc @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \qmltype TableViewStyle + \inqmlmodule QtQuick.Controls.Styles + \inherits BasicTableViewStyle + \since 5.1 + \ingroup viewsstyling + \brief Provides custom styling for TableView +*/ + +/*! + \qmlproperty TableView TableViewStyle::control + The \l TableView this style is attached to. +*/ + +/*! + \qmlproperty Component TableViewStyle::headerDelegate + + Delegate for header. This delegate is described in \l {TableView}{TableView.headerDelegate}. +*/ + +/*! + \qmlproperty Component TableViewStyle::rowDelegate + + Delegate for row. This delegate is described in \l {TableView}{TableView.rowDelegate}. +*/ + +/*! + \qmlproperty Component TableViewStyle::itemDelegate + + Delegate for item. This delegate is described in \l {TableView}{TableView.itemDelegate}. +*/ + diff --git a/src/controls/doc/src/qtquickcontrolsstyles-treeviewstyle.qdoc b/src/controls/doc/src/qtquickcontrolsstyles-treeviewstyle.qdoc new file mode 100644 index 00000000..3f4508f4 --- /dev/null +++ b/src/controls/doc/src/qtquickcontrolsstyles-treeviewstyle.qdoc @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \qmltype TreeViewStyle + \inqmlmodule QtQuick.Controls.Styles + \inherits BasicTableViewStyle + \since 5.5 + \ingroup viewsstyling + \brief Provides custom styling for TreeView +*/ + +/*! + \qmlproperty TreeView TreeViewStyle::control + The \l TreeView this style is attached to. +*/ + +/*! + \qmlproperty int TreeViewStyle::indentation + The amount each level is indented relatively to its parent level. +*/ + +/*! + \qmlproperty Component TreeViewStyle::branchDelegate + + This property defines a delegate to draw the branch indicator. + + In the branch delegate you have access to the following special properties: + \list + \li styleData.row - the index of the view row + \li styleData.column - the index of the view column. Will always be 0 + \li styleData.selected - if the item is currently selected + \li styleData.textColor - the default text color for an item + \li styleData.index - the QModelIndex of the current item in the model + \li styleData.depth - the depth of the current item in the tree model + \li styleData.isExpanded - true when the item is expanded + \li styleData.hasChildren - true if the model index of the current item has children + \li styleData.hasSibling - true if the model index of the current item has sibling + \endlist +*/ + +/*! + \qmlproperty Component TreeViewStyle::headerDelegate + + Delegate for header. This delegate is described in \l {TreeView}{TreeView.headerDelegate}. +*/ + +/*! + \qmlproperty Component TreeViewStyle::rowDelegate + + Delegate for row. This delegate is described in \l {TreeView}{TreeView.rowDelegate}. +*/ + +/*! + \qmlproperty Component TreeViewStyle::itemDelegate + + Delegate for item. This delegate is described in \l {TreeView}{TreeView.itemDelegate}. +*/ |