aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-28 16:27:58 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-28 15:11:47 +0000
commita7687dbbb0fa0f619324b43bba1ccb9d5b75ce64 (patch)
treebfee66d1841631af55a51ec4e83cbe1639b3c4f5
parent97decc60e91be415b39785564cc40f8b30362809 (diff)
Doc: fix review findings for Switch & SwitchDelegate
Change-Id: I1626cb83d75e9b64fc5e274dc29fff04a157741b Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/quicktemplates2/qquickswitch.cpp14
-rw-r--r--src/quicktemplates2/qquickswitchdelegate.cpp8
2 files changed, 10 insertions, 12 deletions
diff --git a/src/quicktemplates2/qquickswitch.cpp b/src/quicktemplates2/qquickswitch.cpp
index a7d17e86..8c3d9f0b 100644
--- a/src/quicktemplates2/qquickswitch.cpp
+++ b/src/quicktemplates2/qquickswitch.cpp
@@ -57,17 +57,11 @@ QT_BEGIN_NAMESPACE
Switch is an option button that can be dragged or toggled on (checked) or
off (unchecked). Switches are typically used to select between two states.
+ For larger sets of options, such as those in a list, consider using
+ \l SwitchDelegate instead.
- \table
- \row \li \image qtquickcontrols2-switch-normal.png
- \li A switch in its normal state.
- \row \li \image qtquickcontrols2-switch-checked.png
- \li A switch that is checked.
- \row \li \image qtquickcontrols2-switch-focused.png
- \li A switch that has active focus.
- \row \li \image qtquickcontrols2-switch-disabled.png
- \li A switch that is disabled.
- \endtable
+ Switch inherits its API from \l AbstractButton. For instance, the state
+ of the switch can be set with the \l {AbstractButton::}{checked} property.
\code
ColumnLayout {
diff --git a/src/quicktemplates2/qquickswitchdelegate.cpp b/src/quicktemplates2/qquickswitchdelegate.cpp
index 62b677e5..edfb15d5 100644
--- a/src/quicktemplates2/qquickswitchdelegate.cpp
+++ b/src/quicktemplates2/qquickswitchdelegate.cpp
@@ -53,9 +53,13 @@ QT_BEGIN_NAMESPACE
SwitchDelegate presents an item delegate that can be toggled on (checked) or
off (unchecked). Switch delegates are typically used to select one or more
- options from a set of options.
+ options from a set of options. For smaller sets of options, or for options
+ that need to be uniquely identifiable, consider using \l Switch instead.
- The state of the check delegate can be set with the
+ SwitchDelegate inherits its API from \l ItemDelegate, which is inherited
+ from \l AbstractButton. For instance, you can set \l {AbstractButton::text}{text},
+ and react to \l {AbstractButton::clicked}{clicks} using the \l AbstractButton
+ API. The state of the switch delegate can be set with the
\l {AbstractButton::}{checked} property.
\code