aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-10 15:50:18 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-10 16:52:06 +0000
commita28996de0aa7321855c28aa7720ad713936b7caa (patch)
tree3bcdd07fb09a2b03637ded734eaf2b9117989446 /src
parent356ed5addc48663174019b1e40f970b727567166 (diff)
Docs: Customizing Qt Quick Controls
Change-Id: I747e030096a068e20043cdff9dd62775ca77feb6 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/controls/doc/src/qtquickcontrols2-customize.qdoc104
-rw-r--r--src/controls/qquickbutton.cpp26
-rw-r--r--src/controls/qquickcheckbox.cpp28
-rw-r--r--src/controls/qquickradiobutton.cpp30
4 files changed, 107 insertions, 81 deletions
diff --git a/src/controls/doc/src/qtquickcontrols2-customize.qdoc b/src/controls/doc/src/qtquickcontrols2-customize.qdoc
new file mode 100644
index 00000000..6e4827a1
--- /dev/null
+++ b/src/controls/doc/src/qtquickcontrols2-customize.qdoc
@@ -0,0 +1,104 @@
+/****************************************************************************
+**
+** 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$
+**
+****************************************************************************/
+
+/*!
+ \page qtquickcontrols2-customize.html
+ \title Customizing Qt Quick Controls 2
+ \brief A set of UI controls to create user interfaces in Qt Quick
+
+ Qt Quick Controls consist of a hierarchy (tree) of items. In order to
+ provide a custom look'n'feel, the default implementation of each can be
+ replaced with a custom item. The following snippets present the default
+ implementations of various items. These can be used as a starting point
+ to implement custom look'n'feel.
+
+ \section1 Customizing Button
+
+ Button consists of two parts: \l {Control::background}{background} and
+ \l {Button::label}{label}. Their implicit sizes are used to calculate
+ the implicit size of the control.
+
+ \section3 Background
+
+ \image qtquickcontrols2-button-background.png
+
+ \snippet Button.qml background
+
+ \section3 Label
+
+ \image qtquickcontrols2-button-label.png
+
+ \snippet Button.qml label
+
+ \section1 Customizing CheckBox
+
+ CheckBox consists of three parts: \l {Control::background}{background},
+ \l {Button::label}{label} and \l {Checkable::indicator}{indicator}. Their
+ implicit sizes are used to calculate the implicit size of the control.
+
+ \section3 Background
+
+ \image qtquickcontrols2-checkbox-background.png
+
+ CheckBox has no background item by default.
+
+ \section3 Label
+
+ \image qtquickcontrols2-checkbox-label.png
+
+ \snippet CheckBox.qml label
+
+ \section3 Indicator
+
+ \image qtquickcontrols2-checkbox-indicator.png
+
+ \snippet CheckBox.qml indicator
+
+ \section1 Customizing RadioButton
+
+ RadioButton consists of three parts: \l {Control::background}{background},
+ \l {Button::label}{label} and \l {Checkable::indicator}{indicator}. Their
+ implicit sizes are used to calculate the implicit size of the control.
+
+ \section3 Background
+
+ \image qtquickcontrols2-radiobutton-background.png
+
+ RadioButton has no background item by default.
+
+ \section3 Label
+
+ \image qtquickcontrols2-radiobutton-label.png
+
+ \snippet RadioButton.qml label
+
+ \section3 Indicator
+
+ \image qtquickcontrols2-radiobutton-indicator.png
+
+ \snippet RadioButton.qml indicator
+*/
diff --git a/src/controls/qquickbutton.cpp b/src/controls/qquickbutton.cpp
index 69182881..bcf48f42 100644
--- a/src/controls/qquickbutton.cpp
+++ b/src/controls/qquickbutton.cpp
@@ -76,31 +76,7 @@ QT_BEGIN_NAMESPACE
}
\endcode
- \section1 Structure
-
- Button consists of two parts, \l {Control::background}{background} and
- \l {Button::label}{label}. Their implicit sizes are used to calculate
- the implicit size of the control.
-
- \section3 Background
-
- \image qtquickcontrols2-button-background.png
-
- The following snippet presents the default background item implementation.
-
- \snippet Button.qml background
-
- \section3 Label
-
- \image qtquickcontrols2-button-label.png
-
- The following snippet presents the default label item implementation.
-
- \snippet Button.qml label
-
- \section1 Theming
-
- \note ### TODO: Document what is used and how to customize.
+ \sa {Customizing Button}
*/
/*!
diff --git a/src/controls/qquickcheckbox.cpp b/src/controls/qquickcheckbox.cpp
index cc314053..7e877f45 100644
--- a/src/controls/qquickcheckbox.cpp
+++ b/src/controls/qquickcheckbox.cpp
@@ -77,33 +77,7 @@ QT_BEGIN_NAMESPACE
}
\endcode
- \section1 Structure
-
- CheckBox consists of three parts, \l {Control::background}{background},
- \l {Button::label}{label} and \l {Checkable::indicator}{indicator}. Their
- implicit sizes are used to calculate the implicit size of the control.
-
- \section3 Background
-
- \image qtquickcontrols2-checkbox-background.png
-
- CheckBox has no background item by default.
-
- \section3 Label
-
- \image qtquickcontrols2-checkbox-label.png
-
- The following snippet presents the default label item implementation.
-
- \snippet CheckBox.qml label
-
- \section3 Indicator
-
- \image qtquickcontrols2-checkbox-indicator.png
-
- The following snippet presents the default indicator item implementation.
-
- \snippet CheckBox.qml indicator
+ \sa {Customizing CheckBox}
*/
QQuickCheckBox::QQuickCheckBox(QQuickItem *parent) :
diff --git a/src/controls/qquickradiobutton.cpp b/src/controls/qquickradiobutton.cpp
index 1dcc309c..5d1004e3 100644
--- a/src/controls/qquickradiobutton.cpp
+++ b/src/controls/qquickradiobutton.cpp
@@ -80,35 +80,7 @@ QT_BEGIN_NAMESPACE
}
\endcode
- \section1 Structure
-
- RadioButton consists of three parts, \l {Control::background}{background},
- \l {Button::label}{label} and \l {Checkable::indicator}{indicator}. Their
- implicit sizes are used to calculate the implicit size of the control.
-
- \section3 Background
-
- \image qtquickcontrols2-radiobutton-background.png
-
- RadioButton has no background item by default.
-
- \section3 Label
-
- \image qtquickcontrols2-radiobutton-label.png
-
- The following snippet presents the default label item implementation.
-
- \snippet RadioButton.qml label
-
- \section3 Indicator
-
- \image qtquickcontrols2-radiobutton-indicator.png
-
- The following snippet presents the default indicator item implementation.
-
- \snippet RadioButton.qml indicator
-
- \sa ExclusiveGroup
+ \sa ExclusiveGroup, {Customizing RadioButton}
*/
QQuickRadioButton::QQuickRadioButton(QQuickItem *parent) :