📢 Webサイト閉鎖と移転のお知らせ
このWebサイトは2026年9月に閉鎖いたします。
新しい記事は移転先で追加しております。(旧サイトでは記事を追加しておりません)
| 364行目: | 364行目: | ||
} | } | ||
// Tagの表示 ( | // Tagの表示 (カンマ区切り) | ||
Rectangle { | Rectangle { | ||
width: Math.min(tagText.implicitWidth + 20, 150) | |||
height: 24 | height: 24 | ||
radius: 12 | radius: 12 | ||
visible: tags.length > 0 | |||
Text { | Text { | ||
id: tagText | id: tagText | ||
text: tags.join(", ") | |||
width: parent.width - 20 | |||
elide: Text.ElideRight // テキストが指定された幅を超えた場合は省略記号 (...) を表示 | |||
maximumLineCount: 1 | |||
anchors.centerIn: parent | anchors.centerIn: parent | ||
} | } | ||
} | } | ||
| 387行目: | 390行目: | ||
} | } | ||
// | // 新規アイテムの追加フォーム | ||
RowLayout { | RowLayout { | ||
Layout.fillWidth: true | Layout.fillWidth: true | ||
| 402行目: | 405行目: | ||
placeholderText: "Value" | placeholderText: "Value" | ||
validator: IntValidator {} | validator: IntValidator {} | ||
} | |||
TextField { | |||
id: tagsInput | |||
Layout.fillWidth: true | |||
placeholderText: "tags (カンマ区切り)" | |||
} | } | ||
| 411行目: | 420行目: | ||
nameInput.text, | nameInput.text, | ||
parseInt(valueInput.text), | parseInt(valueInput.text), | ||
tagsInput.text.split(",").map(tag => tag.trim()) | |||
) | ) | ||
nameInput.text = "" | nameInput.text = "" | ||
valueInput.text = "" | valueInput.text = "" | ||
tagsInput.text = "" | |||
} | } | ||
} | } | ||
| 422行目: | 432行目: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<br><br> | <br><br> | ||