Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
None
-
None
-
960798f9117bc5aa4aa55bf868cbb0286f8e99b6
Description
A small example that isn't that nice:
import QtQuick 2.6 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.1 import QtQuick.Window 2.0 Window { width: column.implicitWidth height: column.implicitHeight visible: true ColumnLayout { id: column anchors.centerIn: parent CheckBox { text: qsTr("Languages") checkState: english.checked && norwegian.checked ? Qt.Checked : (english.checked || norwegian.checked) ? Qt.PartiallyChecked : Qt.Unchecked tristate: true } CheckBox { id: english text: qsTr("English") checked: true leftPadding: indicator.width } CheckBox { id: norwegian text: qsTr("Norwegian") checked: true leftPadding: indicator.width } } }
Ideally there would be a C++ model where the state is stored, but we'd still need an example that demonstrates how to hook that up to the boxes.
Some kind of QML convenience API would also help. JP suggested ButtonGroup::checkState, which would in turn require an exclusive property to turn off the exclusivity.
Attachments
Issue Links
- relates to
-
QTBUG-63782 Add declarative API to keep track of the checked buttons in a non-exclusive ButtonGroup
- Closed