QExpansionItem 组件允许隐藏与用户不直接相关的内容。可以将它们视为点击时会展开的手风琴元素。它也被称为可折叠组件。
¥The QExpansionItem component allows the hiding of content that is not immediately relevant to the user. Think of them as accordion elements that expand when clicked on. It’s also known as a collapsible.
它们基本上是封装了附加功能的 QItem 组件。因此,它们可以包含在 QLists 中并继承 QItem 组件属性。
¥They are basically QItem components wrapped with additional functionality. So they can be included in QLists and inherit QItem component properties.
用法(Usage)
¥Usage
基本(Basic)
¥Basic
控制展开状态(Controlling expansion state)
¥Controlling expansion state
样式(Style)
¥Style
选项(Options)
¥Options
处理插入级别时,一般经验法则是 header-inset-level
会在标题上添加左填充,但不会对内容进行任何处理,而 content-inset-level
为内容添加了左填充。
¥When dealing with inset levels, a general rule of thumb is that header-inset-level
adds left padding to header while it doesn’t do anything with the content, while content-inset-level
adds left padding to the content.
行为(Behavior)
¥Behavior
提示
当路由附加到 QExpansionItem 的 header 时,以下仅通过展开图标切换的行为尤其有用。这样,点击 header 即可激活路由,点击展开图标即可展开内容。显然,你不能将这两个操作附加到整个标题上。
¥The behavior below of toggling by expand icon only is especially useful when having a route attached to the header of QExpansionItem. This way by clicking header it will activate the route and by clicking the expand icon it will, well, expand the content. You can’t have both actions attached to the whole header, obviously.