| 1 |
/* |
| 2 |
* Copyright 2012 Canonical Ltd. |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU Lesser General Public License as published by |
| 6 |
* the Free Software Foundation; version 3. |
| 7 |
* |
| 8 |
* This program is distributed in the hope that it will be useful, |
| 9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 |
* GNU Lesser General Public License for more details. |
| 12 |
* |
| 13 |
* You should have received a copy of the GNU Lesser General Public License |
| 14 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 |
*/ |
| 16 |
|
| 17 |
import QtQuick 2.4 |
| 18 |
|
| 19 |
/*! |
| 20 |
\qmltype CheckBox |
| 21 |
\inqmlmodule Lomiri.Components |
| 22 |
\ingroup lomiri |
| 23 |
\brief CheckBox is a component with two states, checked or unchecked. It can |
| 24 |
be used to set boolean options. The behavior is the same as \l Switch, the |
| 25 |
only difference is the graphical style. |
| 26 |
|
| 27 |
\l {https://design.lomiri.com/apps/building-blocks/selection}{See also the Design Guidelines on selection}. |
| 28 |
|
| 29 |
Example: |
| 30 |
\qml |
| 31 |
Item { |
| 32 |
CheckBox { |
| 33 |
checked: true |
| 34 |
} |
| 35 |
} |
| 36 |
\endqml |
| 37 |
*/ |
| 38 |
AbstractButton { |
| 39 |
id: checkBox |
| 40 |
|
| 41 |
/*! |
| 42 |
Specifies whether the checkbox is checked or not. By default the property |
| 43 |
is set to false. |
| 44 |
*/ |
| 45 |
property bool checked: false |
| 46 |
|
| 47 |
/*! |
| 48 |
\internal |
| 49 |
*/ |
| 50 |
onTriggered: checked = !checked |
| 51 |
|
| 52 |
style: Theme.createStyleComponent("CheckBoxStyle.qml", checkBox) |
| 53 |
} |