diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2013-02-21 16:45:47 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-22 15:55:29 +0100 |
commit | 0b4bac0599c226a590c414a1cbec4d91e3e49b12 (patch) | |
tree | 7c093e27df695e98f6c7e9bcaf1e3616f3e71084 /src/controls/CheckBox.qml | |
parent | fa32cd2fddc25952d14c0953e76f590874122494 (diff) | |
download | qtquickcontrols-0b4bac0599c226a590c414a1cbec4d91e3e49b12.tar.gz |
Warn when trying to use ExclusiveGroups with partiallyCheckedEnabled.
It makes no sense to have partially checked boxes as part of an
exclusive group, and exclusive group doesn't support it.
Change-Id: I9658c247345bfc8e165ba11502691d1b4813ad54
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/controls/CheckBox.qml')
-rw-r--r-- | src/controls/CheckBox.qml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/controls/CheckBox.qml b/src/controls/CheckBox.qml index c9f1b8f1..d2ee44ce 100644 --- a/src/controls/CheckBox.qml +++ b/src/controls/CheckBox.qml @@ -139,6 +139,20 @@ AbstractCheckable { } /*! \internal */ + onPartiallyCheckedEnabledChanged: { + if (exclusiveGroup && partiallyCheckedEnabled) { + console.warn("Cannot have partially checked boxes in an ExclusiveGroup."); + } + } + + /*! \internal */ + onExclusiveGroupChanged: { + if (exclusiveGroup && partiallyCheckedEnabled) { + console.warn("Cannot have partially checked boxes in an ExclusiveGroup."); + } + } + + /*! \internal */ function cycleCheckBoxStates() { if (!partiallyCheckedEnabled) { checked = !checked; |