feat(Storybook): RadioButtonFlowSelector utility added

This commit is contained in:
Michał Cieślak 2024-07-03 13:35:36 +02:00 committed by Michał
parent 670aa4627e
commit 1d728a5241
3 changed files with 28 additions and 1 deletions

View File

@ -58,7 +58,7 @@ ListView {
}
Connections {
target: root.model
target: root.model || null
function onRowsInserted() {
if (rowModel.count === 0)

View File

@ -0,0 +1,26 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ.Core.Utils 0.1
import utils 1.0
Flow {
id: root
property alias model: repeater.model
property string selection: model ? model[initialSelection] : ""
property int initialSelection: 0
Repeater {
id: repeater
RadioButton {
text: modelData
checked: root.initialSelection === index
onToggled: selection = modelData
}
}
}

View File

@ -24,6 +24,7 @@ LogsView 1.0 LogsView.qml
PageToolBar 1.0 PageToolBar.qml
PagesList 1.0 PagesList.qml
PopupBackground 1.0 PopupBackground.qml
RadioButtonFlowSelector 1.0 RadioButtonFlowSelector.qml
SettingsLayout 1.0 SettingsLayout.qml
SingleItemProxyModel 1.0 SingleItemProxyModel.qml
SourceCodeBox 1.0 SourceCodeBox.qml