Pane QML Type
アプリケーションのスタイルやテーマに合った背景を提供します。詳細...
Import Statement: | import QtQuick.Controls |
Inherits: | |
Inherited By: | Frame, Page, ScrollView, and ToolBar |
プロパティ
- contentChildren : list<Item>
- contentData : list<QtObject>
- contentHeight : real
- contentWidth : real
詳細説明
Pane は、アプリケーションのスタイルやテーマにマッチする背景色を提供します。ペインはそれ自体のレイアウトを提供しませんが、RowLayout やColumnLayout を作成するなどして、そのコンテンツを配置する必要があります。
ペイン」の子として宣言されたアイテムは、自動的に「ペイン」のcontentItem にペアレント化されます。動的に作成されたアイテムは、明示的にcontentItem
にペアレント化する必要があります。
Event Handling で述べたように、「ペイン」はクリックやタッチのイベントをその下のアイテムに通しません。wheelEnabled がtrue
の場合、マウス ホイールのイベントも同様です。
コンテンツのサイズ
ペイン内で 1 つのアイテムだけが使用されている場合、そのアイテムは含まれているアイテムの暗黙のサイズに合わせてリサイズされます。このため、特にレイアウトとの併用に適しています。
Pane { ColumnLayout { anchors.fill: parent CheckBox { text: qsTr("E-mail") } CheckBox { text: qsTr("Calendar") } CheckBox { text: qsTr("Contacts") } } }
ペイン内に 2 つのアイテムがある場合があります:
Pane { SwipeView { // ... } PageIndicator { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom } }
この場合、「ペイン」は適切な暗黙のサイズを計算できません。この場合、「ペイン」は適切な暗黙のサイズを計算できません。SwipeView の上にPageIndicator をアンカーしているので、単純にコンテンツのサイズをビューの暗黙のサイズに設定できます:
Pane { contentWidth: view.implicitWidth contentHeight: view.implicitHeight SwipeView { id: view // ... } PageIndicator { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom } }
contentItem に暗黙のサイズがなく、子が 1 つしかない場合、Pane はその子の暗黙のサイズを使用します。例えば、以下のコードでは、ペインは矩形のサイズを想定しています:
ペインのカスタマイズ」、「コンテナ コントロール」、「 Qt Quick Controls のフォーカス管理」、「Event Handling」も参照してください 。
プロパティ ドキュメント
このプロパティは、コンテンツの子のリストを保持します。
このリストには、ペインの子として QML で宣言されたすべてのアイテムが含まれます。
注: contentData
と異なり、contentChildren
には、視覚的でない QML オブジェクトは含まれません。
Item::children およびcontentDataも参照して ください。
このプロパティは、コンテンツデータのリストを保持します。
このリストには、ペインの子として QML で宣言されたすべてのオブジェクトが含まれます。
注: contentChildren
と異なり、contentData
には、視覚的でない QML オブジェクトも含まれます。
Item::data およびcontentChildrenも参照して ください。
contentHeight : real |
このプロパティはコンテンツの高さを保持します。このプロパティは、ペインの暗黙的な高さの合計を計算するために使用されます。
詳しくはContent Sizing を参照してください。
contentWidthも参照して ください。
contentWidth : real |
こ のプ ロ パテ ィ は内容幅を保持 し ます。ペインの暗黙的な幅の合計を計算するために使用されます。
詳細については、Content Sizing を参照してください。
contentHeightも参照して ください。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.